diff options
| author | Albin <albin@mullvad.net> | 2023-06-12 16:05:02 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2023-06-12 16:05:02 +0200 |
| commit | ae58b4777a3bf3bc19330f3c190897667c5c883b (patch) | |
| tree | 89c965db6b693e89c7bd4eb31d018891338fbfe6 | |
| parent | a2255d0514c9abbd215aab98314624989f91392c (diff) | |
| parent | 03b068a38623fb4c780f68af5292e89dee84727b (diff) | |
| download | mullvadvpn-ae58b4777a3bf3bc19330f3c190897667c5c883b.tar.xz mullvadvpn-ae58b4777a3bf3bc19330f3c190897667c5c883b.zip | |
Merge branch 'move-account-button-from-settings-to-header-droid-88'
11 files changed, 160 insertions, 379 deletions
diff --git a/android/app/lint-baseline.xml b/android/app/lint-baseline.xml index 45d2061075..be3a82f7a1 100644 --- a/android/app/lint-baseline.xml +++ b/android/app/lint-baseline.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<issues format="6" by="lint 7.3.1" type="baseline" client="gradle" dependencies="false" name="AGP (7.3.1)" variant="all" version="7.3.1"> +<issues format="6" by="lint 7.4.2" type="baseline" client="gradle" dependencies="false" name="AGP (7.4.2)" variant="all" version="7.4.2"> <issue id="MissingSuperCall" @@ -8,7 +8,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> <location file="src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt" - line="136" + line="139" column="18"/> </issue> @@ -162,7 +162,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt" - line="340" + line="359" column="58"/> </issue> @@ -189,39 +189,6 @@ </issue> <issue - id="SwitchIntDef" - message="Unexpected constant; expected one of: `ListItemData.ACTION`, `ListItemData.DIVIDER`, `ListItemData.PLAIN`" - errorLine1=" ListItemData.PROGRESS -> ProgressListItemView(parent.context)" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/ListItemsAdapter.kt" - line="36" - column="17"/> - </issue> - - <issue - id="SwitchIntDef" - message="Unexpected constant; expected one of: `ListItemData.ACTION`, `ListItemData.DIVIDER`, `ListItemData.PLAIN`" - errorLine1=" ListItemData.APPLICATION -> ApplicationListItemView(parent.context)" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/ListItemsAdapter.kt" - line="39" - column="17"/> - </issue> - - <issue - id="SwitchIntDef" - message="Unexpected constant; expected one of: `ListItemData.ACTION`, `ListItemData.DIVIDER`, `ListItemData.PLAIN`" - errorLine1=" ListItemData.DOUBLE_ACTION -> TwoActionListItemView(parent.context)" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/ListItemsAdapter.kt" - line="40" - column="17"/> - </issue> - - <issue id="Deprecated" message="`android:editable` is deprecated: Use `inputType` instead" errorLine1=" android:editable="false"" @@ -233,17 +200,6 @@ </issue> <issue - id="DiscouragedApi" - message="Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. `R.foo.bar`) than by name (e.g. `getIdentifier("bar", "foo", null)`)." - errorLine1=" val id = resources.getIdentifier("config_showNavigationBar", "bool", "android")" - errorLine2=" ~~~~~~~~~~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/SplitTunnelingFragment.kt" - line="123" - column="28"/> - </issue> - - <issue id="UseCompatLoadingForDrawables" message="Use `ResourcesCompat.getDrawable()`" errorLine1=" resources.getDrawable(R.drawable.account_login_corner, null)," @@ -1011,17 +967,6 @@ <issue id="Overdraw" - message="Possible overdraw: Root element paints background `@color/darkBlue` with a theme that also paints a background (inferred theme is `@style/AppTheme`)" - errorLine1=" android:background="@color/darkBlue"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/collapsed_title_layout.xml" - line="8" - column="54"/> - </issue> - - <issue - id="Overdraw" message="Possible overdraw: Root element paints background `?android:attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/AppTheme`)" errorLine1=" android:background="?android:attr/selectableItemBackground">" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1037,17 +982,6 @@ errorLine1=" android:background="@color/darkBlue"" errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location - file="src/main/res/layout/preferences.xml" - line="5" - column="14"/> - </issue> - - <issue - id="Overdraw" - message="Possible overdraw: Root element paints background `@color/darkBlue` with a theme that also paints a background (inferred theme is `@style/AppTheme`)" - errorLine1=" android:background="@color/darkBlue"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location file="src/main/res/layout/problem_report.xml" line="5" column="14"/> @@ -1104,7 +1038,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values/colors.xml" - line="22" + line="21" column="12"/> </issue> @@ -1115,7 +1049,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values/colors.xml" - line="23" + line="22" column="12"/> </issue> @@ -1126,7 +1060,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values/colors.xml" - line="25" + line="24" column="12"/> </issue> @@ -1176,56 +1110,12 @@ <issue id="UnusedResources" - message="The resource `R.string.account_created` appears to be unused" - errorLine1=" <string name="account_created">Account created</string>" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/values/strings.xml" - line="28" - column="13"/> - </issue> - - <issue - id="UnusedResources" - message="The resource `R.string.not_blocking_internet` appears to be unused" - errorLine1=" <string name="not_blocking_internet">YOU MIGHT BE LEAKING NETWORK TRAFFIC</string>" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/values/strings.xml" - line="112" - column="13"/> - </issue> - - <issue - id="UnusedResources" - message="The resource `R.string.virtual_adapter_problem` appears to be unused" - errorLine1=" <string name="virtual_adapter_problem">Virtual adapter error</string>" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/values/strings.xml" - line="133" - column="13"/> - </issue> - - <issue - id="UnusedResources" - message="The resource `R.string.enable` appears to be unused" - errorLine1=" <string name="enable">Enable</string>" - errorLine2=" ~~~~~~~~~~~~~"> - <location - file="src/main/res/values/strings.xml" - line="148" - column="13"/> - </issue> - - <issue - id="UnusedResources" message="The resource `R.string.wg_key_url` appears to be unused" - errorLine1=" <string name="wg_key_url"" + errorLine1=" <string name="wg_key_url" translatable="false">https://mullvad.net/account/ports</string>" errorLine2=" ~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values/strings_non_translatable.xml" - line="10" + line="6" column="13"/> </issue> @@ -1269,7 +1159,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values/strings.xml" - line="15" + line="12" column="41"/> </issue> @@ -1280,7 +1170,7 @@ errorLine2=" ~~~~~~~~~~~~~"> <location file="src/main/res/values/strings.xml" - line="18" + line="15" column="37"/> </issue> @@ -1291,7 +1181,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values/strings.xml" - line="26" + line="23" column="41"/> </issue> @@ -1302,7 +1192,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-da/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1313,7 +1203,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-de/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1324,7 +1214,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-fi/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1335,7 +1225,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-fr/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1346,7 +1236,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-it/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1357,7 +1247,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-ja/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1368,7 +1258,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-ko/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1379,7 +1269,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-my/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1390,7 +1280,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-nb/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1401,7 +1291,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-nl/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1412,7 +1302,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-pl/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1423,7 +1313,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-pt/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1434,7 +1324,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-ru/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1445,7 +1335,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-sv/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1456,7 +1346,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-th/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1467,7 +1357,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-tr/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1478,7 +1368,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-zh-rTW/strings.xml" - line="35" + line="40" column="41"/> </issue> @@ -1489,7 +1379,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-da/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1500,7 +1390,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-de/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1511,7 +1401,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-fi/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1522,7 +1412,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-it/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1533,7 +1423,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-ja/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1544,7 +1434,7 @@ errorLine2=" ~~~~~~~~~~"> <location file="src/main/res/values-ko/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1555,7 +1445,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-my/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1566,7 +1456,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-nb/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1577,7 +1467,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-nl/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1588,7 +1478,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-pl/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1599,7 +1489,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-pt/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1610,7 +1500,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-ru/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1621,7 +1511,7 @@ errorLine2=" ~~~~~~~~~~~~~~~"> <location file="src/main/res/values-sv/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1632,7 +1522,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-th/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1643,7 +1533,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-tr/strings.xml" - line="41" + line="46" column="41"/> </issue> @@ -1654,7 +1544,7 @@ errorLine2=" ~~~~~~~~~~"> <location file="src/main/res/values/strings.xml" - line="82" + line="70" column="28"/> </issue> @@ -1665,7 +1555,7 @@ errorLine2=" ~~~~~~~~~~~~~"> <location file="src/main/res/values-da/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1676,7 +1566,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-de/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1687,7 +1577,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-fi/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1698,7 +1588,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-fr/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1709,7 +1599,7 @@ errorLine2=" ~~~~~~~~~~"> <location file="src/main/res/values-it/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1720,7 +1610,7 @@ errorLine2=" ~~~~~~~~"> <location file="src/main/res/values-ja/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1731,7 +1621,7 @@ errorLine2=" ~~~~~~~~"> <location file="src/main/res/values-ko/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1742,7 +1632,7 @@ errorLine2=" ~~~~~~~~~~~~~~~"> <location file="src/main/res/values-my/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1753,7 +1643,7 @@ errorLine2=" ~~~~~~~~~~~~~~"> <location file="src/main/res/values-nb/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1764,7 +1654,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-nl/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1775,7 +1665,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-pl/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1786,7 +1676,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-pt/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1797,7 +1687,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-ru/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1808,7 +1698,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-sv/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1819,7 +1709,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-th/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1830,7 +1720,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-tr/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1841,7 +1731,7 @@ errorLine2=" ~~~~~~"> <location file="src/main/res/values-zh-rTW/strings.xml" - line="87" + line="95" column="37"/> </issue> @@ -1852,7 +1742,7 @@ errorLine2=" ~~~~~~~~~"> <location file="src/main/res/values-da/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1863,7 +1753,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-de/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1874,7 +1764,7 @@ errorLine2=" ~~~~~~~~~~~~~"> <location file="src/main/res/values-fi/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1885,7 +1775,7 @@ errorLine2=" ~~~~~~~~"> <location file="src/main/res/values-fr/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1896,7 +1786,7 @@ errorLine2=" ~~~~~~~~"> <location file="src/main/res/values-it/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1907,7 +1797,7 @@ errorLine2=" ~~~~~~"> <location file="src/main/res/values-ja/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1918,7 +1808,7 @@ errorLine2=" ~~~~~~~"> <location file="src/main/res/values-ko/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1929,7 +1819,7 @@ errorLine2=" ~~~~~~~~~~~"> <location file="src/main/res/values-my/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1940,7 +1830,7 @@ errorLine2=" ~~~~~~~~~~"> <location file="src/main/res/values-nb/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1951,7 +1841,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-nl/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1962,7 +1852,7 @@ errorLine2=" ~~~~~~~~~~~~"> <location file="src/main/res/values-pl/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1973,7 +1863,7 @@ errorLine2=" ~~~~~~~~~~~"> <location file="src/main/res/values-pt/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1984,7 +1874,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~"> <location file="src/main/res/values-ru/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -1995,7 +1885,7 @@ errorLine2=" ~~~~~~~~~"> <location file="src/main/res/values-sv/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -2006,7 +1896,7 @@ errorLine2=" ~~~~~~~~~~~"> <location file="src/main/res/values-th/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -2017,7 +1907,7 @@ errorLine2=" ~~~~~~~~~~~~~~~"> <location file="src/main/res/values-tr/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -2028,7 +1918,7 @@ errorLine2=" ~~~~~~"> <location file="src/main/res/values-zh-rTW/strings.xml" - line="119" + line="136" column="28"/> </issue> @@ -2265,17 +2155,6 @@ <issue id="ContentDescription" message="Missing `contentDescription` attribute on image" - errorLine1=" <ImageView android:id="@+id/icon"" - errorLine2=" ~~~~~~~~~"> - <location - file="src/main/res/layout/app_list_item.xml" - line="20" - column="6"/> - </issue> - - <issue - id="ContentDescription" - message="Missing `contentDescription` attribute on image" errorLine1=" <ImageView android:id="@+id/image"" errorLine2=" ~~~~~~~~~"> <location @@ -2342,17 +2221,6 @@ <issue id="ContentDescription" message="Missing `contentDescription` attribute on image" - errorLine1=" <ImageButton android:id="@+id/settings"" - errorLine2=" ~~~~~~~~~~~"> - <location - file="src/main/res/layout/header_bar.xml" - line="25" - column="10"/> - </issue> - - <issue - id="ContentDescription" - message="Missing `contentDescription` attribute on image" errorLine1=" <ImageView android:id="@+id/logged_in_status"" errorLine2=" ~~~~~~~~~"> <location @@ -2576,28 +2444,6 @@ errorLine1=" gravity = Gravity.RIGHT" errorLine2=" ~~~~~"> <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountCell.kt" - line="24" - column="31"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`Gravity.END`" instead of "`Gravity.RIGHT`" to ensure correct behavior in right-to-left locales" - errorLine1=" gravity = Gravity.RIGHT" - errorLine2=" ~~~~~"> - <location - file="src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountCell.kt" - line="24" - column="31"/> - </issue> - - <issue - id="RtlHardcoded" - message="Use "`Gravity.END`" instead of "`Gravity.RIGHT`" to ensure correct behavior in right-to-left locales" - errorLine1=" gravity = Gravity.RIGHT" - errorLine2=" ~~~~~"> - <location file="src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AppVersionCell.kt" line="31" column="31"/> @@ -2770,28 +2616,6 @@ <issue id="RtlHardcoded" - message="Consider replacing `android:layout_marginRight` with `android:layout_marginEnd="4dp"` to better support right-to-left layouts" - errorLine1=" android:layout_marginRight="4dp"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/app_list_item.xml" - line="14" - column="18"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_marginRight` with `android:layout_marginEnd="4dp"` to better support right-to-left layouts" - errorLine1=" android:layout_marginRight="4dp"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/app_list_item.xml" - line="24" - 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=" ~~~~~~~~~~~~~~~~~~~~~"> @@ -2939,28 +2763,6 @@ errorLine1=" android:gravity="left">" errorLine2=" ~~~~"> <location - file="src/main/res/layout/preferences.xml" - line="6" - column="31"/> - </issue> - - <issue - id="RtlHardcoded" - message="Consider replacing `android:layout_marginLeft` with `android:layout_marginStart="@dimen/side_margin"` to better support right-to-left layouts" - errorLine1=" android:layout_marginLeft="@dimen/side_margin"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="src/main/res/layout/preferences.xml" - line="41" - column="27"/> - </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"/> diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt index ceb67ebc6c..4d72ff3590 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt @@ -39,6 +39,7 @@ import net.mullvad.mullvadvpn.model.DeviceState import net.mullvad.mullvadvpn.repository.AccountRepository import net.mullvad.mullvadvpn.repository.DeviceRepository import net.mullvad.mullvadvpn.repository.PrivacyDisclaimerRepository +import net.mullvad.mullvadvpn.ui.fragment.AccountFragment import net.mullvad.mullvadvpn.ui.fragment.ConnectFragment import net.mullvad.mullvadvpn.ui.fragment.DeviceRevokedFragment import net.mullvad.mullvadvpn.ui.fragment.LoadingFragment @@ -183,6 +184,20 @@ open class MainActivity : FragmentActivity() { } } + fun openAccount() { + supportFragmentManager.beginTransaction().apply { + setCustomAnimations( + R.anim.fragment_enter_from_bottom, + R.anim.do_nothing, + R.anim.do_nothing, + R.anim.fragment_exit_to_bottom + ) + replace(R.id.main_fragment, AccountFragment()) + addToBackStack(null) + commitAllowingStateLoss() + } + } + fun openSettings() { supportFragmentManager.beginTransaction().apply { setCustomAnimations( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/AccountFragment.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/AccountFragment.kt index 09accbc826..06fdb37b79 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/AccountFragment.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/AccountFragment.kt @@ -5,6 +5,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope @@ -26,8 +27,12 @@ import net.mullvad.mullvadvpn.repository.DeviceRepository import net.mullvad.mullvadvpn.ui.CollapsibleTitleController import net.mullvad.mullvadvpn.ui.GroupedPasswordTransformationMethod import net.mullvad.mullvadvpn.ui.GroupedTransformationMethod +import net.mullvad.mullvadvpn.ui.NavigationBarPainter +import net.mullvad.mullvadvpn.ui.StatusBarPainter import net.mullvad.mullvadvpn.ui.extension.openAccountPageInBrowser import net.mullvad.mullvadvpn.ui.extension.requireMainActivity +import net.mullvad.mullvadvpn.ui.paintNavigationBar +import net.mullvad.mullvadvpn.ui.paintStatusBar import net.mullvad.mullvadvpn.ui.serviceconnection.ServiceConnectionManager import net.mullvad.mullvadvpn.ui.serviceconnection.ServiceConnectionState import net.mullvad.mullvadvpn.ui.serviceconnection.authTokenCache @@ -45,7 +50,7 @@ import net.mullvad.talpid.tunnel.ErrorStateCause import org.joda.time.DateTime import org.koin.android.ext.android.inject -class AccountFragment : BaseFragment() { +class AccountFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter { // Injected dependencies private val accountRepository: AccountRepository by inject() @@ -117,7 +122,7 @@ class AccountFragment : BaseFragment() { ): View { val view = inflater.inflate(R.layout.account, container, false) - view.findViewById<View>(R.id.back).setOnClickListener { + view.findViewById<View>(R.id.close).setOnClickListener { requireMainActivity().onBackPressed() } @@ -157,6 +162,11 @@ class AccountFragment : BaseFragment() { return view } + override fun onResume() { + super.onResume() + paintNavigationBar(ContextCompat.getColor(requireContext(), R.color.darkBlue)) + } + override fun onStop() { jobTracker.cancelAllJobs() super.onStop() @@ -178,6 +188,7 @@ class AccountFragment : BaseFragment() { launchUpdateTextOnExpiryChanges() launchTunnelStateSubscription() launchRefreshDeviceStateAfterAnimation() + launchPaintStatusBarAfterTransition() } } @@ -227,6 +238,12 @@ class AccountFragment : BaseFragment() { } } + private fun CoroutineScope.launchPaintStatusBarAfterTransition() = launch { + transitionFinishedFlow.collect { + paintStatusBar(ContextCompat.getColor(requireContext(), R.color.darkBlue)) + } + } + private fun CoroutineScope.launchRefreshDeviceStateAfterAnimation() = launch { transitionFinishedFlow.collect { deviceRepository.refreshDeviceState() } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/LoginFragment.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/LoginFragment.kt index 3168824c92..ba29326b3d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/LoginFragment.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/LoginFragment.kt @@ -58,7 +58,11 @@ class LoginFragment : BaseFragment(), NavigationBarPainter { ): View? { val view = inflater.inflate(R.layout.login, container, false) - headerBar = view.findViewById(R.id.header_bar) + headerBar = + view.findViewById<HeaderBar?>(R.id.header_bar).apply { + setAccountButtonVisibility(false) + } + title = view.findViewById(R.id.title) subtitle = view.findViewById(R.id.subtitle) loggingInStatus = view.findViewById(R.id.logging_in_status) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/SettingsFragment.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/SettingsFragment.kt index 8db85de50d..4ebd2eff38 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/SettingsFragment.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/fragment/SettingsFragment.kt @@ -13,12 +13,10 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.flatMapLatest -import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import net.mullvad.mullvadvpn.BuildConfig import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.model.DeviceState -import net.mullvad.mullvadvpn.repository.AccountRepository import net.mullvad.mullvadvpn.repository.DeviceRepository import net.mullvad.mullvadvpn.ui.CollapsibleTitleController import net.mullvad.mullvadvpn.ui.NavigationBarPainter @@ -29,7 +27,6 @@ import net.mullvad.mullvadvpn.ui.paintStatusBar import net.mullvad.mullvadvpn.ui.serviceconnection.ServiceConnectionManager import net.mullvad.mullvadvpn.ui.serviceconnection.ServiceConnectionState import net.mullvad.mullvadvpn.ui.serviceconnection.appVersionInfoCache -import net.mullvad.mullvadvpn.ui.widget.AccountCell import net.mullvad.mullvadvpn.ui.widget.AppVersionCell import net.mullvad.mullvadvpn.ui.widget.NavigateCell import net.mullvad.mullvadvpn.util.JobTracker @@ -41,11 +38,9 @@ import org.koin.android.ext.android.inject class SettingsFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter { // Injected dependencies - private val accountRepository: AccountRepository by inject() private val deviceRepository: DeviceRepository by inject() private val serviceConnectionManager: ServiceConnectionManager by inject() - private lateinit var accountMenu: AccountCell private lateinit var appVersionMenu: AppVersionCell private lateinit var vpnSettingsMenu: View private lateinit var splitTunnelingMenu: View @@ -67,11 +62,6 @@ class SettingsFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter view.findViewById<ImageButton>(R.id.close).setOnClickListener { activity?.onBackPressed() } - accountMenu = - view.findViewById<AccountCell>(R.id.account).apply { - targetFragment = AccountFragment::class - } - vpnSettingsMenu = view.findViewById<NavigateCell>(R.id.vpn_settings).apply { targetFragment = VpnSettingsFragment::class @@ -114,7 +104,6 @@ class SettingsFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter private fun initializeUiState() { updateLoggedInStatus(deviceRepository.deviceState.value is DeviceState.LoggedIn) - accountMenu.accountExpiry = accountRepository.accountExpiryState.value.date() appVersionMenu.version = BuildConfig.VERSION_NAME serviceConnectionManager.appVersionInfoCache().let { cache -> updateVersionInfo( @@ -141,7 +130,6 @@ class SettingsFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter repeatOnLifecycle(Lifecycle.State.RESUMED) { launchPaintStatusBarAfterTransition() luanchConfigureMenuOnDeviceChanges() - launchUpdateExpiryTextOnExpiryChanges() launchVersionInfoSubscription() } } @@ -158,12 +146,6 @@ class SettingsFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter .collect { device -> updateLoggedInStatus(device is DeviceState.LoggedIn) } } - private fun CoroutineScope.launchUpdateExpiryTextOnExpiryChanges() = launch { - accountRepository.accountExpiryState - .map { state -> state.date() } - .collect { expiryDate -> accountMenu.accountExpiry = expiryDate } - } - private fun CoroutineScope.launchVersionInfoSubscription() = launch { serviceConnectionManager.connectionState .flatMapLatest { state -> @@ -184,7 +166,6 @@ class SettingsFragment : BaseFragment(), StatusBarPainter, NavigationBarPainter View.GONE } - accountMenu.visibility = visibility vpnSettingsMenu.visibility = visibility splitTunnelingMenu.visibility = visibility } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountCell.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountCell.kt deleted file mode 100644 index 4a4acf737a..0000000000 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountCell.kt +++ /dev/null @@ -1,70 +0,0 @@ -package net.mullvad.mullvadvpn.ui.widget - -import android.content.Context -import android.graphics.Typeface -import android.util.AttributeSet -import android.util.TypedValue -import android.view.Gravity -import android.widget.TextView -import kotlin.properties.Delegates.observable -import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.util.TimeLeftFormatter -import org.joda.time.DateTime -import org.joda.time.Duration - -class AccountCell : NavigateCell { - private val formatter = TimeLeftFormatter(resources) - - private val expiredColor = context.getColor(R.color.red) - private val normalColor = context.getColor(R.color.white60) - - private val remainingTimeLabel = - TextView(context).apply { - layoutParams = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 0.0f) - gravity = Gravity.RIGHT - - resources.getDimensionPixelSize(R.dimen.cell_inner_spacing).let { padding -> - setPadding(padding, 0, padding, 0) - } - - setAllCaps(true) - setTextColor(normalColor) - setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension(R.dimen.text_small)) - setTypeface(null, Typeface.BOLD) - - text = "" - } - - var accountExpiry by - observable<DateTime?>(null) { _, _, expiry -> - remainingTimeLabel.apply { - if (expiry != null) { - val remainingTime = Duration(DateTime.now(), expiry) - - if (remainingTime.isShorterThan(Duration.ZERO)) { - setText(R.string.out_of_time) - setTextColor(expiredColor) - } else { - setText(formatter.format(expiry, remainingTime)) - setTextColor(normalColor) - } - } else { - text = "" - } - } - } - - constructor(context: Context) : super(context) - - constructor(context: Context, attributes: AttributeSet) : super(context, attributes) - - constructor( - context: Context, - attributes: AttributeSet, - defaultStyleAttribute: Int - ) : super(context, attributes, defaultStyleAttribute) - - init { - cell.addView(remainingTimeLabel, cell.childCount - 1) - } -} diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt index 6f7ca5e8c5..788bc92691 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt @@ -7,6 +7,7 @@ import android.view.LayoutInflater import android.view.View import android.widget.LinearLayout import androidx.core.content.ContextCompat +import androidx.core.view.isVisible import kotlin.properties.Delegates.observable import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.model.TunnelState @@ -24,6 +25,7 @@ constructor( ) : LinearLayout(context, attributes, defStyleAttr, defStyleRes), StatusBarPainter { private val container = LayoutInflater.from(context).inflate(R.layout.header_bar, this) private val settingsButton = findViewById<View>(R.id.settings) + private val accountButton = findViewById<View>(R.id.account) private val disabledColor = ContextCompat.getColor(context, android.R.color.transparent) private val securedColor = ContextCompat.getColor(context, R.color.green) @@ -48,6 +50,11 @@ constructor( gravity = Gravity.CENTER_VERTICAL orientation = HORIZONTAL + accountButton.apply { + isEnabled = true + setOnClickListener { (context as? MainActivity)?.openAccount() } + } + settingsButton.apply { isEnabled = true setOnClickListener { (context as? MainActivity)?.openSettings() } @@ -56,6 +63,10 @@ constructor( tunnelState = null } + fun setAccountButtonVisibility(isVisible: Boolean) { + accountButton.isVisible = isVisible + } + fun setSettingsButtonEnabled(isEnabled: Boolean) { settingsButton.isEnabled = isEnabled } diff --git a/android/app/src/main/res/drawable/icon_account.xml b/android/app/src/main/res/drawable/icon_account.xml new file mode 100644 index 0000000000..7fe5c11f05 --- /dev/null +++ b/android/app/src/main/res/drawable/icon_account.xml @@ -0,0 +1,12 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path android:pathData="M12,24A12,12 0,0 1,3.515 3.515a12,12 0,1 1,16.97 16.97A11.922,11.922 0,0 1,12 24zM12,12.175a12.164,12.164 0,0 0,-2.873 0.348,17.625 17.625,0 0,0 -2.99,1.048A2.85,2.85 0,0 0,5 14.525a2.573,2.573 0,0 0,-0.442 1.512v0.791a1.39,1.39 0,0 0,1.4 1.4h12.1a1.392,1.392 0,0 0,1.4 -1.4v-0.791A2.567,2.567 0,0 0,19 14.525a2.809,2.809 0,0 0,-1.163 -0.954,19.906 19.906,0 0,0 -2.978,-1.036 11.634,11.634 0,0 0,-2.859 -0.36zM12,3.775a3.345,3.345 0,0 0,-3.49 3.491,3.346 3.346,0 0,0 3.49,3.49 3.348,3.348 0,0 0,3.49 -3.49A3.346,3.346 0,0 0,12 3.776z" + android:strokeWidth="1" + android:fillColor="#FFFFFF" + android:fillAlpha="0.8" + android:fillType="evenOdd" + android:strokeColor="#00000000" /> +</vector> diff --git a/android/app/src/main/res/layout/account.xml b/android/app/src/main/res/layout/account.xml index 01a003c883..86af11c504 100644 --- a/android/app/src/main/res/layout/account.xml +++ b/android/app/src/main/res/layout/account.xml @@ -14,10 +14,13 @@ android:orientation="vertical"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> - <net.mullvad.mullvadvpn.ui.widget.BackButton android:id="@+id/back" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - mullvad:text="@string/settings" /> + <ImageButton android:id="@+id/close" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:background="?android:attr/selectableItemBackground" + android:src="@drawable/icon_close" + android:contentDescription="@string/back" /> <TextView android:id="@+id/collapsed_title" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/android/app/src/main/res/layout/header_bar.xml b/android/app/src/main/res/layout/header_bar.xml index 9ca2756626..f040afd9cb 100644 --- a/android/app/src/main/res/layout/header_bar.xml +++ b/android/app/src/main/res/layout/header_bar.xml @@ -22,6 +22,16 @@ app:layout_constraintStart_toEndOf="@id/appIcon" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" /> + <ImageButton android:id="@+id/account" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:background="?android:attr/selectableItemBackground" + android:paddingHorizontal="16dp" + android:src="@drawable/icon_account" + app:layout_constraintEnd_toStartOf="@id/settings" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:contentDescription="@string/settings_account" /> <ImageButton android:id="@+id/settings" android:layout_width="wrap_content" android:layout_height="match_parent" @@ -30,6 +40,7 @@ android:src="@drawable/icon_settings" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> + app:layout_constraintBottom_toBottomOf="parent" + android:contentDescription="@string/settings" /> </androidx.constraintlayout.widget.ConstraintLayout> </merge> diff --git a/android/app/src/main/res/layout/settings.xml b/android/app/src/main/res/layout/settings.xml index 0bd735a887..fe4d75ba99 100644 --- a/android/app/src/main/res/layout/settings.xml +++ b/android/app/src/main/res/layout/settings.xml @@ -43,15 +43,10 @@ android:lines="1" android:text="@string/settings" style="@style/SettingsExpandedHeader" /> - <net.mullvad.mullvadvpn.ui.widget.AccountCell android:id="@+id/account" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/vertical_space" - mullvad:text="@string/settings_account" /> <net.mullvad.mullvadvpn.ui.widget.NavigateCell android:id="@+id/vpn_settings" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="1dp" + android:layout_marginTop="@dimen/vertical_space" mullvad:text="@string/settings_vpn" /> <net.mullvad.mullvadvpn.ui.widget.NavigateCell android:id="@+id/split_tunneling" android:layout_width="match_parent" |
