From 12f70f188e6b8ce26348b5208f0bed9d3c5ada2a Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 17 Jul 2020 12:10:25 +1000 Subject: [PATCH] Make the app work with RTL languages --- res/layout-sw400dp/fragment_enter_public_key.xml | 2 +- res/layout/activity_settings.xml | 2 +- res/layout/conversation_input_panel.xml | 3 ++- res/layout/dialog_clear_all_data.xml | 2 +- res/layout/dialog_link_device_master_mode.xml | 2 +- res/layout/dialog_seed.xml | 2 +- res/layout/fragment_enter_public_key.xml | 2 +- res/layout/microphone_recorder_view.xml | 4 ++-- res/layout/view_conversation.xml | 12 ++++++------ res/values-fa/strings.xml | 2 +- res/values/styles.xml | 3 +++ .../securesms/loki/activities/PathActivity.kt | 2 ++ .../loki/views/NewConversationButtonSetView.kt | 2 ++ 13 files changed, 24 insertions(+), 16 deletions(-) diff --git a/res/layout-sw400dp/fragment_enter_public_key.xml b/res/layout-sw400dp/fragment_enter_public_key.xml index d2a9e7a290..88304992c9 100644 --- a/res/layout-sw400dp/fragment_enter_public_key.xml +++ b/res/layout-sw400dp/fragment_enter_public_key.xml @@ -73,7 +73,7 @@ android:layout_width="0dp" android:layout_height="@dimen/medium_button_height" android:layout_weight="1" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:text="@string/share" /> diff --git a/res/layout/activity_settings.xml b/res/layout/activity_settings.xml index 73a6fe5668..bff6499952 100644 --- a/res/layout/activity_settings.xml +++ b/res/layout/activity_settings.xml @@ -150,7 +150,7 @@ android:layout_width="0dp" android:layout_height="@dimen/medium_button_height" android:layout_weight="1" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:text="@string/share" /> diff --git a/res/layout/conversation_input_panel.xml b/res/layout/conversation_input_panel.xml index b2f64984b2..a6b7943ac3 100644 --- a/res/layout/conversation_input_panel.xml +++ b/res/layout/conversation_input_panel.xml @@ -96,6 +96,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:textAlignment="viewStart" android:layout_weight="1" android:textColorHint="#99FFFFFF" android:textSize="@dimen/small_font_size" @@ -137,7 +138,7 @@ android:id="@+id/recorder_view" android:layout_height="match_parent" android:layout_width="36dp" - android:layout_gravity="center_vertical" + android:layout_gravity="center" android:clipChildren="false" android:clipToPadding="false"> diff --git a/res/layout/dialog_clear_all_data.xml b/res/layout/dialog_clear_all_data.xml index 4f9077a939..86e9924fa9 100644 --- a/res/layout/dialog_clear_all_data.xml +++ b/res/layout/dialog_clear_all_data.xml @@ -49,7 +49,7 @@ android:layout_width="0dp" android:layout_height="@dimen/small_button_height" android:layout_weight="1" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:text="@string/delete" /> diff --git a/res/layout/dialog_link_device_master_mode.xml b/res/layout/dialog_link_device_master_mode.xml index 6236bba517..76113b3200 100644 --- a/res/layout/dialog_link_device_master_mode.xml +++ b/res/layout/dialog_link_device_master_mode.xml @@ -87,7 +87,7 @@ android:layout_width="0dp" android:layout_height="@dimen/small_button_height" android:layout_weight="1" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:text="@string/dialog_link_device_master_mode_authorize_button_title" android:visibility="gone" /> diff --git a/res/layout/dialog_seed.xml b/res/layout/dialog_seed.xml index de1069adeb..37b523ad98 100644 --- a/res/layout/dialog_seed.xml +++ b/res/layout/dialog_seed.xml @@ -60,7 +60,7 @@ android:layout_width="0dp" android:layout_height="@dimen/small_button_height" android:layout_weight="1" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:text="@string/copy" /> diff --git a/res/layout/fragment_enter_public_key.xml b/res/layout/fragment_enter_public_key.xml index 27be721c1f..63ae02d7f9 100644 --- a/res/layout/fragment_enter_public_key.xml +++ b/res/layout/fragment_enter_public_key.xml @@ -73,7 +73,7 @@ android:layout_width="0dp" android:layout_height="@dimen/medium_button_height" android:layout_weight="1" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:text="@string/share" /> diff --git a/res/layout/microphone_recorder_view.xml b/res/layout/microphone_recorder_view.xml index 6fed405950..e02cbc4c89 100644 --- a/res/layout/microphone_recorder_view.xml +++ b/res/layout/microphone_recorder_view.xml @@ -8,11 +8,11 @@ android:id="@+id/quick_audio_toggle" android:layout_width="24dp" android:layout_height="24dp" - android:layout_gravity="center_vertical" - android:layout_marginEnd="2dp" + android:layout_gravity="center" android:background="@null" android:contentDescription="@string/conversation_activity__quick_attachment_drawer_record_and_send_audio_description" android:scaleType="centerInside" + android:layout_marginEnd="4dp" android:tint="@color/text" app:srcCompat="@drawable/ic_microphone" /> diff --git a/res/layout/view_conversation.xml b/res/layout/view_conversation.xml index 43a82160ba..624d1b262b 100644 --- a/res/layout/view_conversation.xml +++ b/res/layout/view_conversation.xml @@ -18,14 +18,14 @@ android:layout_width="@dimen/medium_profile_picture_size" android:layout_height="@dimen/medium_profile_picture_size" android:layout_marginTop="@dimen/medium_spacing" - android:layout_marginLeft="@dimen/medium_spacing" + android:layout_marginStart="@dimen/medium_spacing" android:layout_marginBottom="@dimen/medium_spacing" /> + android:layout_marginEnd="4dp" /> + android:layout_marginStart="@dimen/medium_spacing" /> diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index dd466c2613..f478e99355 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -1221,7 +1221,7 @@ ادامه - کپی 🀄 + رونویسی کردن URL نامعتبر است در کلیپ بورد کپی شد پیوند دستگاه امکان پذیر نیست. diff --git a/res/values/styles.xml b/res/values/styles.xml index 35f4706d93..3355423f77 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -139,6 +139,7 @@ @dimen/large_font_size @color/text @font/space_mono_regular + viewStart @@ -162,6 +164,7 @@ @dimen/small_font_size @color/text @drawable/session_edit_text_cursor + viewStart 1 diff --git a/src/org/thoughtcrime/securesms/loki/activities/PathActivity.kt b/src/org/thoughtcrime/securesms/loki/activities/PathActivity.kt index 929e5de266..1133865cad 100644 --- a/src/org/thoughtcrime/securesms/loki/activities/PathActivity.kt +++ b/src/org/thoughtcrime/securesms/loki/activities/PathActivity.kt @@ -121,6 +121,7 @@ class PathActivity : PassphraseRequiredActionBarActivity() { titleTextView.setTextColor(resources.getColorWithID(R.color.text, theme)) titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.medium_font_size)) titleTextView.text = title + titleTextView.textAlignment = TextView.TEXT_ALIGNMENT_VIEW_START val titleContainer = LinearLayout(this) titleContainer.orientation = LinearLayout.VERTICAL titleContainer.addView(titleTextView) @@ -133,6 +134,7 @@ class PathActivity : PassphraseRequiredActionBarActivity() { subtitleTextView.setTextColor(resources.getColorWithID(R.color.text, theme)) subtitleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.small_font_size)) subtitleTextView.text = subtitle + subtitleTextView.textAlignment = TextView.TEXT_ALIGNMENT_VIEW_START titleContainer.addView(subtitleTextView) } return mainContainer diff --git a/src/org/thoughtcrime/securesms/loki/views/NewConversationButtonSetView.kt b/src/org/thoughtcrime/securesms/loki/views/NewConversationButtonSetView.kt index 3f94883c6c..1b26e1d917 100644 --- a/src/org/thoughtcrime/securesms/loki/views/NewConversationButtonSetView.kt +++ b/src/org/thoughtcrime/securesms/loki/views/NewConversationButtonSetView.kt @@ -16,6 +16,7 @@ import android.os.Vibrator import android.support.annotation.ColorRes import android.support.annotation.DrawableRes import android.util.AttributeSet +import android.view.Gravity import android.view.MotionEvent import android.widget.ImageView import android.widget.RelativeLayout @@ -91,6 +92,7 @@ class NewConversationButtonSetView : RelativeLayout { addView(imageView) imageView.x = collapsedImageViewPosition.x imageView.y = collapsedImageViewPosition.y + gravity = Gravity.TOP or Gravity.LEFT // Intentionally not Gravity.START } fun expand() {