|
20 | 20 | ## Version Release |
21 | 21 | This Is Latest Release |
22 | 22 |
|
23 | | - $version_release = 1.1.0 |
| 23 | + $version_release = 1.1.1 |
24 | 24 |
|
25 | 25 | What's New?? |
26 | 26 |
|
@@ -64,17 +64,246 @@ allprojects { |
64 | 64 |
|
65 | 65 | dependencies { |
66 | 66 | // library frogo-keyboard |
67 | | - implementation 'com.github.amirisback:keyboard:1.1.0' |
| 67 | + implementation 'com.github.amirisback:keyboard:1.1.1' |
68 | 68 | } |
69 | 69 |
|
70 | 70 | #### <Option 2> Kotlin DSL Gradle |
71 | 71 |
|
72 | 72 | dependencies { |
73 | 73 | // library frogo-keyboard |
74 | | - implementation("com.github.amirisback:keyboard:1.1.0") |
| 74 | + implementation("com.github.amirisback:keyboard:1.1.1") |
75 | 75 | } |
76 | 76 |
|
77 | | -### Step 3. Coming Soon |
| 77 | +### Step 3. Create Service Keyboard IME |
| 78 | + |
| 79 | +#### Create Class Keyboard IME |
| 80 | +```kotlin |
| 81 | +class KeyboardIME : BaseKeyboardIME<YourIMELayoutBinding>() { |
| 82 | + |
| 83 | + // ovveride function from IKeyboardIME |
| 84 | + |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +#### Interface IKeyboardIME |
| 89 | +```kotlin |
| 90 | +interface IKeyboardIME { |
| 91 | + |
| 92 | + fun initialSetupKeyboard() |
| 93 | + |
| 94 | + fun setupBinding() |
| 95 | + |
| 96 | + fun invalidateKeyboard() |
| 97 | + |
| 98 | + fun initCurrentInputConnection() |
| 99 | + |
| 100 | + fun hideMainKeyboard() |
| 101 | + |
| 102 | + fun showMainKeyboard() |
| 103 | + |
| 104 | + fun showOnlyKeyboard() |
| 105 | + |
| 106 | + fun hideOnlyKeyboard() |
| 107 | + |
| 108 | + fun EditText.showKeyboardExt() |
| 109 | + |
| 110 | + fun initBackToMainKeyboard() |
| 111 | + |
| 112 | + fun setupFeatureKeyboard() |
| 113 | + |
| 114 | + fun initView() |
| 115 | + |
| 116 | + fun invalidateAllKeys() |
| 117 | + |
| 118 | + @RequiresApi(Build.VERSION_CODES.M) |
| 119 | + fun runEmojiBoard() |
| 120 | + |
| 121 | + fun updateShiftKeyState() |
| 122 | + |
| 123 | + @RequiresApi(Build.VERSION_CODES.M) |
| 124 | + fun onKeyExt(code: Int, inputConnection: InputConnection) |
| 125 | + |
| 126 | + fun moveCursor(moveRight: Boolean) |
| 127 | + |
| 128 | + fun getImeOptionsActionId(): Int |
| 129 | + |
| 130 | + fun getKeyboardLayoutXML(): Int |
| 131 | + |
| 132 | +} |
| 133 | +``` |
| 134 | + |
| 135 | +### Step 4. Create Layout Keyboard IME |
| 136 | +```xml |
| 137 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 138 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 139 | + android:id="@+id/keyboard_holder" |
| 140 | + android:layout_width="match_parent" |
| 141 | + android:layout_height="wrap_content" |
| 142 | + android:background="@color/keyboard_bg_root"> |
| 143 | + |
| 144 | + <LinearLayout |
| 145 | + android:id="@+id/container_keyboard_main" |
| 146 | + android:layout_width="match_parent" |
| 147 | + android:layout_height="match_parent" |
| 148 | + android:orientation="vertical" |
| 149 | + app:layout_constraintBottom_toBottomOf="parent"> |
| 150 | + |
| 151 | + <androidx.recyclerview.widget.RecyclerView |
| 152 | + android:id="@+id/keyboard_header" |
| 153 | + android:layout_width="match_parent" |
| 154 | + android:layout_height="wrap_content" |
| 155 | + android:background="@color/keyboard_bg_root" |
| 156 | + android:minHeight="@dimen/frogo_dimen_64dp" /> |
| 157 | + |
| 158 | + <com.frogobox.libkeyboard.ui.main.MainKeyboard |
| 159 | + android:id="@+id/keyboard_main" |
| 160 | + style="@style/KwKeyboardView" |
| 161 | + android:layout_width="match_parent" |
| 162 | + android:layout_height="wrap_content" |
| 163 | + android:background="@color/theme_dark_background_color" /> |
| 164 | + |
| 165 | + </LinearLayout> |
| 166 | + |
| 167 | + <LinearLayout |
| 168 | + android:id="@+id/mock_measure_height_keyboard" |
| 169 | + android:layout_width="match_parent" |
| 170 | + android:layout_height="match_parent" |
| 171 | + android:orientation="vertical" |
| 172 | + android:visibility="gone" |
| 173 | + app:layout_constraintBottom_toTopOf="@id/container_keyboard_main"> |
| 174 | + |
| 175 | + <androidx.recyclerview.widget.RecyclerView |
| 176 | + android:id="@+id/mock_keyboard_header" |
| 177 | + android:layout_width="match_parent" |
| 178 | + android:layout_height="wrap_content" |
| 179 | + android:background="@color/keyboard_bg_root" |
| 180 | + android:minHeight="@dimen/frogo_dimen_64dp" /> |
| 181 | + |
| 182 | + <com.frogobox.libkeyboard.ui.main.MainKeyboard |
| 183 | + android:id="@+id/mock_measure_height_keyboard_main" |
| 184 | + style="@style/KwKeyboardView" |
| 185 | + android:layout_width="match_parent" |
| 186 | + android:layout_height="wrap_content" |
| 187 | + android:background="@color/theme_dark_background_color" /> |
| 188 | + |
| 189 | + </LinearLayout> |
| 190 | + |
| 191 | + <com.frogobox.appkeyboard.ui.keyboard.autotext.AutoTextKeyboard |
| 192 | + android:id="@+id/keyboard_autotext" |
| 193 | + android:layout_width="match_parent" |
| 194 | + android:layout_height="0dp" |
| 195 | + android:clickable="true" |
| 196 | + android:focusable="true" |
| 197 | + android:visibility="gone" |
| 198 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 199 | + app:layout_constraintEnd_toEndOf="parent" |
| 200 | + app:layout_constraintStart_toStartOf="parent" |
| 201 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 202 | + |
| 203 | + <com.frogobox.appkeyboard.ui.keyboard.templatetext.TemplateTextKeyboard |
| 204 | + android:id="@+id/keyboard_template_text" |
| 205 | + android:layout_width="match_parent" |
| 206 | + android:layout_height="0dp" |
| 207 | + android:clickable="true" |
| 208 | + android:focusable="true" |
| 209 | + android:visibility="gone" |
| 210 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 211 | + app:layout_constraintEnd_toEndOf="parent" |
| 212 | + app:layout_constraintStart_toStartOf="parent" |
| 213 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 214 | + |
| 215 | + <com.frogobox.appkeyboard.ui.keyboard.news.NewsKeyboard |
| 216 | + android:id="@+id/keyboard_news" |
| 217 | + android:layout_width="match_parent" |
| 218 | + android:layout_height="0dp" |
| 219 | + android:clickable="true" |
| 220 | + android:focusable="true" |
| 221 | + android:visibility="gone" |
| 222 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 223 | + app:layout_constraintEnd_toEndOf="parent" |
| 224 | + app:layout_constraintStart_toStartOf="parent" |
| 225 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 226 | + |
| 227 | + <com.frogobox.appkeyboard.ui.keyboard.movie.MovieKeyboard |
| 228 | + android:id="@+id/keyboard_moview" |
| 229 | + android:layout_width="match_parent" |
| 230 | + android:layout_height="0dp" |
| 231 | + android:clickable="true" |
| 232 | + android:focusable="true" |
| 233 | + android:visibility="gone" |
| 234 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 235 | + app:layout_constraintEnd_toEndOf="parent" |
| 236 | + app:layout_constraintStart_toStartOf="parent" |
| 237 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 238 | + |
| 239 | + <com.frogobox.appkeyboard.ui.keyboard.webview.WebiewKeyboard |
| 240 | + android:id="@+id/keyboard_webview" |
| 241 | + android:layout_width="match_parent" |
| 242 | + android:layout_height="0dp" |
| 243 | + android:clickable="true" |
| 244 | + android:focusable="true" |
| 245 | + android:visibility="gone" |
| 246 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 247 | + app:layout_constraintEnd_toEndOf="parent" |
| 248 | + app:layout_constraintStart_toStartOf="parent" |
| 249 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 250 | + |
| 251 | + <com.frogobox.appkeyboard.ui.keyboard.form.FormKeyboard |
| 252 | + android:id="@+id/keyboard_form" |
| 253 | + android:layout_width="match_parent" |
| 254 | + android:layout_height="0dp" |
| 255 | + android:clickable="true" |
| 256 | + android:focusable="true" |
| 257 | + android:visibility="gone" |
| 258 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 259 | + app:layout_constraintEnd_toEndOf="parent" |
| 260 | + app:layout_constraintStart_toStartOf="parent" |
| 261 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 262 | + |
| 263 | + <com.frogobox.libkeyboard.ui.emoji.EmojiKeyboard |
| 264 | + android:id="@+id/keyboard_emoji" |
| 265 | + android:layout_width="match_parent" |
| 266 | + android:layout_height="0dp" |
| 267 | + android:clickable="true" |
| 268 | + android:focusable="true" |
| 269 | + android:visibility="gone" |
| 270 | + app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard" |
| 271 | + app:layout_constraintEnd_toEndOf="parent" |
| 272 | + app:layout_constraintStart_toStartOf="parent" |
| 273 | + app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" /> |
| 274 | + |
| 275 | +</androidx.constraintlayout.widget.ConstraintLayout> |
| 276 | +``` |
| 277 | + |
| 278 | +### Step 5. Create KeyConfig |
| 279 | +```xml |
| 280 | +<?xml version="1.0" encoding="utf-8"?> |
| 281 | +<input-method xmlns:android="http://schemas.android.com/apk/res/android" |
| 282 | + android:icon="@drawable/ic_frogobox" |
| 283 | + android:settingsActivity="com.frogobox.appkeyboard.ui.main.MainActivity"> |
| 284 | + |
| 285 | + <subtype android:imeSubtypeMode="Keyboard" /> |
| 286 | + |
| 287 | +</input-method> |
| 288 | + |
| 289 | +``` |
| 290 | + |
| 291 | +### Step 6. Create Keyboard Service In Manifest |
| 292 | +```xml |
| 293 | +<service |
| 294 | + android:name=".services.KeyboardIME" |
| 295 | + android:exported="true" |
| 296 | + android:label="@string/app_name" |
| 297 | + android:permission="android.permission.BIND_INPUT_METHOD"> |
| 298 | + <meta-data |
| 299 | + android:name="android.view.im" |
| 300 | + android:resource="@xml/keys_config" /> |
| 301 | + <intent-filter> |
| 302 | + <action android:name="android.view.InputMethod" /> |
| 303 | + </intent-filter> |
| 304 | +</service> |
| 305 | +``` |
| 306 | + |
78 | 307 |
|
79 | 308 | ## Video Play |
80 | 309 | https://user-images.githubusercontent.com/24654871/231431022-4410933f-7199-4967-9db1-24544f5593e0.mp4 |
|
0 commit comments