aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorAditya Wasan <adityawasan55@gmail.com>2020-09-15 21:53:12 +0530
committerGitHub <noreply@github.com>2020-09-15 21:53:12 +0530
commit4ba3b75f858251099f18f07be700f9900128f8e1 (patch)
treea3a689288253484817f868d15025fbbaf4a8d122 /app/src/main/res/layout
parenta34f749e9ac1d6112a42b0f4ded3ae801d8c583c (diff)
Update on-boarding UI (#1099)
* Add onboarding flow from v2 Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Minor fixes Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Add changelog entry Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Remove old activity from manifest Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Remove view type prefix from view ids Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Review fixes Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Treewide: Reformat code Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Moar review fixes Signed-off-by: Aditya Wasan <adityawasan55@gmail.com> * Revert "Treewide: Reformat code" This reverts commit 348ef0050942526a55890b245afec8d7fee4d81e. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * onboarding: cleanup OnboardingActivity init Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Remove unused layout Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Remove unnecessary ConstraintLayout Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Shorten animation duration Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * onboarding: use viewBinding extension in fragments Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/activity_onboarding.xml76
-rw-r--r--app/src/main/res/layout/fragment_clone.xml87
-rw-r--r--app/src/main/res/layout/fragment_repo_location.xml87
-rw-r--r--app/src/main/res/layout/fragment_welcome.xml51
4 files changed, 233 insertions, 68 deletions
diff --git a/app/src/main/res/layout/activity_onboarding.xml b/app/src/main/res/layout/activity_onboarding.xml
index f2c6f797..6d880c31 100644
--- a/app/src/main/res/layout/activity_onboarding.xml
+++ b/app/src/main/res/layout/activity_onboarding.xml
@@ -1,73 +1,13 @@
-<!--
- ~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
- ~ SPDX-License-Identifier: GPL-3.0-only
- -->
-
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:orientation="vertical">
- <androidx.appcompat.widget.AppCompatImageView
- android:id="@+id/app_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:contentDescription="@string/app_icon_hint"
- android:src="@mipmap/ic_launcher"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/app_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/app_icon"
- android:layout_centerHorizontal="true"
- android:text="@string/app_name"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:textColor="?attr/colorOnPrimary"
- android:textStyle="bold"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/app_icon" />
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/settings_button"
- style="@style/Widget.MaterialComponents.Button.TextButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentEnd="true"
- android:layout_marginEnd="@dimen/activity_horizontal_margin"
- android:text="@string/action_settings"
- android:textColor="?attr/colorOnPrimary"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/local_directory_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="48dp"
- android:text="@string/initialize"
- android:textSize="12sp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/app_name" />
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/clone_from_server_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/clone"
- android:textSize="12sp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/local_directory_button" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>
+ <androidx.fragment.app.FragmentContainerView
+ android:id="@+id/fragment_first_run"
+ android:name="com.zeapo.pwdstore.ui.onboarding.fragments.WelcomeFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:tag="welcome_fragment" />
+</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_clone.xml b/app/src/main/res/layout/fragment_clone.xml
new file mode 100644
index 00000000..0e173428
--- /dev/null
+++ b/app/src/main/res/layout/fragment_clone.xml
@@ -0,0 +1,87 @@
+<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
+ android:background="?attr/colorPrimary"
+ android:orientation="vertical">
+
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/app_icon"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:layout_marginStart="32dp"
+ android:layout_marginTop="100dp"
+ android:contentDescription="@string/app_icon_hint"
+ android:src="@mipmap/ic_launcher"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/app_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_marginStart="16dp"
+ android:text="@string/app_name"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ app:layout_constraintBottom_toBottomOf="@id/app_icon"
+ app:layout_constraintStart_toEndOf="@id/app_icon"
+ app:layout_constraintTop_toTopOf="@+id/app_icon" />
+
+ <TextView
+ android:id="@+id/repo_type"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="48dp"
+ android:text="@string/select_n_repository_type"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintStart_toStartOf="@id/app_icon"
+ app:layout_constraintTop_toBottomOf="@id/app_icon" />
+
+ <TextView
+ android:id="@+id/tv_repo_type_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="48dp"
+ android:layout_marginEnd="16dp"
+ android:text="@string/select_repo_type_text"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="@id/repo_type"
+ app:layout_constraintTop_toBottomOf="@id/repo_type" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/clone_remote"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:maxWidth="300dp"
+ android:minWidth="100dp"
+ android:text="@string/clone_remote_repo"
+ app:layout_constraintBottom_toTopOf="@id/create_local"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/create_local"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="128dp"
+ android:maxWidth="300dp"
+ android:minWidth="100dp"
+ android:text="@string/create_local_repo"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="@id/clone_remote"
+ app:layout_constraintStart_toStartOf="@id/clone_remote" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/app/src/main/res/layout/fragment_repo_location.xml b/app/src/main/res/layout/fragment_repo_location.xml
new file mode 100644
index 00000000..cc987d8c
--- /dev/null
+++ b/app/src/main/res/layout/fragment_repo_location.xml
@@ -0,0 +1,87 @@
+<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
+ android:background="?attr/colorPrimary"
+ android:orientation="vertical">
+
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/app_icon"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:layout_marginStart="32dp"
+ android:layout_marginTop="100dp"
+ android:contentDescription="@string/app_icon_hint"
+ android:src="@mipmap/ic_launcher"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/app_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_marginStart="16dp"
+ android:text="@string/app_name"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ app:layout_constraintBottom_toBottomOf="@id/app_icon"
+ app:layout_constraintStart_toEndOf="@id/app_icon"
+ app:layout_constraintTop_toTopOf="@+id/app_icon" />
+
+ <TextView
+ android:id="@+id/repo_location"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="48dp"
+ android:text="@string/repository_n_location"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintStart_toStartOf="@id/app_icon"
+ app:layout_constraintTop_toBottomOf="@id/app_icon" />
+
+ <TextView
+ android:id="@+id/repo_location_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="48dp"
+ android:layout_marginEnd="16dp"
+ android:text="@string/location_dialog_create_text"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="@id/repo_location"
+ app:layout_constraintTop_toBottomOf="@id/repo_location" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/hidden"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:maxWidth="300dp"
+ android:minWidth="100dp"
+ android:text="@string/location_hidden"
+ app:layout_constraintBottom_toTopOf="@id/sdcard"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/sdcard"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="128dp"
+ android:maxWidth="300dp"
+ android:minWidth="100dp"
+ android:text="@string/location_sdcard"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="@id/hidden"
+ app:layout_constraintStart_toStartOf="@id/hidden" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/app/src/main/res/layout/fragment_welcome.xml b/app/src/main/res/layout/fragment_welcome.xml
new file mode 100644
index 00000000..98a0475d
--- /dev/null
+++ b/app/src/main/res/layout/fragment_welcome.xml
@@ -0,0 +1,51 @@
+<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
+ android:background="?attr/colorPrimary"
+ android:orientation="vertical">
+
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/app_icon"
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:contentDescription="@string/app_icon_hint"
+ android:src="@mipmap/ic_launcher"
+ android:transitionName="transition_first_app_icon"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/app_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="16dp"
+ android:text="@string/app_name"
+ android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
+ android:textColor="@color/color_control_normal"
+ android:textStyle="bold"
+ android:transitionName="transition_first_run_app_name"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/app_icon" />
+
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/lets_go"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="48dp"
+ android:layout_marginEnd="16dp"
+ android:maxWidth="300dp"
+ android:minWidth="100dp"
+ android:text="@string/let_s_go"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/app_name" />
+</androidx.constraintlayout.widget.ConstraintLayout>