diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ac1e4db8..cdd831f4 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -6,7 +6,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - @@ -14,16 +13,18 @@ android:allowBackup="false" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/AppTheme"> + android:theme="@style/Theme.AppCompat.DayNight"> - + - + @@ -33,6 +34,6 @@ android:excludeFromRecents="true" android:label="@string/add_word_title" android:name="io.github.sspanak.tt9.ui.AddWordAct" - android:theme="@android:style/Theme.Dialog"/> + android:theme="@style/Theme.AppCompat.DayNight.Dialog"/> diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..8986f15c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# Traditional T9 Contribution Guide +If you would like to contribute to the project by fixing a bug, adding a new language or something else, read below. + + +## Getting Started +- If you are about to write code, you need to setup your development environment. See the [Building](#building) section. +- If you would like to add a new language, follow the [New Language](#adding-a-new-language) section. +- Finally, see what is the actual [contribution process](#contribution-process) and how to get your code merged. + + +## Building +The recommended way of building is using Android Studio. As the of time of writing this, the current version is: Android Studio Dolphin | 2021.3.1. + +### Building a Debug .apk +If you have not configured Android Studio yet, follow [the official manual](https://developer.android.com/training/basics/firstapp), then follow the simple steps below to get the project running. + +- _Import the project in Android Studio._ +- _Prevent the "Default Activity not found" issue._ The app does not have a default view or a launcher icon. For this reason, you must configure Android Studio not to launch anything after installing, otherwise it will fail with "Default Activity not found" or a similar message. To do so: + - Open "Edit Configurations..." (Press Shift 3 times and select it from the command list) + - Go to "General" tab. + - Change "Launch Options" to "Nothing" + - Hit "OK" + +That's it! Now you should be able to deploy and debug the app on your device. + +You can find more info in this [Github issue](https://github.com/android/input-samples/issues/18). + +### Building a Release .apk +The project is configured to build an unsigned release variant by default. + +- Select the "release" variant from Android Studio options (`Build` -> `Select Build Variant...`) +- `Build` -> `Rebuild Project`. After that, just ignore all warnings until you get to the end of the process. +- Find the `.apk` in the generated 'build/' folder. + +_Note that it may not be possible to install an unsigned `.apk` on newer versions of Android. You must either manually sign it or build a signed one instead._ + +### Building a Signed .apk +Make sure you have a signing key. If you don't have one, follow the [official manual](https://developer.android.com/studio/publish/app-signing#sign-apk). + +- Select `Build` -> `Generate Signed Bundle / APK...`. +- Select `APK` and proceed to the next screen. +- Enter your key details (or create a new one) and continue to the next screen. +- Choose the "Release" variant, then click `Finish` to start building. +- Android Studio will tell you where the `.apk` is, but if it does not, try looking for it in the `release/` folder. + +## Adding a New Language +To support a new language one needs to: + +- Add status icons + - Create a proper icon for each screen size. The icon needs to contain the abbreviation of the language. (e.g. "En" for "English"). + - The font must be Roboto Lt at an adequate size to fit the icon square with minimum padding. + - The text must be white and the background must be transparent as per the [official Android guide](https://android-doc.github.io/guide/practices/ui_guidelines/icon_design_status_bar.html). + - To simplify the process, you could use Android Studio. It has a built-in icon generator accessible by right-cicking on "drawable" folder -> New -> Image Asset. Then choose "Icon Type": "Notification Icons", "Asset Type": Text, "Trim": No, "Padding": 0%. +- Find a suitable dictionary and add it to `assets` folder. Ensure it does not contain single letters. The application will add them automatically. +- Do not forget to include the dictionary license (or readme) file in the `docs/` folder. +- Create a new language class in `languages/definitions/`. Make sure to set all properties. + - `ID` must be the next available number. + - Set `isPunctuationPartOfWords` to `true`, if you need to use the 1-key for typing words, such as: `it's`, `a'tje` or `п'ят`. Otherwise, it would not be possible to type them, nor will they appear as suggestions. `false` will allow faster typing when apostrophes or other punctuation are not part of the words. +- Add the new language to the list in `LanguageCollection.java`. You only need to add it in one place, in the constructor. Please, be nice and maintain the alphabetical order. +- Optionally, translate Traditional T9 in your language, by adding `res/values/strings-your-lang`. The Android Studio translation editor is very handy. + + +## Contribution Process + +### Before you start +- Find the issue you are interested in or create a new one. +- Assign it to yourself, to indicate you are working on it. This will prevent someone else, who is unaware that you are working, to pick it up and do the same thing. + +### After you are done +- Ensure there are no building errors or warnings, and the code works properly. +- Clean up any commented or unused code. +- Rebase with the latest `master`. Fix any conflicts, if necessary. +- Open a pull request and link the issue you are solving. +- If any review discussions begin, you may need to do some extra improvements. +- Have in mind, some PRs may be rejected, for example, if you have used third-party code or images without an appropriate license, or if your changes are targeting a very specific phone and breaking functionality on another one. It may be rejected due to other reasons, too. +- Once all discussions have been resolved, your PR is ready for merging. Congratulations and thank you for the contribution! \ No newline at end of file diff --git a/README.md b/README.md index b7290abf..58c3f5ae 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Traditional T9 -TT9 is an IME (Input Method Editor) for Android devices with hardware keypad. It supports multiple languages and predictive text typing. _NOTE: TT9 is not usable on touchscreen-only devices._ +TT9 is an IME (Input Method Editor) for Android devices with a hardware keypad. It supports multiple languages and predictive text typing. This is an updated version of the [original project](https://github.com/Clam-/TraditionalT9) by Clam-. @@ -9,73 +9,27 @@ This is an updated version of the [original project](https://github.com/Clam-/Tr or get the APK from the [Releases Section](https://github.com/sspanak/tt9/releases/latest). +## System Requirements +- Android 4.4 or higher. _(Tested and confirmed on Android 4.4.2, 5.1.1 and 11)_ +- Free space: + - Minimum 10 Mb when not using Predictive mode and no dictionaries are loaded. + - About 25 Mb per each enabled language in Predictive mode +- A hardware keypad or a keyboard. The application is not usable on touchscreen-only devices. + +_If you own a phone with Android 2.2 up to 4.4, please refer to the original version of Traditional T9 from 2016._ + ## Using Traditional T9 -If you just wish to install and use TT9, see the [user manual](docs/user-manual.md). You don't need to read anything below this line. +If you just wish to install and use Traditional T9, check out the [user manual](docs/user-manual.md) for useful tips and a list of keypad shortcuts. -## Building -The recommended way of building is using Android Studio. As the of time of writing this, the current version is: Android Studio Dolphin | 2021.3.1. - -### Building a Debug .apk -If you have not configured Android Studio yet, follow [the official manual](https://developer.android.com/training/basics/firstapp), then follow the simple steps below to get the project running. - -- _Import the project in Android Studio._ -- _Prevent the "Default Activity not found" issue._ The app does not have a default view or a launcher icon. For this reason, you must configure Android Studio not to launch anything after installing, otherwise it will fail with "Default Activity not found" or a similar message. To do so: - - Open "Edit Configurations..." (Press Shift 3 times and select it from the command list) - - Go to "General" tab. - - Change "Launch Options" to "Nothing" - - Hit "OK" - -That's it! Now you should be able to deploy and debug the app on your device. - -You can find more info in this [Github issue](https://github.com/android/input-samples/issues/18). - -### Building a Release .apk -The project is configured to build an unsigned release variant by default. - -- Select the "release" variant from Android Studio options (`Build` -> `Select Build Variant...`) -- `Build` -> `Rebuild Project`. After that, just ignore all warnings until you get to the end of the process. -- Find the `.apk` in the generated 'build/' folder. - -_Note that it may not be possible to install an unsigned `.apk` on newer versions of Android. You must either manually sign it or build a signed one instead._ - -### Building a Signed .apk -Make sure you have a signing key. If you don't have one, follow the [official manual](https://developer.android.com/studio/publish/app-signing#sign-apk). - -- Select `Build` -> `Generate Signed Bundle / APK...`. -- Select `APK` and proceed to the next screen. -- Enter your key details (or create a new one) and continue to the next screen. -- Choose the "Release" variant, then click `Finish` to start building. -- Android Studio will tell you where the `.apk` is, but if it does not, try looking for it in the `release/` folder. - -## Adding a new language -To support a new language one needs to: - -- Add status icons - - Create a proper icon for each screen size. The icon needs to contain the abbreviation of the language. (e.g. "En" for "English"). - - The font must be Roboto Lt at an adequate size to fit the icon square with minimum padding. - - The text must be white and the background must be transparent as per the [official Android guide](https://android-doc.github.io/guide/practices/ui_guidelines/icon_design_status_bar.html). - - To simplify the process, you could use Android Studio. It has a built-in icon generator accessible by right-cicking on "drawable" folder -> New -> Image Asset. Then choose "Icon Type": "Notification Icons", "Asset Type": Text, "Trim": No, "Padding": 0%. -- Find a suitable dictionary and add it to `assets` folder. -- Create a new language class in `languages/definitions/`. Make sure to set all properties. - - `ID` must be the next available number. Currently, the range is limited between 1 and 31, so there can be 31 languages in total. - - Set `isPunctuationPartOfWords` to `true`, if you need to use the 1-key for typing words, such as: `it's`, `a'tje` or `п'ят`. Otherwise, it would not be possible to type them, nor will they appear as suggestions. `false` is recommended when apostrophes or other punctuation are not part of the words, to allow faster typing. -- Add the new language to the list in `LanguageCollection.java`. You only need to add it in one place, in the constructor. Please, be nice and maintain the alphabetical order. -- Add a new entry in `res/values/const.xml`. Make sure the new ID matches the one in the language class. -- Add new entries in `res/values/arrays.xml`. -- Add translations in `res/values/strings-your-lang`. The Android Studio translation editor is very handy. - -## Word Lists -Here is detailed information and licenses about the word lists used: -- [Bulgarian word list](docs/bgWordlistReadme.txt) -- [English word list](docs/enWordlistReadme.txt) -- [French word list](docs/frWordlistReadme.txt) -- [German word list](docs/deWordlistReadme.txt) -- [Russian word list](docs/ruWordlistReadme.txt) -- [Ukrainian word list](docs/ukWordlistReadme.txt) +## Contributing to the Project +As with many other open-source projects, this one is also maintained by its author in his free time. Any help in making Traditional T9 better will be highly appreciated. This includes: +- Testing on different phones and reporting bugs or other unusual behavior. Currently, the only testing and development device is: Qin F21 Pro+ / Android 11. +- Adding new translations or fixing incorrect ones. +- Writing new code. If you are a developer and you are willing fix a bug, add a new language or maybe create a brand new feature, see the [Contribution Guide](CONTRIBUTING.md). ## License - The source code, the logo image and the icons are licensed under the conditions described in [LICENSE.txt](LICENSE.txt). -- The word lists / dictionaries are licensed under the licenses provided in the [respective readme files](#word-lists), where applicable. +- The dictionaries are licensed under the licenses provided in the [respective readme files](docs/dictionaries/), where applicable. Detailed information about the dictionaries is also available there. - [Silver foil photo created by rawpixel.com - www.freepik.com](https://www.freepik.com/photos/silver-foil) - "Roboto" font is under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). - "Negotiate" and "Vibrocentric" fonts are under [The Fontspring Desktop/Ebook Font End User License](docs/desktop-ebook-EULA-1.8.txt). diff --git a/docs/bgWordlistReadme.txt b/docs/dictionaries/bgWordlistReadme.txt similarity index 100% rename from docs/bgWordlistReadme.txt rename to docs/dictionaries/bgWordlistReadme.txt diff --git a/docs/deWordlistReadme.txt b/docs/dictionaries/deWordlistReadme.txt similarity index 100% rename from docs/deWordlistReadme.txt rename to docs/dictionaries/deWordlistReadme.txt diff --git a/docs/enWordlistReadme.txt b/docs/dictionaries/enWordlistReadme.txt similarity index 100% rename from docs/enWordlistReadme.txt rename to docs/dictionaries/enWordlistReadme.txt diff --git a/docs/frWordlistReadme.txt b/docs/dictionaries/frWordlistReadme.txt similarity index 100% rename from docs/frWordlistReadme.txt rename to docs/dictionaries/frWordlistReadme.txt diff --git a/docs/nlWordlistReadme.txt b/docs/dictionaries/nlWordlistReadme.txt similarity index 100% rename from docs/nlWordlistReadme.txt rename to docs/dictionaries/nlWordlistReadme.txt diff --git a/docs/ruWordlistReadme.txt b/docs/dictionaries/ruWordlistReadme.txt similarity index 100% rename from docs/ruWordlistReadme.txt rename to docs/dictionaries/ruWordlistReadme.txt diff --git a/docs/ukWordlistReadme.txt b/docs/dictionaries/ukWordlistReadme.txt similarity index 100% rename from docs/ukWordlistReadme.txt rename to docs/dictionaries/ukWordlistReadme.txt diff --git a/docs/user-manual.md b/docs/user-manual.md index 0e2c5725..45c7bc69 100644 --- a/docs/user-manual.md +++ b/docs/user-manual.md @@ -4,7 +4,7 @@ TT9 is an IME (Input Method Editor) for Android devices with hardware keypad. It All Source code and documentation are available on Github: [https://github.com/sspanak/tt9](https://github.com/sspanak/tt9). ## Initial Setup -In order to use Traditional T9, you need to enable it as an Android keyboard. To do so: +After installing, in order to use Traditional T9, you need to enable it as an Android keyboard. To do so: - Go to Android Settings → System → Languages → Keyboards. - Add Traditional T9 IME. @@ -56,26 +56,32 @@ _Predictive mode only._ - **In 123 mode:** type the respective number. - **In ABC and Predictive mode:** type a letter/punctuation character or hold to type the respective number. -#### Text Mode Key (Hash/Pound/#): -- **Short press:** Cycle input modes (abc → ABC → Predictive → 123) -- **Short press while typing:** Change between UPPERCASE/lowercase. -- **Long press:** Select the next language. -- **Number-only fields:** Type a "#". Changing the mode is not possible in such fields. +#### Add Word Key (Default: Press ✱): +Add a new word to the dictionary for the current language. -#### Other Actions Key (Star/✱): -- **Short press:** Add a new word to the dictionary. -- **Long press:** Open the Configration screen. +#### Backspace Key (Default: Press ↩ / Back): +Just deletes text. -#### Backspace Key (Back/↩): -- Just deletes text. - -**Note:** "Back" key plays a somewhat special role in Android. This role needs to be preserved for your phone to remain usable. Have in mind the notes below: +**Note:** The default "Back" key plays a somewhat special role in Android. This role needs to be preserved for your phone to remain usable. Have in mind the notes below: - **Short Press when there is no text**: Go back to the previous screen (the system default action). - **Short Press when there is text:** Some applications, most notably Firefox and Spotify, take full control of the "Back" key. This means, it may function as the application authors intended, instead of as backspace. In such cases, you could use the on-screen backspace instead. Unfortunately, nothing else could be done, because this is a restriction posed by Android. - **Long Press**: Whatever the system default action is (i.e. show running applications list). -## On-screen soft keys -All functionality is available using the keypad, but for convenience, on touchscreen phones or the ones with customizable function keys, you could also use the on-screen soft keys. +All this does not apply, when using other keys. They will just delete text + +#### Next Input Mode Key (Default: Press #): +- **Press when there are no suggestions:** Cycle the input modes (abc → ABC → Predictive → 123). Note that only 123 mode is available in numeric fields and Predictive mode is not available in password fields. +- **Press while suggestions are on:** Toggle the suggestions between UPPERCASE and lowercase. +- **Number-only fields:** No special action. Type a "#" with the default key. Changing the mode is not possible in such fields. + +#### Next Language Key (Default: Hold #): +Select the next language, when mulitple languages have been enabled from the Settings. + +#### Settings Key (Default: Hold ✱): +Open the Configration screen. + +## On-screen Soft keys +All functionality is available using the keypad, but for convenience, on touchscreen phones, you could also use the on-screen keys. If you instead prefer to have more screen space, disable them from the Settings. #### Left Soft Key: Open the [Settings screen](#settings-screen). @@ -84,18 +90,18 @@ Open the [Settings screen](#settings-screen). Backspace. ## Settings Screen -On the Configuration screen, you can choose your preferred languages, load a dictionary for Predictive mode or view this manual. +On the Settings screen, you can choose languages for typing, configure the keypad hotkeys or change the application appearance. To access it: - Start typing in a text field to wake up TT9. -- Use the on-screen gear button or hold Other Actions Key. +- Use the on-screen gear button or hold the Settings Key. ## License - The source code, the logo image and the icons are licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). -- The word lists / dictionaries are licensed under the licenses provided in the respective readme files found in the source code, where applicable. +- The dictionaries are licensed under the licenses provided in the [respective readme files](dictionaries/), where applicable. Detailed information about the dictionaries is also available there. - [Silver foil photo created by rawpixel.com - www.freepik.com](https://www.freepik.com/photos/silver-foil) - "Roboto" font is under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). -- "Negotiate" and "Vibrocentric" fonts are under [The Fontspring Desktop/Ebook Font End User License](desktop-ebook-EULA-1.8.txt) +- "Negotiate" and "Vibrocentric" fonts are under [The Fontspring Desktop/Ebook Font End User License](desktop-ebook-EULA-1.8.txt). ## Privacy Policy Traditional T9 does not collect any information about you or about the way you are using using the application. diff --git a/res/drawable-hdpi/btn_circle_disable.png b/res/drawable-hdpi/btn_circle_disable.png deleted file mode 100644 index 917bc284..00000000 Binary files a/res/drawable-hdpi/btn_circle_disable.png and /dev/null differ diff --git a/res/drawable-hdpi/btn_circle_disable_focused.png b/res/drawable-hdpi/btn_circle_disable_focused.png deleted file mode 100644 index 749ebb12..00000000 Binary files a/res/drawable-hdpi/btn_circle_disable_focused.png and /dev/null differ diff --git a/res/drawable-hdpi/btn_circle_normal.png b/res/drawable-hdpi/btn_circle_normal.png deleted file mode 100644 index 72a4388c..00000000 Binary files a/res/drawable-hdpi/btn_circle_normal.png and /dev/null differ diff --git a/res/drawable-hdpi/btn_circle_pressed.png b/res/drawable-hdpi/btn_circle_pressed.png deleted file mode 100644 index 90651cee..00000000 Binary files a/res/drawable-hdpi/btn_circle_pressed.png and /dev/null differ diff --git a/res/drawable-hdpi/btn_circle_selected.png b/res/drawable-hdpi/btn_circle_selected.png deleted file mode 100644 index e5b58e1e..00000000 Binary files a/res/drawable-hdpi/btn_circle_selected.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_btn_round_more_disabled.png b/res/drawable-hdpi/ic_btn_round_more_disabled.png deleted file mode 100644 index 31291273..00000000 Binary files a/res/drawable-hdpi/ic_btn_round_more_disabled.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_btn_round_more_normal.png b/res/drawable-hdpi/ic_btn_round_more_normal.png deleted file mode 100644 index 3b0f76b6..00000000 Binary files a/res/drawable-hdpi/ic_btn_round_more_normal.png and /dev/null differ diff --git a/res/drawable/btn_circle.xml b/res/drawable/btn_circle.xml deleted file mode 100644 index 9df5abbc..00000000 --- a/res/drawable/btn_circle.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - diff --git a/res/drawable/bggradient.xml b/res/drawable/button_background.xml similarity index 65% rename from res/drawable/bggradient.xml rename to res/drawable/button_background.xml index 52ca3c9f..84f2e578 100644 --- a/res/drawable/bggradient.xml +++ b/res/drawable/button_background.xml @@ -1,9 +1,8 @@ - diff --git a/res/drawable/button_grad.xml b/res/drawable/button_background_dark.xml similarity index 100% rename from res/drawable/button_grad.xml rename to res/drawable/button_background_dark.xml diff --git a/res/drawable/button_custom.xml b/res/drawable/button_custom.xml deleted file mode 100644 index 2f3497c4..00000000 --- a/res/drawable/button_custom.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/res/drawable/button_grad_press.xml b/res/drawable/button_separator.xml similarity index 65% rename from res/drawable/button_grad_press.xml rename to res/drawable/button_separator.xml index be81f300..42b30796 100644 --- a/res/drawable/button_grad_press.xml +++ b/res/drawable/button_separator.xml @@ -1,9 +1,8 @@ - diff --git a/res/drawable/button_separator_dark.xml b/res/drawable/button_separator_dark.xml new file mode 100644 index 00000000..5be65e01 --- /dev/null +++ b/res/drawable/button_separator_dark.xml @@ -0,0 +1,8 @@ + + + + diff --git a/res/drawable/ic_btn_round_more.xml b/res/drawable/ic_btn_round_more.xml deleted file mode 100644 index b4bfc879..00000000 --- a/res/drawable/ic_btn_round_more.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/res/drawable/suggestion_separator.xml b/res/drawable/suggestion_separator.xml index ba68ceec..2b394bb1 100644 --- a/res/drawable/suggestion_separator.xml +++ b/res/drawable/suggestion_separator.xml @@ -1,5 +1,5 @@ - + diff --git a/res/layout/checkbox.xml b/res/layout/checkbox.xml deleted file mode 100644 index 349d6397..00000000 --- a/res/layout/checkbox.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/res/layout/mainview.xml b/res/layout/mainview.xml index 3ee4a495..ced08e29 100644 --- a/res/layout/mainview.xml +++ b/res/layout/mainview.xml @@ -8,63 +8,61 @@ android:id="@+id/main_suggestions_list" android:layout_width="fill_parent" android:layout_height="@dimen/candidate_list_height" + android:fadingEdge="horizontal" android:orientation="horizontal" - android:scrollbars="none" - android:background="@color/candidate_background" /> + android:paddingTop="1px" + android:scrollbars="none" />