aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2019-11-05 10:05:07 +0530
committerGitHub <noreply@github.com>2019-11-05 10:05:07 +0530
commitfc2a11699a57fcd9e7de63449ad915d1c74e19f4 (patch)
tree86dcf282b7c1d917fee34b841ed6799ddf04068b /app/src/main/res/layout
parented0296131505fa8f5404324a938c430f00d174b1 (diff)
parent94e56ce8128c12c334d930f493124114057816c7 (diff)
downloadHardenedPass-fc2a11699a57fcd9e7de63449ad915d1c74e19f4.tar.gz
HardenedPass-fc2a11699a57fcd9e7de63449ad915d1c74e19f4.zip
Merge pull request #562 from android-password-store/msf/ui-rework
Redesign some UI elements
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/fragment_to_clone_or_not.xml141
-rw-r--r--app/src/main/res/layout/password_row_layout.xml98
2 files changed, 127 insertions, 112 deletions
diff --git a/app/src/main/res/layout/fragment_to_clone_or_not.xml b/app/src/main/res/layout/fragment_to_clone_or_not.xml
index cef35e1f..045d8d1e 100644
--- a/app/src/main/res/layout/fragment_to_clone_or_not.xml
+++ b/app/src/main/res/layout/fragment_to_clone_or_not.xml
@@ -1,81 +1,80 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?attr/colorPrimary"
- android:orientation="vertical"
- tools:context="com.zeapo.pwdstore.PasswordStore">
+ android:orientation="vertical">
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1">
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/app_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:src="@mipmap/ic_launcher"
+ android:contentDescription="@string/app_icon_hint"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent" />
- <androidx.appcompat.widget.AppCompatImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/imageView"
- android:layout_gravity="center"
- android:src="@mipmap/ic_launcher"
- android:contentDescription="@string/app_icon_hint"
- android:layout_centerVertical="true"
- android:layout_centerHorizontal="true" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/app_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:text="@string/app_name"
+ android:layout_below="@+id/app_icon"
+ android:layout_centerHorizontal="true"
+ android:textColor="@android:color/white"
+ android:textStyle="bold"
+ app:layout_constraintTop_toBottomOf="@+id/app_icon"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent" />
- <androidx.appcompat.widget.AppCompatTextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:text="@string/app_name"
- android:layout_below="@+id/imageView"
- android:layout_centerHorizontal="true"
- android:textColor="@android:color/white"
- android:textStyle="bold"/>
+ <com.google.android.material.button.MaterialButton
+ style="@style/Widget.MaterialComponents.Button.TextButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:onClick="openSettings"
+ android:text="@string/action_settings"
+ android:textColor="@android:color/white"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentEnd="true"
+ android:layout_marginEnd="@dimen/activity_horizontal_margin"
+ android:textAllCaps="true"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:onClick="openSettings"
- style="?android:attr/borderlessButtonStyle"
- android:text="@string/action_settings"
- android:textColor="@android:color/white"
- android:layout_alignParentTop="true"
- android:layout_alignParentEnd="true"
- android:layout_marginEnd="@dimen/activity_horizontal_margin"
- android:layout_marginTop="@dimen/activity_vertical_margin"
- android:textAllCaps="true"
- tools:ignore="RelativeOverlap" />
- </RelativeLayout>
+ <com.google.android.material.button.MaterialButton
+ style="@style/Widget.MaterialComponents.Button"
+ android:id="@+id/use_local_directory"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:onClick="createNewRepository"
+ android:textColor="@android:color/white"
+ android:text="@string/initialize"
+ android:textSize="12sp"
+ android:layout_marginTop="48dp"
+ app:backgroundTint="?attr/colorSecondary"
+ app:rippleColor="?attr/colorControlHighlight"
+ app:layout_constraintTop_toBottomOf="@id/app_name"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ tools:ignore="UnusedAttribute" />
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="48dp"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:background="?android:attr/windowBackground">
-
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="?android:attr/borderlessButtonStyle"
- android:backgroundTint="?android:attr/windowBackground"
- android:onClick="createNewRepository"
- android:text="@string/initialize"
- android:layout_alignTop="@+id/main_clone_button"
- android:layout_alignParentStart="true"
- android:textSize="12sp" />
- <Button
- android:id="@+id/main_clone_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- style="?android:attr/borderlessButtonStyle"
- android:backgroundTint="?android:attr/windowBackground"
- android:onClick="cloneExistingRepository"
- android:text="@string/clone"
- android:layout_alignParentBottom="true"
- android:layout_alignParentEnd="true"
- android:textSize="12sp"
- tools:ignore="RelativeOverlap" />
+ <com.google.android.material.button.MaterialButton
+ style="@style/Widget.MaterialComponents.Button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:onClick="cloneExistingRepository"
+ android:textColor="@android:color/white"
+ android:text="@string/clone"
+ android:textSize="12sp"
+ app:backgroundTint="?attr/colorSecondary"
+ app:rippleColor="?attr/colorControlHighlight"
+ app:layout_constraintTop_toBottomOf="@id/use_local_directory"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent" />
- </RelativeLayout>
-
-</LinearLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/app/src/main/res/layout/password_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml
index 462df815..bf7763ae 100644
--- a/app/src/main/res/layout/password_row_layout.xml
+++ b/app/src/main/res/layout/password_row_layout.xml
@@ -1,52 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
-<com.zeapo.pwdstore.widget.MultiselectableLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.zeapo.pwdstore.widget.MultiselectableConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/password_row_background">
+ android:background="@drawable/password_row_background"
+ android:paddingTop="12dp"
+ android:paddingBottom="12dp">
- <androidx.constraintlayout.widget.ConstraintLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="12dp"
- android:paddingBottom="12dp">
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/type_image"
+ android:layout_width="60dp"
+ android:layout_height="32dp"
+ android:layout_gravity="bottom"
+ android:alpha="0.5"
+ android:contentDescription="@string/folder_icon_hint"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ tools:src="@drawable/ic_multiple_files_tinted_24dp" />
- <androidx.appcompat.widget.AppCompatImageView
- android:id="@+id/type_image"
- android:layout_width="60dp"
- android:layout_height="32dp"
- android:layout_gravity="bottom"
- android:alpha="0.5"
- android:contentDescription="@string/folder_icon_hint"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- tools:src="@drawable/ic_folder_tinted_24dp" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/type"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="start"
+ android:singleLine="true"
+ android:textColor="?android:attr/textColor"
+ android:textSize="14sp"
+ app:layout_constraintStart_toEndOf="@id/type_image"
+ app:layout_constraintTop_toTopOf="parent"
+ tools:text="TYPE" />
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="start"
- android:singleLine="true"
- android:textColor="?android:attr/textColor"
- android:textSize="14sp"
- app:layout_constraintStart_toEndOf="@id/type_image"
- app:layout_constraintTop_toTopOf="parent"
- tools:text="TYPE" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:textColor="?android:attr/textColor"
+ android:textSize="18sp"
+ app:layout_constraintStart_toEndOf="@id/type_image"
+ app:layout_constraintTop_toBottomOf="@id/type"
+ app:layout_constraintBottom_toBottomOf="@id/type_image"
+ tools:text="FILE_NAME" />
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:textColor="?android:attr/textColor"
- android:textSize="18sp"
- app:layout_constraintStart_toEndOf="@id/type_image"
- app:layout_constraintTop_toBottomOf="@id/type"
- tools:text="FILE_NAME" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/child_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="18sp"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/folder_indicator"
+ android:layout_marginEnd="12dp"
+ tools:text="12" />
- </androidx.constraintlayout.widget.ConstraintLayout>
+ <androidx.appcompat.widget.AppCompatImageView
+ android:id="@+id/folder_indicator"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ android:src="@drawable/ic_keyboard_arrow_right_24dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent" />
-</com.zeapo.pwdstore.widget.MultiselectableLinearLayout> \ No newline at end of file
+</com.zeapo.pwdstore.widget.MultiselectableConstraintLayout>