Make the app work with RTL languages

This commit is contained in:
nielsandriesse 2020-07-17 12:10:25 +10:00
parent 4d075679d3
commit 12f70f188e
13 changed files with 24 additions and 16 deletions

View File

@ -73,7 +73,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/medium_button_height" android:layout_height="@dimen/medium_button_height"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:text="@string/share" /> android:text="@string/share" />
</LinearLayout> </LinearLayout>

View File

@ -150,7 +150,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/medium_button_height" android:layout_height="@dimen/medium_button_height"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:text="@string/share" /> android:text="@string/share" />
</LinearLayout> </LinearLayout>

View File

@ -96,6 +96,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textAlignment="viewStart"
android:layout_weight="1" android:layout_weight="1"
android:textColorHint="#99FFFFFF" android:textColorHint="#99FFFFFF"
android:textSize="@dimen/small_font_size" android:textSize="@dimen/small_font_size"
@ -137,7 +138,7 @@
android:id="@+id/recorder_view" android:id="@+id/recorder_view"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="36dp" android:layout_width="36dp"
android:layout_gravity="center_vertical" android:layout_gravity="center"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false"> android:clipToPadding="false">

View File

@ -49,7 +49,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/small_button_height" android:layout_height="@dimen/small_button_height"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:text="@string/delete" /> android:text="@string/delete" />
</LinearLayout> </LinearLayout>

View File

@ -87,7 +87,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/small_button_height" android:layout_height="@dimen/small_button_height"
android:layout_weight="1" 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:text="@string/dialog_link_device_master_mode_authorize_button_title"
android:visibility="gone" /> android:visibility="gone" />

View File

@ -60,7 +60,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/small_button_height" android:layout_height="@dimen/small_button_height"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:text="@string/copy" /> android:text="@string/copy" />
</LinearLayout> </LinearLayout>

View File

@ -73,7 +73,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/medium_button_height" android:layout_height="@dimen/medium_button_height"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:text="@string/share" /> android:text="@string/share" />
</LinearLayout> </LinearLayout>

View File

@ -8,11 +8,11 @@
android:id="@+id/quick_audio_toggle" android:id="@+id/quick_audio_toggle"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_gravity="center_vertical" android:layout_gravity="center"
android:layout_marginEnd="2dp"
android:background="@null" android:background="@null"
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_record_and_send_audio_description" android:contentDescription="@string/conversation_activity__quick_attachment_drawer_record_and_send_audio_description"
android:scaleType="centerInside" android:scaleType="centerInside"
android:layout_marginEnd="4dp"
android:tint="@color/text" android:tint="@color/text"
app:srcCompat="@drawable/ic_microphone" /> app:srcCompat="@drawable/ic_microphone" />

View File

@ -18,14 +18,14 @@
android:layout_width="@dimen/medium_profile_picture_size" android:layout_width="@dimen/medium_profile_picture_size"
android:layout_height="@dimen/medium_profile_picture_size" android:layout_height="@dimen/medium_profile_picture_size"
android:layout_marginTop="@dimen/medium_spacing" 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_marginBottom="@dimen/medium_spacing" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:layout_marginRight="@dimen/medium_spacing" android:layout_marginEnd="@dimen/medium_spacing"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@ -54,7 +54,7 @@
android:id="@+id/timestampTextView" android:id="@+id/timestampTextView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:maxLines="1" android:maxLines="1"
android:ellipsize="end" android:ellipsize="end"
android:textSize="@dimen/small_font_size" android:textSize="@dimen/small_font_size"
@ -76,7 +76,7 @@
android:layout_height="12dp" android:layout_height="12dp"
android:src="@drawable/ic_mute" android:src="@drawable/ic_mute"
android:layout_marginTop="1dp" android:layout_marginTop="1dp"
android:layout_marginRight="4dp" /> android:layout_marginEnd="4dp" />
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -110,7 +110,7 @@
android:id="@+id/statusIndicatorImageView" android:id="@+id/statusIndicatorImageView"
android:layout_width="@dimen/conversation_view_status_indicator_size" android:layout_width="@dimen/conversation_view_status_indicator_size"
android:layout_height="@dimen/conversation_view_status_indicator_size" android:layout_height="@dimen/conversation_view_status_indicator_size"
android:layout_marginLeft="@dimen/medium_spacing" /> android:layout_marginStart="@dimen/medium_spacing" />
</LinearLayout> </LinearLayout>

View File

@ -1221,7 +1221,7 @@
<!-- Session --> <!-- Session -->
<string name="continue_2">ادامه </string> <string name="continue_2">ادامه </string>
<string name="copy">کپی &#126980;</string> <string name="copy">رونویسی کردن</string>
<string name="invalid_url">URL نامعتبر است</string> <string name="invalid_url">URL نامعتبر است</string>
<string name="copied_to_clipboard">در کلیپ بورد کپی شد</string> <string name="copied_to_clipboard">در کلیپ بورد کپی شد</string>
<string name="device_linking_failed">پیوند دستگاه امکان پذیر نیست.</string> <string name="device_linking_failed">پیوند دستگاه امکان پذیر نیست.</string>

View File

@ -139,6 +139,7 @@
<item name="android:textSize">@dimen/large_font_size</item> <item name="android:textSize">@dimen/large_font_size</item>
<item name="android:textColor">@color/text</item> <item name="android:textColor">@color/text</item>
<item name="android:fontFamily">@font/space_mono_regular</item> <item name="android:fontFamily">@font/space_mono_regular</item>
<item name="android:textAlignment">viewStart</item>
</style> </style>
<style name="SessionEditText"> <style name="SessionEditText">
@ -150,6 +151,7 @@
<item name="android:textSize">@dimen/small_font_size</item> <item name="android:textSize">@dimen/small_font_size</item>
<item name="android:textColor">@color/text</item> <item name="android:textColor">@color/text</item>
<item name="android:textCursorDrawable">@drawable/session_edit_text_cursor</item> <item name="android:textCursorDrawable">@drawable/session_edit_text_cursor</item>
<item name="android:textAlignment">viewStart</item>
<item name="android:maxLines">1</item> <item name="android:maxLines">1</item>
</style> </style>
@ -162,6 +164,7 @@
<item name="android:textSize">@dimen/small_font_size</item> <item name="android:textSize">@dimen/small_font_size</item>
<item name="android:textColor">@color/text</item> <item name="android:textColor">@color/text</item>
<item name="android:textCursorDrawable">@drawable/session_edit_text_cursor</item> <item name="android:textCursorDrawable">@drawable/session_edit_text_cursor</item>
<item name="android:textAlignment">viewStart</item>
<item name="android:maxLines">1</item> <item name="android:maxLines">1</item>
</style> </style>

View File

@ -121,6 +121,7 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
titleTextView.setTextColor(resources.getColorWithID(R.color.text, theme)) titleTextView.setTextColor(resources.getColorWithID(R.color.text, theme))
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.medium_font_size)) titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.medium_font_size))
titleTextView.text = title titleTextView.text = title
titleTextView.textAlignment = TextView.TEXT_ALIGNMENT_VIEW_START
val titleContainer = LinearLayout(this) val titleContainer = LinearLayout(this)
titleContainer.orientation = LinearLayout.VERTICAL titleContainer.orientation = LinearLayout.VERTICAL
titleContainer.addView(titleTextView) titleContainer.addView(titleTextView)
@ -133,6 +134,7 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
subtitleTextView.setTextColor(resources.getColorWithID(R.color.text, theme)) subtitleTextView.setTextColor(resources.getColorWithID(R.color.text, theme))
subtitleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.small_font_size)) subtitleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.small_font_size))
subtitleTextView.text = subtitle subtitleTextView.text = subtitle
subtitleTextView.textAlignment = TextView.TEXT_ALIGNMENT_VIEW_START
titleContainer.addView(subtitleTextView) titleContainer.addView(subtitleTextView)
} }
return mainContainer return mainContainer

View File

@ -16,6 +16,7 @@ import android.os.Vibrator
import android.support.annotation.ColorRes import android.support.annotation.ColorRes
import android.support.annotation.DrawableRes import android.support.annotation.DrawableRes
import android.util.AttributeSet import android.util.AttributeSet
import android.view.Gravity
import android.view.MotionEvent import android.view.MotionEvent
import android.widget.ImageView import android.widget.ImageView
import android.widget.RelativeLayout import android.widget.RelativeLayout
@ -91,6 +92,7 @@ class NewConversationButtonSetView : RelativeLayout {
addView(imageView) addView(imageView)
imageView.x = collapsedImageViewPosition.x imageView.x = collapsedImageViewPosition.x
imageView.y = collapsedImageViewPosition.y imageView.y = collapsedImageViewPosition.y
gravity = Gravity.TOP or Gravity.LEFT // Intentionally not Gravity.START
} }
fun expand() { fun expand() {