1
0
Fork 0

updated the Small MainView to use the Material 2 theme

This commit is contained in:
sspanak 2025-01-15 12:06:07 +02:00 committed by Dimo Karaivanov
parent 4b8ccdd2b1
commit b28d4cb458
42 changed files with 358 additions and 571 deletions

View file

@ -40,7 +40,7 @@
android:layout_width="@dimen/numpad_arrow_key_width"
android:layout_height="match_parent"
android:text="@string/key_dpad_left"
android:textSize="@dimen/soft_key_icon_size" />
android:textSize="@dimen/main_small_key_icon_size" />
<View
android:id="@+id/separator_candidates_1"
@ -79,7 +79,7 @@
android:layout_width="@dimen/numpad_arrow_key_width"
android:layout_height="match_parent"
android:text="@string/key_dpad_right"
android:textSize="@dimen/soft_key_icon_size" />
android:textSize="@dimen/main_small_key_icon_size" />
</LinearLayout>

View file

@ -2,6 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/TTheme.Keyboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
@ -11,46 +12,34 @@
style="@style/numRowSeparator" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/candidate_height"
style="@style/TTheme.MainSmall.StatusBar.Wrapper"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false">
<TextView
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/TTheme.MainSmall.StatusBar.Status"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
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"
style="@style/TTheme.MainSmall.StatusBar.SuggestionList"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:orientation="horizontal"
android:scrollbars="none" />
android:focusableInTouchMode="false" />
</FrameLayout>
<View
android:id="@+id/separator_candidates_bottom"
style="@style/numRowSeparator" />
<include
layout="@layout/panel_small_function_keys"
android:id="@+id/main_soft_keys" />
<include
layout="@layout/panel_command_palette"
layout="@layout/panel_small_command_palette"
android:id="@+id/main_command_keys"
android:visibility="gone" />

View file

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/main_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_1"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="@dimen/numpad_key_height"
android:layout_weight="1"
android:textSize="@dimen/soft_key_icon_size" />
<View
android:id="@+id/separator_1_1"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_2"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="@dimen/numpad_key_height"
android:layout_weight="1"
android:textSize="@dimen/soft_key_icon_size" />
<View
android:id="@+id/separator_1_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyF3
android:id="@+id/soft_key_3"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="@dimen/numpad_key_height"
android:layout_weight="1"
android:textSize="@dimen/soft_key_icon_size" />
<View
android:id="@+id/separator_2_1"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyF5
android:id="@+id/soft_key_5"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="@dimen/numpad_key_height"
android:layout_weight="1"
android:textSize="@dimen/soft_key_icon_size" />
<View
android:id="@+id/separator_2_2"
style="@style/numSeparator" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_8"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="@dimen/numpad_key_height"
android:layout_weight="1"
android:textSize="@dimen/soft_key_icon_size" />
</LinearLayout>

View file

@ -21,7 +21,7 @@
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:text="⚙"
android:textSize="@dimen/soft_key_icon_size" />
android:textSize="@dimen/main_small_key_icon_size" />
<View
android:id="@+id/separator_1_1"
@ -46,7 +46,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:textSize="@dimen/soft_key_icon_size" />
android:textSize="@dimen/main_small_key_icon_size" />
</LinearLayout>
@ -63,7 +63,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="@dimen/numpad_function_key_layout_weight"
android:textSize="@dimen/soft_key_icon_size" />
android:textSize="@dimen/main_small_key_icon_size" />
<View
android:id="@+id/separator_2_1"

View file

@ -8,7 +8,7 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_dpad_left"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
@ -19,7 +19,7 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_select_none"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
@ -30,6 +30,6 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_dpad_right"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
</merge>

View file

@ -8,7 +8,7 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_word_back"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
@ -19,7 +19,7 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_select_all"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
@ -30,6 +30,6 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_word_forward"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
</merge>

View file

@ -8,7 +8,7 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_cut"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
@ -19,7 +19,7 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_copy"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
@ -31,6 +31,6 @@
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_paste"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size"
android:textSize="@dimen/numpad_text_editing_font_size"
android:visibility="gone" />
</merge>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/main_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_1"
android:drawableBottom="@drawable/ic_fn_settings" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_2"
android:drawableBottom="@drawable/ic_fn_add_word" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyF3
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_3"
android:drawableBottom="@drawable/ic_fn_voice" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyF5
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_5"
android:drawableBottom="@drawable/ic_txt_cut" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
style="@style/TTheme.CommandPalette.Key"
android:id="@+id/soft_key_8"
android:drawableBottom="@drawable/ic_fn_next_keyboard" />
</LinearLayout>

View file

@ -2,49 +2,28 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/TTheme.MainSmall.Wrapper"
tools:ignore="HardcodedText,KeyboardInaccessibleWidget"
tools:showIn="@layout/main_small"
android:layout_width="match_parent"
android:layout_height="@dimen/soft_key_height"
android:baselineAligned="true"
android:orientation="horizontal">
tools:showIn="@layout/main_small">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyCommandPalette
android:id="@+id/soft_key_command_palette"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
style="@style/TTheme.MainSmall.Key"
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" />
android:text="☰" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyOk
android:id="@+id/soft_key_ok"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
style="@style/TTheme.MainSmall.Key.OK"
android:layout_weight="5"
android:focusable="false"
android:text="@android:string/ok" />
<View
android:id="@+id/main_separator_right"
style="@style/hSeparator"
android:background="@drawable/button_separator_dark" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyBackspace
android:id="@+id/soft_key_backspace"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
style="@style/TTheme.MainSmall.Key"
android:layout_weight="3"
android:focusable="false"
android:text="⌫"
android:textSize="@dimen/soft_key_icon_size" />
android:text="⌫" />
</LinearLayout>

View file

@ -3,130 +3,52 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/numpad_key_height"
style="@style/TTheme.CommandPalette.Wrapper"
tools:showIn="@layout/main_small">
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_101"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_dpad_left"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_1"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_dpad_left" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_102"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_select_none"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_2"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_select_none" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_103"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_dpad_right"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_3"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_dpad_right" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_104"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_word_back"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_4"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_word_back" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_105"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_select_all"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_5"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_select_all" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_106"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_word_forward"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_6"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_word_forward" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_107"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_cut"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_7"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_cut" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_108"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_copy"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
<View
android:id="@+id/separator_10_8"
style="@style/numSeparator" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_copy" />
<io.github.sspanak.tt9.ui.main.keys.SoftKeyFn
android:id="@+id/soft_key_109"
style="@android:style/Widget.Holo.Button.Borderless"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableBottom="@drawable/ic_txt_paste"
android:paddingBottom="@dimen/soft_key_drawable_bottom_padding"
android:textSize="@dimen/soft_key_drawable_title_size" />
style="@style/TTheme.CommandPalette.Key"
android:drawableBottom="@drawable/ic_txt_paste" />
</LinearLayout>

View file

@ -15,7 +15,7 @@
android:paddingEnd="15dp"
android:text="✕"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/soft_key_icon_size"
android:textSize="@dimen/main_small_key_icon_size"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView

View file

@ -4,17 +4,13 @@
android:layout_height="match_parent"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:orientation="horizontal">
android:focusableInTouchMode="false">
<TextView
android:id="@+id/suggestion_list_item"
android:layout_width="wrap_content"
android:layout_height="match_parent"
style="@style/TTheme.MainSmall.StatusBar.SuggestionList.Item"
android:defaultFocusHighlightEnabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
android:paddingHorizontal="@dimen/candidate_padding_horizontal"
android:textSize="@dimen/candidate_font_size" />
/>
</LinearLayout>

View file

@ -10,6 +10,6 @@
android:layout_height="match_parent"
android:gravity="center"
android:minWidth="@dimen/numpad_candidate_min_width"
android:paddingHorizontal="@dimen/candidate_padding_horizontal"
android:paddingHorizontal="@dimen/suggestion_padding_horizontal"
android:textSize="@dimen/numpad_candidate_font_size" />
</LinearLayout>