1
0
Fork 0

added right-to-left UI support

* added right-to-left support in the Settings and the Add Word dialog

* standartized the Add Word dialog layout
This commit is contained in:
sspanak 2023-02-28 18:30:03 +02:00 committed by Dimo Karaivanov
parent c6bb88fbb8
commit e82ae8eaed
2 changed files with 25 additions and 21 deletions

View file

@ -12,7 +12,8 @@
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.DayNight">
android:theme="@style/Theme.AppCompat.DayNight"
android:supportsRtl="true">
<service android:name="io.github.sspanak.tt9.ime.TraditionalT9" android:permission="android.permission.BIND_INPUT_METHOD"
android:exported="true">
@ -33,6 +34,6 @@
android:excludeFromRecents="true"
android:label="@string/add_word_title"
android:name="io.github.sspanak.tt9.ui.AddWordAct"
android:theme="@style/Theme.AppCompat.DayNight.Dialog"/>
android:theme="@style/Theme.AppCompat.DayNight.Dialog.MinWidth"/>
</application>
</manifest>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="6dp"
android:orientation="vertical" >
@ -10,39 +10,42 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="4dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:hint="@string/add_word_field_placeholder"
android:inputType="text"
android:imeOptions="actionSend"
android:privateImeOptions="io.github.sspanak.tt9.addword=true"
android:importantForAutofill="no">
android:importantForAutofill="no"
android:inputType="text"
android:maxWidth="480dp"
android:minHeight="48dp"
android:privateImeOptions="io.github.sspanak.tt9.addword=true">
<requestFocus />
</EditText>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/add_word_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:minWidth="48dp"
android:onClick="addWord"
android:text="@string/add_word_add" />
android:gravity="end">
<Button
android:id="@+id/add_word_cancel"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:minWidth="48dp"
android:onClick="cancelAddingWord"
android:text="@android:string/cancel" />
</RelativeLayout>
<Button
android:id="@+id/add_word_add"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="48dp"
android:onClick="addWord"
android:text="@string/add_word_add" />
</LinearLayout>
</LinearLayout>