diff options
author | Aditya Wasan <adityawasan55@gmail.com> | 2021-01-08 03:38:45 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2021-08-11 13:23:55 +0530 |
commit | 58bbf82a5690ca1d1c58a2666222a9b7343a96aa (patch) | |
tree | d99fbd8bff18285d7ad54352b3a0a29ae5df60bf | |
parent | ebddce11fca7a64c2d0ec7682f851e09f58db1ac (diff) |
Fix auth modes not displaying properly (#1271)
* res: fix auth modes not displaying properly
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
* res: wrap onboarding flow screens inside ScrollView
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
(cherry picked from commit 534269c8fc8fbd9a72e64389564fb0c90365c0c0)
-rw-r--r-- | app/src/main/res/layout/activity_git_clone.xml | 30 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_clone.xml | 160 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_key_selection.xml | 16 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_repo_location.xml | 160 | ||||
-rw-r--r-- | app/src/main/res/values-hdpi/dimens.xml | 7 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 2 |
7 files changed, 212 insertions, 167 deletions
diff --git a/app/src/main/res/layout/activity_git_clone.xml b/app/src/main/res/layout/activity_git_clone.xml index 7ee64e51..791d5414 100644 --- a/app/src/main/res/layout/activity_git_clone.xml +++ b/app/src/main/res/layout/activity_git_clone.xml @@ -33,7 +33,8 @@ android:id="@+id/label_server_url" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_margin="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" android:hint="@string/server_url" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -53,7 +54,8 @@ android:id="@+id/label_server_branch" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_margin="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" android:hint="@string/server_branch" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -83,9 +85,11 @@ <com.google.android.material.button.MaterialButtonToggleGroup android:id="@+id/auth_mode_group" style="@style/TextAppearance.MaterialComponents.Headline1" - android:layout_width="wrap_content" + android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_margin="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/label_auth_mode" app:singleSelection="true"> @@ -95,21 +99,33 @@ style="?attr/materialButtonOutlinedStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/connection_mode_ssh_key" /> + android:layout_weight="1" + android:minWidth="0dp" + android:padding="8dp" + android:text="@string/connection_mode_ssh_key" + android:textSize="@dimen/toggle_group_text_size" /> <com.google.android.material.button.MaterialButton android:id="@+id/auth_mode_password" style="?attr/materialButtonOutlinedStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/connection_mode_basic_authentication" /> + android:layout_weight="1" + android:minWidth="0dp" + android:padding="8dp" + android:text="@string/connection_mode_basic_authentication" + android:textSize="@dimen/toggle_group_text_size" /> <com.google.android.material.button.MaterialButton android:id="@+id/auth_mode_open_keychain" style="?attr/materialButtonOutlinedStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/connection_mode_openkeychain" /> + android:layout_weight="1" + android:minWidth="0dp" + android:padding="8dp" + android:text="@string/connection_mode_openkeychain" + android:textSize="@dimen/toggle_group_text_size" /> </com.google.android.material.button.MaterialButtonToggleGroup> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/fragment_clone.xml b/app/src/main/res/layout/fragment_clone.xml index a4c0c841..4013f7a2 100644 --- a/app/src/main/res/layout/fragment_clone.xml +++ b/app/src/main/res/layout/fragment_clone.xml @@ -1,86 +1,94 @@ -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/colorPrimary" - android:orientation="vertical"> + android:background="?attr/colorPrimary"> - <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.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> - <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" /> + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/app_icon" + android:layout_width="64dp" + android:layout_height="64dp" + android:layout_marginStart="32dp" + android:layout_marginTop="@dimen/onboarding_icon_margin_top" + android:contentDescription="@string/app_icon_hint" + android:src="@mipmap/ic_launcher" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <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" /> + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/app_name" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginStart="@dimen/fab_compat_margin" + android:layout_marginEnd="@dimen/fab_compat_margin" + 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_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/app_icon" + app:layout_constraintTop_toTopOf="@+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" /> + <TextView + android:id="@+id/repo_type" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="48dp" + android:layout_marginEnd="@dimen/fab_compat_margin" + 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" /> - <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" /> + <TextView + android:id="@+id/tv_repo_type_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/onboarding_desc_margin_top" + android:layout_marginEnd="@dimen/fab_compat_margin" + android:text="@string/select_repo_type_text" + android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2" + android:textColor="@color/color_control_normal" + 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/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" /> + <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_marginTop="@dimen/onboarding_button_margin_top" + 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" + app:layout_constraintTop_toBottomOf="@id/tv_repo_type_text" /> -</androidx.constraintlayout.widget.ConstraintLayout> + <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_constraintEnd_toEndOf="@id/clone_remote" + app:layout_constraintStart_toStartOf="@id/clone_remote" + app:layout_constraintTop_toBottomOf="@id/clone_remote" /> + + </androidx.constraintlayout.widget.ConstraintLayout> +</ScrollView> diff --git a/app/src/main/res/layout/fragment_key_selection.xml b/app/src/main/res/layout/fragment_key_selection.xml index 9a391276..f3dd753a 100644 --- a/app/src/main/res/layout/fragment_key_selection.xml +++ b/app/src/main/res/layout/fragment_key_selection.xml @@ -15,7 +15,7 @@ android:layout_width="64dp" android:layout_height="64dp" android:layout_marginStart="32dp" - android:layout_marginTop="100dp" + android:layout_marginTop="@dimen/onboarding_icon_margin_top" android:contentDescription="@string/app_icon_hint" android:src="@mipmap/ic_launcher" app:layout_constraintStart_toStartOf="parent" @@ -23,23 +23,26 @@ <androidx.appcompat.widget.AppCompatTextView android:id="@+id/app_name" - android:layout_width="wrap_content" + android:layout_width="0dp" android:layout_height="wrap_content" android:layout_centerHorizontal="true" - android:layout_marginStart="16dp" + android:layout_marginStart="@dimen/fab_compat_margin" + android:layout_marginEnd="@dimen/fab_compat_margin" 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_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/app_icon" app:layout_constraintTop_toTopOf="@+id/app_icon" /> <TextView android:id="@+id/gpg_key" - android:layout_width="wrap_content" + android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="48dp" + android:layout_marginEnd="@dimen/fab_compat_margin" android:text="@string/select_gpg_key_title" android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4" android:textColor="@color/color_control_normal" @@ -53,12 +56,11 @@ android:id="@+id/gpg_key_text" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginTop="48dp" + android:layout_marginTop="@dimen/onboarding_desc_margin_top" android:layout_marginEnd="16dp" android:text="@string/select_gpg_key_message" - android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" + android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2" android:textColor="@color/color_control_normal" - android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@id/gpg_key" app:layout_constraintTop_toBottomOf="@id/gpg_key" /> diff --git a/app/src/main/res/layout/fragment_repo_location.xml b/app/src/main/res/layout/fragment_repo_location.xml index 9581774e..268907ba 100644 --- a/app/src/main/res/layout/fragment_repo_location.xml +++ b/app/src/main/res/layout/fragment_repo_location.xml @@ -1,86 +1,94 @@ -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/colorPrimary" - android:orientation="vertical"> + android:background="?attr/colorPrimary"> - <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.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> - <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" /> + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/app_icon" + android:layout_width="64dp" + android:layout_height="64dp" + android:layout_marginStart="32dp" + android:layout_marginTop="@dimen/onboarding_icon_margin_top" + android:contentDescription="@string/app_icon_hint" + android:src="@mipmap/ic_launcher" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <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" /> + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/app_name" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginStart="@dimen/fab_compat_margin" + android:layout_marginEnd="@dimen/fab_compat_margin" + 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_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/app_icon" + app:layout_constraintTop_toTopOf="@+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" /> + <TextView + android:id="@+id/repo_location" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="48dp" + android:layout_marginEnd="@dimen/fab_compat_margin" + 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_constraintStart_toStartOf="@id/app_icon" + app:layout_constraintTop_toBottomOf="@id/app_icon" /> - <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" /> + <TextView + android:id="@+id/repo_location_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/onboarding_desc_margin_top" + android:layout_marginEnd="16dp" + android:text="@string/location_dialog_create_text" + android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2" + android:textColor="@color/color_control_normal" + 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/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" /> + <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_marginTop="@dimen/onboarding_button_margin_top" + 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" + app:layout_constraintTop_toBottomOf="@id/repo_location_text" /> + + <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_constraintEnd_toEndOf="@id/hidden" + app:layout_constraintStart_toStartOf="@id/hidden" + app:layout_constraintTop_toBottomOf="@id/hidden" /> + + </androidx.constraintlayout.widget.ConstraintLayout> +</ScrollView> -</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/values-hdpi/dimens.xml b/app/src/main/res/values-hdpi/dimens.xml new file mode 100644 index 00000000..e48a0198 --- /dev/null +++ b/app/src/main/res/values-hdpi/dimens.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="toggle_group_text_size">12sp</dimen> + <dimen name="onboarding_icon_margin_top">50dp</dimen> + <dimen name="onboarding_button_margin_top">70dp</dimen> + <dimen name="onboarding_desc_margin_top">48dp</dimen> +</resources> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index a76d0bab..d82d030c 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -10,4 +10,8 @@ <dimen name="fab_compat_margin">16dp</dimen> <dimen name="normal_margin">8dp</dimen> <dimen name="bottom_sheet_item_height">56dp</dimen> + <dimen name="toggle_group_text_size">14sp</dimen> + <dimen name="onboarding_icon_margin_top">100dp</dimen> + <dimen name="onboarding_button_margin_top">140dp</dimen> + <dimen name="onboarding_desc_margin_top">48dp</dimen> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index af8fa88a..39e4e883 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -399,7 +399,7 @@ <string name="select_repo_type_text">Select if you want to create a local repo or clone a remote repo.</string> <string name="clone_remote_repo">Clone Remote Repo</string> <string name="create_local_repo">Create Local Repo</string> - <string name="select_gpg_key_title">Select\nGPG\nKey</string> + <string name="select_gpg_key_title">Select\nGPG Key</string> <string name="select_gpg_key_message">Select a GPG key to initialize your store with</string> <string name="gpg_key_select">Select key</string> |