Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soft keyboard numpad #231

Merged
merged 6 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ 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)_
- Android 4.4 or higher. _(Tested and confirmed on Android 4.4.2, 10 and 11)_
- Free space:
- Minimum 25 Mb when not using Predictive mode and no dictionaries are loaded.
- Plenty of space per each enabled language in Predictive mode (25-100 Mb, depending on the word count).
- A hardware keypad or a keyboard. The application is not usable on touchscreen-only devices.
- A hardware keypad or a keyboard. For touchscreen-only devices, an on-screen keypad can be enabled in the Settings.

_If you own a phone with Android 2.2 up to 4.4, please refer to the original version of Traditional T9 from 2016._

Expand All @@ -24,9 +24,9 @@ Before using Traditional T9 for the first time you would need to load a dictiona
So make sure to read the initial setup and the hotkey tips in the [user manual](docs/user-manual.md).

## 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. Here is what you could do:
- [Report bugs](https://github.com/sspanak/tt9/issues) or other unusual behavior on different phones. Currently, the only testing and development device is: Qin F21 Pro+ / Android 11.
- Add [a new language](CONTRIBUTING.md#adding-a-new-language), [new UI translations](CONTRIBUTING.md#translating-the-ui) or simply fix a spelling mistake. The process is very simple and even with minimum techincal knowledge, your skills as a native speaker will be of great use. Or, if you are not tech-savvy, just [open a new issue](https://github.com/sspanak/tt9/issues) and put the correct translations there.
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. Here is how:
- [Report bugs](https://github.com/sspanak/tt9/issues) or other unusual behavior on different phones. Currently, the only testing and development devices are: Qin F21 Pro+ / Android 11; Energizer H620SEU / Android 10. But Android behaviour and appearance varies a lot across the millions of devices available out there.
- Add [a new language](CONTRIBUTING.md#adding-a-new-language), [new UI translations](CONTRIBUTING.md#translating-the-ui) or simply fix a spelling mistake. The process is very simple and even with minimum technical knowledge, your skills as a native speaker will be of great use. Or, if you are not tech-savvy, just [open a new issue](https://github.com/sspanak/tt9/issues) and put the correct translations there.
- Experienced developers who are willing fix a bug, or maybe create a brand new feature, see the [Contribution Guide](CONTRIBUTING.md).

Your PRs are welcome!
Expand Down
27 changes: 13 additions & 14 deletions docs/user-manual.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# 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, and an on-screen numpad for touchscreen devices.

All source code, documentation and the privacy policy are available on Github: [https://github.com/sspanak/tt9](https://github.com/sspanak/tt9).

## Initial Setup
After installing, in order to use Traditional T9, you need to enable it as an Android keyboard. To do so, click on the launcher icon. If you
need to take any action, you will see the Initial Setup screen, where you will be prompted to enable TT9 and set it as default system
keyboard.
After installing, in order to use Traditional T9, you need to enable it as an Android keyboard. To do so, click on the launcher icon. If you need to take any action, all options besides Initial Setup would be disabled and there would be a label saying TT9 is disabled. Go to Initial Setup and enable it.

_If you don't see the icon right after installing, restart your phone and it should appear. Android is trying to save some battery life by not refreshing the newly installed apps list in some cases._

### Using on a touchscreen-only phone
If your phone does not have a hardware keypad, check out the [On-screen Keypad section](#on-screen-keypad).

### Enabling Predictive Mode
With the default settings, it is only possible to type in 123 and ABC modes. In order to enable the Predictive mode, there are additional steps:

Expand Down Expand Up @@ -47,8 +48,8 @@ Select next word/letter suggestion.
#### D-pad Right (→):
_Predictive mode only._

- **Single press**: Filter the suggestion list, leaving out only the ones that start with the current word. It doesn't matter if it is a complete word or not. For example, type "rewin" and press Right. It will leave out all words starting with "rewin": "rewin" itself, "rewind", "rewinds", "rewinded", "rewinding", and so on.
- **Double press**: Expand the filter to the full suggestion. For example, type "rewin" and press Right twice. It will first filter by "rewin", then expand the filter to "rewind". You can keep expanding the filter with Right, until you get to the longest suggestion in the list.
- **Single press**: Filter the suggestion list, leaving out only the ones that start with the current word. It doesn't matter if it is a complete word or not. For example, type "remin" and press Right. It will leave out all words starting with "remin": "remin" itself, "remind", "reminds", "reminded", "reminding", and so on.
- **Double press**: Expand the filter to the full suggestion. For example, type "remin" and press Right twice. It will first filter by "remin", then expand the filter to "remind". You can keep expanding the filter with Right, until you get to the longest suggestion in the list.

Filtering can also be used to type unknown words. Let's say you want to type "Anakin", which is not in the dictionary. Start with "A", then press Right to hide "B" and "C". Now press 6-key. Since the filter is on, in addition to the real dictionary words, it will provide all possible combinations for 6: "Am", "An", "Ao". Select "An" and press Right to confirm your selection. Now pressing 2-key, will provide "Ana", "Anb", "Anc". You can keep going, until you complete "Anakin".

Expand Down Expand Up @@ -103,19 +104,17 @@ _In these cases, you could assign another key (all other keys are fully usable),
- **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.
Select the next language, when multiple languages have been enabled from the Settings.

#### Settings Key (Default: Hold ✱):
Open the Configration screen.
Open the Settings configuration 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.
## On-screen Keypad
On touchscreen-only phones, a fully functional on-screen keypad is available. Enable it from Settings -> Appearance -> Show On-Screen Numpad.

#### Left Soft Key:
Open the [Settings screen](#settings-screen).
It is also recommended to disable the special behavior of "Back" key working as "Backspace". It is useful only for a hardware keypad. To do so, go to: Settings -> Keyboard -> Select Hotkeys -> Backspace key, then select the "--" option.

#### Right Soft Key:
Backspace.
If you do have a hardware keypad and prefer having more screen space, disable the software keys from the Settings -> Appearance.

## Settings Screen
On the Settings screen, you can choose languages for typing, configure the keypad hotkeys or change the application appearance.
Expand Down
262 changes: 262 additions & 0 deletions res/layout/main_numpad.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_numpad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<FrameLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/numpad_candidate_height">

<TextView
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textStyle="italic"
tools:text="@tools:sample/lorem" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/suggestions_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="horizontal"
android:gravity="center"
android:orientation="horizontal"
android:scrollbars="none" />

</FrameLayout>


<LinearLayout
android:id="@+id/main_soft_keys"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/numpad_padding_top"
android:paddingBottom="@dimen/numpad_padding_bottom">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
tools:ignore="HardcodedText,KeyboardInaccessibleWidget">

<io.github.sspanak.tt9.ui.main.keys.SoftKey
android:id="@+id/soft_key_settings"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="⚙"
android:textSize="@dimen/soft_key_icon_size" />

<View
android:id="@+id/separator_1_1"
style="@style/numSeparator" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_1"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_2"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_3"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<View
android:id="@+id/separator_1_2"
style="@style/numSeparator" />

<io.github.sspanak.tt9.ui.main.keys.SoftBackspaceKey
android:id="@+id/soft_key_backspace"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="⌫"
android:textSize="@dimen/soft_key_icon_size" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
tools:ignore="HardcodedText">

<io.github.sspanak.tt9.ui.main.keys.SoftKey
android:id="@+id/soft_key_add_word"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="+"
android:textStyle="bold" />

<View
android:id="@+id/separator_2_1"
style="@style/numSeparator" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_4"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_5"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_6"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<View
android:id="@+id/separator_2_2"
style="@style/numSeparator" />

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
tools:ignore="HardcodedText">

<io.github.sspanak.tt9.ui.main.keys.SoftKey
android:id="@+id/soft_key_input_mode"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="⌨️"
android:textSize="@dimen/soft_key_icon_size" />

<View
android:id="@+id/separator_3_1"
style="@style/numSeparator" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_7"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_8"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_9"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<View
android:id="@+id/separator_3_2"
style="@style/numSeparator" />

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />

</LinearLayout>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
tools:ignore="HardcodedText">

<io.github.sspanak.tt9.ui.main.keys.SoftKey
android:id="@+id/soft_key_language"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="🌐" />

<View
android:id="@+id/separator_4_1"
style="@style/numSeparator" />

<io.github.sspanak.tt9.ui.main.keys.SoftPunctuationKey
android:id="@+id/soft_key_punctuation_1"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftNumberKey
android:id="@+id/soft_key_0"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<io.github.sspanak.tt9.ui.main.keys.SoftPunctuationKey
android:id="@+id/soft_key_punctuation_2"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />

<View
android:id="@+id/separator_4_2"
style="@style/numSeparator" />

<io.github.sspanak.tt9.ui.main.keys.SoftKey
android:id="@+id/soft_key_ok"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@android:string/ok"
tools:ignore="ButtonOrder" />

</LinearLayout>
</LinearLayout>

</LinearLayout>
Loading