Skip to content

Commit

Permalink
Merge pull request #121 from Aditya-gupta99/main
Browse files Browse the repository at this point in the history
Improved Auth page
  • Loading branch information
hieuwu authored Oct 2, 2022
2 parents cc6bdb5 + 0e3b7e2 commit 088ac1d
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 99 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ android {
dependencies {
implementation "androidx.appcompat:appcompat:$appCompatVersion"

implementation 'com.google.android.material:material:1.6.1'

//Constraint and Coordinator layout
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$coordinatorLayoutVersion"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable-v24/ic_baseline_lock_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#53B175"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable-v24/ic_baseline_person_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#9f88e5"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_baseline_alternate_email_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#53B175"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10h5v-2h-5c-4.34,0 -8,-3.66 -8,-8s3.66,-8 8,-8 8,3.66 8,8v1.43c0,0.79 -0.71,1.57 -1.5,1.57s-1.5,-0.78 -1.5,-1.57L17,12c0,-2.76 -2.24,-5 -5,-5s-5,2.24 -5,5 2.24,5 5,5c1.38,0 2.64,-0.56 3.54,-1.47 0.65,0.89 1.77,1.47 2.96,1.47 1.97,0 3.5,-1.6 3.5,-3.57L22,12c0,-5.52 -4.48,-10 -10,-10zM12,15c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3z"/>
</vector>
50 changes: 49 additions & 1 deletion app/src/main/res/layout/fragment_sign_up.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>

<variable
Expand Down Expand Up @@ -40,19 +41,65 @@
android:textSize="@dimen/text_big_bold"
android:textStyle="bold" />

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7sp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:textColor="#53B175"
app:startIconDrawable="@drawable/ic_baseline_person_24"
android:textColorHint="#53B175"
app:boxStrokeColor="#53B175"
app:endIconMode="clear_text"
app:endIconTint="#53B175"
app:startIconTint="#53B175"
app:hintTextColor="#53B175"
>

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/name"
android:text="@={signUpViewModel.name}"/>
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7sp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:textColor="#53B175"
app:startIconDrawable="@drawable/ic_baseline_alternate_email_24"
android:textColorHint="#53B175"
app:boxStrokeColor="#53B175"
app:endIconMode="clear_text"
app:endIconTint="#53B175"
app:startIconTint="#53B175"
app:hintTextColor="#53B175"
>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/email"
android:text="@={signUpViewModel.email}"/>
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7sp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:textColor="#53B175"
android:textColorHint="#53B175"
app:startIconDrawable="@drawable/ic_baseline_lock_24"
app:endIconMode="password_toggle"
app:endIconTint="#53B175"
app:boxStrokeColor="#53B175"
app:startIconTint="#53B175"
app:hintTextColor="#53B175"
>

<EditText
android:layout_width="match_parent"
Expand All @@ -62,6 +109,7 @@
android:inputType="textPassword"
android:text="@={signUpViewModel.password}"/>

</com.google.android.material.textfield.TextInputLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
232 changes: 135 additions & 97 deletions app/src/main/res/layout/fragment_signin.xml
Original file line number Diff line number Diff line change
@@ -1,97 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<data>

<variable
name="signInViewModel"
type="com.hieuwu.groceriesstore.presentation.authentication.SignInViewModel" />
</data>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
tools:context=".presentation.authentication.SignInFragment">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/login_background"
android:fitsSystemWindows="true">

<LinearLayout
android:id="@+id/fullscreen_content_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/rounded_background"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingTop="32dp">

<TextView
android:id="@+id/singin_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/margin_medium"
android:fontFamily="monospace"
android:text="@string/sign_in"
android:textColor="@android:color/black"
android:textSize="26sp"
android:textStyle="bold" />

<EditText
android:id="@+id/email_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/email"
android:text="@={signInViewModel.email}"/>

<EditText
android:id="@+id/password_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/password"
android:inputType="textPassword"
android:text="@={signInViewModel.password}"/>

<Button
android:id="@+id/signin_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/margin_medium"
android:background="@drawable/primary_button"
android:text="@string/sign_in"
android:textAllCaps="false"
android:textColor="@android:color/white" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="150dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/don_t_have_an_account" />

<TextView
android:id="@+id/sign_up_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_small"
android:fontFamily="monospace"
android:text="@string/sign_up"
android:textColor="@color/primary_button"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

<data>

<variable
name="signInViewModel"
type="com.hieuwu.groceriesstore.presentation.authentication.SignInViewModel" />
</data>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
tools:context=".presentation.authentication.SignInFragment">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@drawable/login_background"
android:fitsSystemWindows="true">

<LinearLayout
android:id="@+id/fullscreen_content_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/rounded_background"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingTop="32dp">

<TextView
android:id="@+id/singin_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/margin_medium"
android:fontFamily="monospace"
android:text="@string/sign_in"
android:textColor="@android:color/black"
android:textSize="26sp"
android:textStyle="bold" />

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7sp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:textColor="#53B175"
app:startIconDrawable="@drawable/ic_baseline_alternate_email_24"
android:textColorHint="#53B175"
app:boxStrokeColor="#53B175"
app:endIconMode="clear_text"
app:endIconTint="#53B175"
app:startIconTint="#53B175"
app:hintTextColor="#53B175"
>

<EditText
android:id="@+id/email_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/email"
android:text="@={signInViewModel.email}"/>

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20sp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:textColor="#53B175"
android:textColorHint="#53B175"
app:startIconDrawable="@drawable/ic_baseline_lock_24"
app:endIconMode="password_toggle"
app:endIconTint="#53B175"
app:boxStrokeColor="#53B175"
app:startIconTint="#53B175"
app:hintTextColor="#53B175"
>


<EditText
android:id="@+id/password_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/password"
android:inputType="textPassword"
android:text="@={signInViewModel.password}"/>


</com.google.android.material.textfield.TextInputLayout>


<Button
android:id="@+id/signin_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/margin_medium"
android:background="@drawable/primary_button"
android:text="@string/sign_in"
android:textAllCaps="false"
android:textColor="@android:color/white" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="150dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/don_t_have_an_account" />

<TextView
android:id="@+id/sign_up_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_small"
android:fontFamily="monospace"
android:text="@string/sign_up"
android:textColor="@color/primary_button"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</layout>
5 changes: 4 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@

</style>

<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="SplashTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:windowBackground">@drawable/splash_image</item>
</style>

Expand Down

0 comments on commit 088ac1d

Please sign in to comment.