Skip to content

Commit

Permalink
Fix RTL lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad committed Jul 21, 2023
1 parent 24927bf commit a40408f
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 359 deletions.
330 changes: 0 additions & 330 deletions android/app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1283,336 +1283,6 @@
column="43"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`Gravity.START`&quot; instead of &quot;`Gravity.LEFT`&quot; 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 &quot;`Gravity.START`&quot; instead of &quot;`Gravity.LEFT`&quot; 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 &quot;`start`&quot; instead of &quot;`left`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:gravity=&quot;left&quot;>"
errorLine2=" ~~~~">
<location
file="src/main/res/layout/account.xml"
line="6"
column="31"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`end`&quot; instead of &quot;`right`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:layout_gravity=&quot;right&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentLeft=&quot;true&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentRight=&quot;true&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentRight=&quot;true&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentLeft=&quot;true&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentLeft=&quot;true&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentRight=&quot;true&quot;"
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=&quot;@id/top_right_corner&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toLeftOf=&quot;@id/top_right_corner&quot;"
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=&quot;@id/top_left_corner&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toRightOf=&quot;@id/top_left_corner&quot;"
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=&quot;@id/bottom_right_corner&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toLeftOf=&quot;@id/bottom_right_corner&quot;"
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=&quot;@id/bottom_left_corner&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toRightOf=&quot;@id/bottom_left_corner&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/layout/account_login_border.xml"
line="56"
column="16"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`end`&quot; instead of &quot;`right`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:layout_gravity=&quot;right|center_vertical&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/layout/button.xml"
line="10"
column="42"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`end`&quot; instead of &quot;`right`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:layout_gravity=&quot;right|center_vertical&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/layout/button.xml"
line="20"
column="40"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`start`&quot; instead of &quot;`left`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:gravity=&quot;left&quot;>"
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=&quot;16dp&quot;` to better support right-to-left layouts"
errorLine1=" android:paddingLeft=&quot;16dp&quot;"
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=&quot;12dp&quot;` to better support right-to-left layouts"
errorLine1=" android:paddingRight=&quot;12dp&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentLeft=&quot;true&quot;"
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=&quot;@id/notification_icon&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toLeftOf=&quot;@id/notification_icon&quot;"
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=&quot;@id/notification_status_container&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toRightOf=&quot;@id/notification_status_container&quot;"
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=&quot;7dp&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_marginLeft=&quot;7dp&quot;"
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=&quot;@id/notification_icon&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_toLeftOf=&quot;@id/notification_icon&quot;"
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=&quot;@id/notification_title&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignLeft=&quot;@id/notification_title&quot;"
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=&quot;true&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_alignParentRight=&quot;true&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/layout/notification_banner.xml"
line="46"
column="16"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`start`&quot; instead of &quot;`left`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:gravity=&quot;left&quot;>"
errorLine2=" ~~~~">
<location
file="src/main/res/layout/problem_report.xml"
line="6"
column="31"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`start`&quot; instead of &quot;`left`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:gravity=&quot;left&quot;>"
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=&quot;8dp&quot;` to better support right-to-left layouts"
errorLine1=" android:layout_marginRight=&quot;8dp&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/layout/settings_back_button.xml"
line="4"
column="16"/>
</issue>

<issue
id="RtlHardcoded"
message="Use &quot;`start`&quot; instead of &quot;`left`&quot; to ensure correct behavior in right-to-left locales"
errorLine1=" android:gravity=&quot;left&quot;"
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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/layout/account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/layout/account_history_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Loading

0 comments on commit a40408f

Please sign in to comment.