diff options
| author | Aleksandr Granin <aleksandr@mullvad.net> | 2021-03-01 14:55:08 +0100 |
|---|---|---|
| committer | Aleksandr Granin <aleksandr@mullvad.net> | 2021-03-12 14:57:41 +0100 |
| commit | fa8cb1e8461be82416d0f4d9c48dcbb22938fd8b (patch) | |
| tree | ef1ca691b54291a7e13252874911131bafba62d9 /android/src/main/res/layout | |
| parent | 1db49ed3e79d82697f7e3490249ef2cce463c2be (diff) | |
| download | mullvadvpn-fa8cb1e8461be82416d0f4d9c48dcbb22938fd8b.tar.xz mullvadvpn-fa8cb1e8461be82416d0f4d9c48dcbb22938fd8b.zip | |
Create list item view and layouts. Defie text and list item styles
Diffstat (limited to 'android/src/main/res/layout')
9 files changed, 202 insertions, 0 deletions
diff --git a/android/src/main/res/layout/list_item_action.xml b/android/src/main/res/layout/list_item_action.xml new file mode 100644 index 0000000000..d1ebee41c7 --- /dev/null +++ b/android/src/main/res/layout/list_item_action.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge 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" + style="@style/ListItem.Action" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> + <include layout="@layout/list_item_base" /> + <FrameLayout android:id="@+id/widgetContainer" + android:layout_width="wrap_content" + android:layout_height="0dp" + android:paddingStart="@dimen/cell_right_padding" + android:paddingEnd="@dimen/cell_right_padding" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/itemText" + app:layout_constraintTop_toTopOf="parent" /> + <androidx.constraintlayout.widget.Guideline android:id="@+id/endGuideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_end="@dimen/cell_right_padding" /> + <androidx.constraintlayout.widget.Barrier android:id="@+id/widgetBarrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="start" + app:constraint_referenced_ids="widgetContainer,endGuideline" /> +</merge> diff --git a/android/src/main/res/layout/list_item_base.xml b/android/src/main/res/layout/list_item_base.xml new file mode 100644 index 0000000000..d4b723d70a --- /dev/null +++ b/android/src/main/res/layout/list_item_base.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge 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:layout_width="match_parent" + android:layout_height="@dimen/cell_height" + tools:background="@color/green" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/itemIcon" + android:layout_width="@dimen/icon_size" + android:layout_height="@dimen/icon_size" + android:layout_marginEnd="@dimen/cell_inner_spacing" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/itemText" + app:layout_constraintStart_toStartOf="@id/startGuideline" + app:layout_constraintTop_toTopOf="parent" + tools:visibility="gone" + tools:src="@drawable/launch_logo" /> + <androidx.appcompat.widget.AppCompatTextView android:id="@+id/itemText" + android:layout_width="0dp" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:textAppearance="@style/TextAppearance.Mullvad.Title1" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/widgetBarrier" + app:layout_constraintStart_toEndOf="@id/itemIcon" + app:layout_constraintTop_toTopOf="parent" + tools:background="@color/white20" + tools:text="WireGuard MTU" /> + <androidx.constraintlayout.widget.Guideline android:id="@+id/startGuideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_begin="@dimen/screen_vertical_margin" /> + <androidx.constraintlayout.widget.Barrier android:id="@+id/widgetBarrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="start" + app:constraint_referenced_ids="parent" /> +</merge> diff --git a/android/src/main/res/layout/list_item_group_divider.xml b/android/src/main/res/layout/list_item_group_divider.xml new file mode 100644 index 0000000000..9546d55c98 --- /dev/null +++ b/android/src/main/res/layout/list_item_group_divider.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="@dimen/vertical_space" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout" /> diff --git a/android/src/main/res/layout/list_item_plain_text.xml b/android/src/main/res/layout/list_item_plain_text.xml new file mode 100644 index 0000000000..f17bc6ed5e --- /dev/null +++ b/android/src/main/res/layout/list_item_plain_text.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge 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:layout_width="match_parent" + android:layout_height="wrap_content" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> + <androidx.appcompat.widget.AppCompatTextView android:id="@+id/plain_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:paddingTop="0dp" + android:paddingBottom="0dp" + android:textAppearance="@style/TextAppearance.Mullvad.Small" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="@id/endGuideline" + app:layout_constraintStart_toStartOf="@id/startGuideline" + app:layout_constraintTop_toTopOf="parent" + tools:text="Choose the apps you want to exclude from the VPN tunnel." /> + <androidx.constraintlayout.widget.Guideline android:id="@+id/startGuideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_begin="@dimen/screen_vertical_margin" /> + <androidx.constraintlayout.widget.Guideline android:id="@+id/endGuideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_end="@dimen/screen_vertical_margin" /> +</merge> diff --git a/android/src/main/res/layout/list_item_progress.xml b/android/src/main/res/layout/list_item_progress.xml new file mode 100644 index 0000000000..221947ea85 --- /dev/null +++ b/android/src/main/res/layout/list_item_progress.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge 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" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> + <ProgressBar android:id="@+id/loading_spinner" + android:layout_width="@dimen/progress_size" + android:layout_height="@dimen/progress_size" + android:indeterminate="true" + android:indeterminateDrawable="@drawable/icon_spinner" + android:indeterminateDuration="600" + android:indeterminateOnly="true" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> +</merge> diff --git a/android/src/main/res/layout/list_item_two_action.xml b/android/src/main/res/layout/list_item_two_action.xml new file mode 100644 index 0000000000..4928fef27b --- /dev/null +++ b/android/src/main/res/layout/list_item_two_action.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge 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:layout_width="match_parent" + android:layout_height="@dimen/cell_height" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"> + <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/container_without_widget" + android:layout_width="0dp" + android:layout_height="0dp" + android:background="?android:attr/selectableItemBackground" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/widgetBarrier" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + <include layout="@layout/list_item_base" /> + </androidx.constraintlayout.widget.ConstraintLayout> + <FrameLayout android:id="@+id/widgetContainer" + android:layout_width="wrap_content" + android:layout_height="0dp" + android:background="?android:attr/selectableItemBackground" + android:paddingStart="@dimen/cell_right_padding" + android:paddingEnd="@dimen/cell_right_padding" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:visibility="visible" + app:layout_constraintStart_toEndOf="@id/container_without_widget" + app:layout_constraintTop_toTopOf="parent" /> + <androidx.constraintlayout.widget.Guideline android:id="@+id/endGuideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_end="@dimen/cell_right_padding" /> + <androidx.constraintlayout.widget.Barrier android:id="@+id/widgetBarrier" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="start" + app:constraint_referenced_ids="widgetContainer,endGuideline" /> +</merge> 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 new file mode 100644 index 0000000000..13b24c9d80 --- /dev/null +++ b/android/src/main/res/layout/list_item_widget_edit_text.xml @@ -0,0 +1,21 @@ +<?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/layout/list_item_widget_image.xml b/android/src/main/res/layout/list_item_widget_image.xml new file mode 100644 index 0000000000..95034e46e3 --- /dev/null +++ b/android/src/main/res/layout/list_item_widget_image.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.appcompat.widget.AppCompatImageView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/widgetImage" + android:layout_width="@dimen/icon_size" + android:layout_height="@dimen/icon_size" + android:layout_gravity="center" + android:tint="@color/white40" + android:tintMode="multiply" + tools:src="@drawable/icon_extlink" /> diff --git a/android/src/main/res/layout/list_item_widget_switch.xml b/android/src/main/res/layout/list_item_widget_switch.xml new file mode 100644 index 0000000000..9c4e342660 --- /dev/null +++ b/android/src/main/res/layout/list_item_widget_switch.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.appcompat.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/widgetSwitch" + style="@style/AppTheme.Switch" + android:layout_gravity="center" + android:clickable="false" + android:focusable="false" + android:background="@null" + android:focusableInTouchMode="false" + tools:checked="false" /> |
