1
0
Fork 0

Touchscreen support + small improvements

* Soft-Keyboard numpad

* no more SoftKeyHandler, the main view is in its own package

* settings are no longer passed unnecessarilly here and there

* fixed numeric mode not working in some cases

* simplified suggestion handling

* fixed crashing when changing the phone orientation
This commit is contained in:
nebkrid 2023-02-17 22:09:31 +01:00 committed by Dimo Karaivanov
parent 7f6cd6110d
commit 4e5416f6b4
36 changed files with 1142 additions and 368 deletions

81
res/layout/main_small.xml Normal file
View file

@ -0,0 +1,81 @@
<?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_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/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:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="horizontal"
android:orientation="horizontal"
android:scrollbars="none" />
</FrameLayout>
<LinearLayout
android:id="@+id/main_soft_keys"
android:layout_width="match_parent"
android:layout_height="@dimen/soft_key_height"
android:baselineAligned="true"
android:orientation="horizontal"
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="3"
android:focusable="false"
android:text="⚙"
android:textSize="@dimen/soft_key_icon_size" />
<View
android:id="@+id/main_separator_left"
style="@style/hSeparator"
android:background="@drawable/button_separator_dark" />
<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="5"
android:focusable="false"
android:text="@android:string/ok" />
<View
android:id="@+id/main_separator_right"
android:background="@drawable/button_separator_dark"
style="@style/hSeparator" />
<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="3"
android:focusable="false"
android:text="⌫"
android:textSize="@dimen/soft_key_icon_size" />
</LinearLayout>
</LinearLayout>