diff options
| author | Albin <albin@mullvad.net> | 2023-07-21 09:46:50 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2023-07-21 16:26:42 +0200 |
| commit | a40408f5a0b7d625b6f42f8342ce365ec1c371f5 (patch) | |
| tree | 36d26413f7efd8b7f3f5ce3700a1b864b9ed4e36 /android | |
| parent | 24927bfc9362a160c3bbe1bf3be9625c8e536675 (diff) | |
| download | mullvadvpn-a40408f5a0b7d625b6f42f8342ce365ec1c371f5.tar.xz mullvadvpn-a40408f5a0b7d625b6f42f8342ce365ec1c371f5.zip | |
Fix RTL lint issues
Diffstat (limited to 'android')
12 files changed, 29 insertions, 359 deletions
diff --git a/android/app/lint-baseline.xml b/android/app/lint-baseline.xml index 796f2560bb..4f0c6b33e5 100644 --- a/android/app/lint-baseline.xml +++ b/android/app/lint-baseline.xml @@ -1284,336 +1284,6 @@ </issue> <issue - id="RtlHardcoded" - message="Use "`Gravity.START`" instead of "`Gravity.LEFT`" to ensure correct behavior in right-to-left locales" - errorLine1=" gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT" - errorLine2=" ~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/BackButton.kt" - line="48" - column="54"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`Gravity.START`" instead of "`Gravity.LEFT`" to ensure correct behavior in right-to-left locales" - errorLine1=" gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT" - errorLine2=" ~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/BackButton.kt" - line="48" - column="54"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`start`" instead of "`left`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:gravity="left">" - errorLine2=" ~~~~"> - <location - file="src/main/res/layout/account.xml" - line="6" - column="31"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`end`" instead of "`right`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:layout_gravity="right"" - errorLine2=" ~~~~~"> - <location - file="src/main/res/layout/account_history_entry.xml" - line="18" - column="42"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentLeft` with `android:layout_alignParentStart="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentLeft="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="7" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentRight` with `android:layout_alignParentEnd="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentRight="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="13" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentRight` with `android:layout_alignParentEnd="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentRight="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="20" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentLeft` with `android:layout_alignParentStart="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentLeft="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="27" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentLeft` with `android:layout_alignParentStart="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentLeft="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="34" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentRight` with `android:layout_alignParentEnd="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentRight="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="41" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toLeftOf` with `android:layout_toStartOf="@id/top_right_corner"` to better support right-to-left layouts" - errorLine1=" android:layout_toLeftOf="@id/top_right_corner"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="48" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toRightOf` with `android:layout_toEndOf="@id/top_left_corner"` to better support right-to-left layouts" - errorLine1=" android:layout_toRightOf="@id/top_left_corner"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="49" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toLeftOf` with `android:layout_toStartOf="@id/bottom_right_corner"` to better support right-to-left layouts" - errorLine1=" android:layout_toLeftOf="@id/bottom_right_corner"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="55" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toRightOf` with `android:layout_toEndOf="@id/bottom_left_corner"` to better support right-to-left layouts" - errorLine1=" android:layout_toRightOf="@id/bottom_left_corner"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/account_login_border.xml" - line="56" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`end`" instead of "`right`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:layout_gravity="right|center_vertical"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/button.xml" - line="10" - column="42"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`end`" instead of "`right`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:layout_gravity="right|center_vertical"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/button.xml" - line="20" - column="40"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`start`" instead of "`left`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:gravity="left">" - errorLine2=" ~~~~"> - <location - file="src/main/res/layout/confirm_no_email.xml" - line="10" - column="36"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:paddingLeft` with `android:paddingStart="16dp"` to better support right-to-left layouts" - errorLine1=" android:paddingLeft="16dp"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="5" - column="17"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:paddingRight` with `android:paddingEnd="12dp"` to better support right-to-left layouts" - errorLine1=" android:paddingRight="12dp"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="6" - column="17"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentLeft` with `android:layout_alignParentStart="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentLeft="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="13" - column="21"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toLeftOf` with `android:layout_toStartOf="@id/notification_icon"` to better support right-to-left layouts" - errorLine1=" android:layout_toLeftOf="@id/notification_icon"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="25" - column="15"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toRightOf` with `android:layout_toEndOf="@id/notification_status_container"` to better support right-to-left layouts" - errorLine1=" android:layout_toRightOf="@id/notification_status_container"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="26" - column="15"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_marginLeft` with `android:layout_marginStart="7dp"` to better support right-to-left layouts" - errorLine1=" android:layout_marginLeft="7dp"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="27" - column="15"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_toLeftOf` with `android:layout_toStartOf="@id/notification_icon"` to better support right-to-left layouts" - errorLine1=" android:layout_toLeftOf="@id/notification_icon"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="36" - column="15"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignLeft` with `android:layout_alignStart="@id/notification_title"` to better support right-to-left layouts" - errorLine1=" android:layout_alignLeft="@id/notification_title"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="37" - column="15"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_alignParentRight` with `android:layout_alignParentEnd="true"` to better support right-to-left layouts" - errorLine1=" android:layout_alignParentRight="true"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/notification_banner.xml" - line="46" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`start`" instead of "`left`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:gravity="left">" - errorLine2=" ~~~~"> - <location - file="src/main/res/layout/problem_report.xml" - line="6" - column="31"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`start`" instead of "`left`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:gravity="left">" - errorLine2=" ~~~~"> - <location - file="src/main/res/layout/redeem_voucher.xml" - line="11" - column="36"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_marginRight` with `android:layout_marginEnd="8dp"` to better support right-to-left layouts" - errorLine1=" android:layout_marginRight="8dp"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/settings_back_button.xml" - line="4" - column="16"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`start`" instead of "`left`" to ensure correct behavior in right-to-left locales" - errorLine1=" android:gravity="left"" - errorLine2=" ~~~~"> - <location - file="src/main/res/layout/view_logs.xml" - line="6" - column="32"/> - </issue> - - <issue id="RtlEnabled" message="The project references RTL attributes, but does not explicitly enable or disable RTL support with `android:supportsRtl` in the manifest"> <location diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/BackButton.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/BackButton.kt index 2bc4579c11..7cb3626084 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/BackButton.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/BackButton.kt @@ -45,7 +45,7 @@ class BackButton : LinearLayout { init { setFocusable(true) isClickable = true - gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT + gravity = Gravity.CENTER_VERTICAL or Gravity.START orientation = HORIZONTAL resources.getDimensionPixelSize(R.dimen.settings_back_button_padding).let { padding -> diff --git a/android/app/src/main/res/layout/account.xml b/android/app/src/main/res/layout/account.xml index 86af11c504..8d896b2223 100644 --- a/android/app/src/main/res/layout/account.xml +++ b/android/app/src/main/res/layout/account.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/darkBlue" - android:gravity="left"> + android:gravity="start"> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/android/app/src/main/res/layout/account_history_entry.xml b/android/app/src/main/res/layout/account_history_entry.xml index c31782c0bd..19ae478349 100644 --- a/android/app/src/main/res/layout/account_history_entry.xml +++ b/android/app/src/main/res/layout/account_history_entry.xml @@ -15,7 +15,7 @@ <ImageButton android:id="@+id/remove" android:layout_width="@dimen/account_history_entry_height" android:layout_height="@dimen/account_history_entry_height" - android:layout_gravity="right" + android:layout_gravity="end" android:nextFocusLeft="@id/remove" android:background="?android:attr/selectableItemBackground" android:src="@drawable/account_history_remove" /> diff --git a/android/app/src/main/res/layout/account_login_border.xml b/android/app/src/main/res/layout/account_login_border.xml index 73f17980e3..dab613ca57 100644 --- a/android/app/src/main/res/layout/account_login_border.xml +++ b/android/app/src/main/res/layout/account_login_border.xml @@ -4,56 +4,56 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:src="@drawable/account_login_corner" /> <ImageView android:id="@+id/top_right_corner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:rotation="90" android:src="@drawable/account_login_corner" /> <ImageView android:id="@+id/bottom_right_corner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:rotation="180" android:src="@drawable/account_login_corner" /> <ImageView android:id="@+id/bottom_left_corner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:rotation="270" android:src="@drawable/account_login_corner" /> <!-- sides --> <ImageView android:id="@+id/left_border" android:layout_width="@dimen/account_login_border_width" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_below="@id/top_left_corner" android:layout_above="@id/bottom_left_corner" android:src="@drawable/account_login_border" /> <ImageView android:id="@+id/right_border" android:layout_width="@dimen/account_login_border_width" android:layout_height="wrap_content" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_below="@id/top_right_corner" android:layout_above="@id/bottom_right_corner" android:src="@drawable/account_login_border" /> <ImageView android:id="@+id/top_border" android:layout_width="wrap_content" android:layout_height="@dimen/account_login_border_width" - android:layout_toLeftOf="@id/top_right_corner" - android:layout_toRightOf="@id/top_left_corner" + android:layout_toStartOf="@id/top_right_corner" + android:layout_toEndOf="@id/top_left_corner" android:layout_alignParentTop="true" android:src="@drawable/account_login_border" /> <ImageView android:id="@+id/bottom_border" android:layout_width="wrap_content" android:layout_height="@dimen/account_login_border_width" - android:layout_toLeftOf="@id/bottom_right_corner" - android:layout_toRightOf="@id/bottom_left_corner" + android:layout_toStartOf="@id/bottom_right_corner" + android:layout_toEndOf="@id/bottom_left_corner" android:layout_alignParentBottom="true" android:src="@drawable/account_login_border" /> </merge> diff --git a/android/app/src/main/res/layout/button.xml b/android/app/src/main/res/layout/button.xml index 51d273af97..5db4501a46 100644 --- a/android/app/src/main/res/layout/button.xml +++ b/android/app/src/main/res/layout/button.xml @@ -7,7 +7,7 @@ android:layout_width="20dp" android:layout_height="20dp" android:layout_marginHorizontal="9dp" - android:layout_gravity="right|center_vertical" + android:layout_gravity="end|center_vertical" android:indeterminate="true" android:indeterminateOnly="true" android:indeterminateDuration="600" @@ -17,7 +17,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginHorizontal="9dp" - android:layout_gravity="right|center_vertical" + android:layout_gravity="end|center_vertical" android:src="@android:color/transparent" android:visibility="gone" /> </merge> diff --git a/android/app/src/main/res/layout/confirm_no_email.xml b/android/app/src/main/res/layout/confirm_no_email.xml index ff538ff28b..bd6be5f4a4 100644 --- a/android/app/src/main/res/layout/confirm_no_email.xml +++ b/android/app/src/main/res/layout/confirm_no_email.xml @@ -7,7 +7,7 @@ android:padding="30dp" android:background="@drawable/dialog_background" android:orientation="vertical" - android:gravity="left"> + android:gravity="start"> <ImageView android:layout_width="44dp" android:layout_height="44dp" android:layout_marginTop="8dp" diff --git a/android/app/src/main/res/layout/notification_banner.xml b/android/app/src/main/res/layout/notification_banner.xml index 3fb5ef4d10..fda78b3ef8 100644 --- a/android/app/src/main/res/layout/notification_banner.xml +++ b/android/app/src/main/res/layout/notification_banner.xml @@ -2,15 +2,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingVertical="8dp" - android:paddingLeft="16dp" - android:paddingRight="12dp" + android:paddingStart="16dp" + android:paddingEnd="12dp" android:focusable="true" android:background="?android:attr/selectableItemBackground"> <RelativeLayout android:id="@+id/notification_status_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" + android:layout_alignParentEnd="true" android:layout_alignBottom="@id/notification_title"> <ImageView android:id="@+id/notification_status" android:layout_width="wrap_content" @@ -22,9 +22,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" - android:layout_toLeftOf="@id/notification_icon" - android:layout_toRightOf="@id/notification_status_container" - android:layout_marginLeft="7dp" + android:layout_toStartOf="@id/notification_icon" + android:layout_toEndOf="@id/notification_status_container" + android:layout_marginStart="7dp" android:textSize="@dimen/text_small" android:textStyle="bold" android:text="@string/blocking_internet" @@ -33,8 +33,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignWithParentIfMissing="true" - android:layout_toLeftOf="@id/notification_icon" - android:layout_alignLeft="@id/notification_title" + android:layout_toStartOf="@id/notification_icon" + android:layout_alignStart="@id/notification_title" android:layout_below="@id/notification_title" android:textSize="@dimen/text_small" android:textColor="@color/white60" @@ -43,7 +43,7 @@ <ImageView android:id="@+id/notification_icon" android:layout_width="20dp" android:layout_height="20dp" - android:layout_alignParentRight="true" + android:layout_alignParentStart="true" android:layout_centerVertical="true" android:alpha="0.6" android:padding="4dp" diff --git a/android/app/src/main/res/layout/problem_report.xml b/android/app/src/main/res/layout/problem_report.xml index 614003054a..5832b1a893 100644 --- a/android/app/src/main/res/layout/problem_report.xml +++ b/android/app/src/main/res/layout/problem_report.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/darkBlue" - android:gravity="left"> + android:gravity="start"> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/android/app/src/main/res/layout/redeem_voucher.xml b/android/app/src/main/res/layout/redeem_voucher.xml index c3e081196e..3f6d91d183 100644 --- a/android/app/src/main/res/layout/redeem_voucher.xml +++ b/android/app/src/main/res/layout/redeem_voucher.xml @@ -8,7 +8,7 @@ android:padding="30dp" android:background="@drawable/dialog_background" android:orientation="vertical" - android:gravity="left"> + android:gravity="start"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" diff --git a/android/app/src/main/res/layout/settings_back_button.xml b/android/app/src/main/res/layout/settings_back_button.xml index fc750132ac..442437fca8 100644 --- a/android/app/src/main/res/layout/settings_back_button.xml +++ b/android/app/src/main/res/layout/settings_back_button.xml @@ -1,7 +1,7 @@ <merge xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:layout_width="24dp" android:layout_height="24dp" - android:layout_marginRight="8dp" + android:layout_marginEnd="8dp" android:src="@drawable/icon_back" /> <TextView android:id="@+id/label" android:layout_width="wrap_content" diff --git a/android/app/src/main/res/layout/view_logs.xml b/android/app/src/main/res/layout/view_logs.xml index 3bf9e615fc..2011c8b5c9 100644 --- a/android/app/src/main/res/layout/view_logs.xml +++ b/android/app/src/main/res/layout/view_logs.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/darkBlue" - android:gravity="left" + android:gravity="start" android:orientation="vertical"> <net.mullvad.mullvadvpn.ui.widget.BackButton android:id="@+id/back" android:layout_width="wrap_content" |
