summaryrefslogtreecommitdiffhomepage
path: root/android/src/main/res
diff options
context:
space:
mode:
authorAleksandr Granin <aleksandr@mullvad.net>2021-04-06 14:43:30 +0200
committerAleksandr Granin <aleksandr@mullvad.net>2021-04-19 14:36:22 +0200
commitb3b5da44ec8bf1f2a39cb33ad31d89dd571ac731 (patch)
treef47b084bd46361fb26b95fd66091c393ed8151f7 /android/src/main/res
parent585303d6cb04657d7466a4ba5e1bc6c6eb0227d0 (diff)
downloadmullvadvpn-b3b5da44ec8bf1f2a39cb33ad31d89dd571ac731.tar.xz
mullvadvpn-b3b5da44ec8bf1f2a39cb33ad31d89dd571ac731.zip
Refactor SplitTunneling Fragment, add tests.
Diffstat (limited to 'android/src/main/res')
-rw-r--r--android/src/main/res/layout/collapsed_title_layout.xml65
-rw-r--r--android/src/main/res/layout/list_item_widget_edit_text.xml21
-rw-r--r--android/src/main/res/values/dimensions.xml1
-rw-r--r--android/src/main/res/values/styles.xml2
4 files changed, 68 insertions, 21 deletions
diff --git a/android/src/main/res/layout/collapsed_title_layout.xml b/android/src/main/res/layout/collapsed_title_layout.xml
new file mode 100644
index 0000000000..64ad3ed2d6
--- /dev/null
+++ b/android/src/main/res/layout/collapsed_title_layout.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/main_content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/darkBlue"
+ android:fitsSystemWindows="false">
+ <com.google.android.material.appbar.AppBarLayout android:id="@+id/appbar"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/expanded_toolbar_height"
+ android:background="@color/darkBlue"
+ android:fitsSystemWindows="false"
+ android:padding="0dp"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
+
+ <com.google.android.material.appbar.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="false"
+ app:collapsedTitleGravity="center"
+ app:collapsedTitleTextAppearance="@style/TextAppearance.Mullvad.CollapsingToolbar.Collapsed"
+ app:contentScrim="@color/darkBlue"
+ app:expandedTitleGravity="start|bottom"
+ app:expandedTitleMarginBottom="20dp"
+ app:expandedTitleMarginStart="22dp"
+ app:expandedTitleMarginTop="0dp"
+ app:expandedTitleTextAppearance="@style/TextAppearance.Mullvad.CollapsingToolbar.Expanded"
+ app:layout_scrollFlags="scroll|exitUntilCollapsed"
+ app:title="@string/split_tunneling">
+
+ <com.google.android.material.appbar.MaterialToolbar android:id="@+id/toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:padding="0dp"
+ app:layout_collapseMode="pin"
+ app:layout_scrollFlags="scroll|enterAlways"
+ android:contentInsetLeft="0dp"
+ android:contentInsetStart="0dp"
+ app:contentInsetLeft="0dp"
+ app:contentInsetStart="0dp"
+ android:contentInsetRight="0dp"
+ android:contentInsetEnd="0dp"
+ app:contentInsetRight="0dp"
+ app:contentInsetEnd="0dp"
+ app:contentInsetStartWithNavigation="0dp"
+ app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
+ <net.mullvad.mullvadvpn.ui.widget.BackButton android:id="@+id/back"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:layout_collapseMode="pin"
+ app:layout_collapseParallaxMultiplier="0"
+ app:layout_scrollFlags="enterAlwaysCollapsed|enterAlways"
+ app:text="@string/settings_advanced" />
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+ <androidx.recyclerview.widget.RecyclerView android:id="@+id/recyclerView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ tools:listitem="@layout/app_list_item"
+ tools:itemCount="15"
+ app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
diff --git a/android/src/main/res/layout/list_item_widget_edit_text.xml b/android/src/main/res/layout/list_item_widget_edit_text.xml
deleted file mode 100644
index 13b24c9d80..0000000000
--- a/android/src/main/res/layout/list_item_widget_edit_text.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.appcompat.widget.AppCompatEditText xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:background="@drawable/cell_input_background"
- android:digits="0123456789"
- android:gravity="center"
- android:hint="@string/hint_default"
- android:imeOptions="flagNoPersonalizedLearning"
- android:inputType="number"
- android:maxWidth="130dp"
- android:maxLength="4"
- android:minWidth="@dimen/cell_input_width"
- android:paddingHorizontal="8dp"
- android:paddingVertical="4dp"
- android:singleLine="true"
- android:textColor="@color/white"
- android:textColorHint="@color/white80"
- android:textCursorDrawable="@drawable/cell_input_cursor"
- android:textSize="@dimen/text_medium_plus" />
diff --git a/android/src/main/res/values/dimensions.xml b/android/src/main/res/values/dimensions.xml
index 3d42e74afd..c8e8b2ff33 100644
--- a/android/src/main/res/values/dimensions.xml
+++ b/android/src/main/res/values/dimensions.xml
@@ -45,6 +45,7 @@
<dimen name="progress_size">60dp</dimen>
<dimen name="icon_size">24dp</dimen>
<dimen name="widget_padding">16dp</dimen>
+ <dimen name="expanded_toolbar_height">104dp</dimen>
<!-- Switch Dimens-->
<dimen name="switch_width">46dp</dimen>
<dimen name="switch_height">30dp</dimen>
diff --git a/android/src/main/res/values/styles.xml b/android/src/main/res/values/styles.xml
index 2a2734505a..742cc42c4f 100644
--- a/android/src/main/res/values/styles.xml
+++ b/android/src/main/res/values/styles.xml
@@ -8,6 +8,8 @@
<item name="switchStyle">@style/AppTheme.Switch</item>
<item name="actionListItemViewStyle">@style/ListItem.Action</item>
<item name="applicationListItemViewStyle">@style/ListItem.Action.Application</item>
+ <item name="android:spotShadowAlpha">0</item>
+ <item name="actionBarSize">48dp</item>
</style>
<style name="InputText"
parent="Widget.AppCompat.EditText">