diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2018-04-25 13:34:54 +0200 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2018-04-25 13:34:54 +0200 |
commit | 4de306375a33b2abd067e65658a46d45cba5e56e (patch) | |
tree | 00a734df4dcd1d94d0916eee6a6cc1cd98aafa7d /app/src/main/res | |
parent | 3812f6ccf9d5796f25f81aeea942c25b58296d01 (diff) |
Added Firebase authentication
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_login.xml | 98 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_new_observation.xml | 192 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_reset_password.xml | 92 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_signup.xml | 103 | ||||
-rw-r--r-- | app/src/main/res/menu/activity_main_drawer.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values/colors.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 31 |
8 files changed, 446 insertions, 89 deletions
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..160803c --- /dev/null +++ b/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true" + tools:context="org.marcinzelent.liberavem.LoginActivity"> + + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@color/colorPrimary" + android:gravity="center" + android:orientation="vertical" + android:padding="@dimen/activity_horizontal_margin"> + + + <ImageView + android:layout_width="@dimen/logo_w_h" + android:layout_height="@dimen/logo_w_h" + android:layout_gravity="center_horizontal" + android:layout_marginBottom="30dp" + android:src="@mipmap/ic_launcher" /> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/email" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:hint="@string/hint_email" + android:inputType="textEmailAddress" + android:textColor="@android:color/white" + android:textColorHint="@android:color/white" /> + </android.support.design.widget.TextInputLayout> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/password" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:hint="@string/hint_password" + android:inputType="textPassword" + android:textColor="@android:color/white" + android:textColorHint="@android:color/white" /> + </android.support.design.widget.TextInputLayout> + + <!-- Login Button --> + + <Button + android:id="@+id/btn_login" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:background="@color/colorAccent" + android:text="@string/btn_login" + android:textColor="@android:color/black" /> + + <Button + android:id="@+id/btn_reset_password" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:background="@null" + android:text="@string/btn_forgot_password" + android:textAllCaps="false" + android:textColor="@color/colorAccent" /> + + <!-- Link to Login Screen --> + + <Button + android:id="@+id/btn_signup" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:background="@null" + android:text="@string/btn_link_to_register" + android:textAllCaps="false" + android:textColor="@color/white" + android:textSize="15dp" /> + </LinearLayout> + + <ProgressBar + android:id="@+id/progressBar" + android:layout_width="30dp" + android:layout_height="30dp" + android:layout_gravity="center|bottom" + android:layout_marginBottom="20dp" + android:visibility="gone" /> +</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_new_observation.xml b/app/src/main/res/layout/activity_new_observation.xml index 0f3b10f..76e80f8 100644 --- a/app/src/main/res/layout/activity_new_observation.xml +++ b/app/src/main/res/layout/activity_new_observation.xml @@ -6,106 +6,120 @@ android:layout_height="match_parent" tools:context=".NewObservationActivity"> - <Spinner - android:id="@+id/new_birds" + <ScrollView android:layout_width="match_parent" android:layout_height="0dp" - android:layout_marginEnd="16dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginStart="16dp" - android:layout_marginTop="16dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintBottom_toTopOf="@+id/linearLayout" + app:layout_constraintTop_toTopOf="parent"> - <EditText - android:id="@+id/new_population" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:ems="10" - android:hint="@string/population" - android:inputType="textPersonName" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/new_birds" /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> - <EditText - android:id="@+id/new_place" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:ems="10" - android:hint="@string/place" - android:inputType="textPersonName" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/new_population" /> + <Spinner + android:id="@+id/new_birds" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="16dp" + android:layout_marginTop="16dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <EditText - android:id="@+id/new_longitude" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:ems="10" - android:hint="@string/longitude" - android:inputType="textPersonName" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/new_place" /> + <EditText + android:id="@+id/new_population" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/population" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_birds" /> - <EditText - android:id="@+id/new_latitude" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:ems="10" - android:hint="@string/latitude" - android:inputType="textPersonName" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/new_longitude" /> + <EditText + android:id="@+id/new_place" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/place" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_population" /> - <EditText - android:id="@+id/new_comment" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:ems="10" - android:gravity="top" - android:hint="@string/comment" - android:inputType="textMultiLine" - app:layout_constraintBottom_toTopOf="@+id/linearLayout" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/new_latitude" /> + <EditText + android:id="@+id/new_latitude" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/latitude" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_longitude" /> + + <EditText + android:id="@+id/new_longitude" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:hint="@string/longitude" + android:inputType="textPersonName" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_place" /> + + <EditText + android:id="@+id/new_comment" + android:layout_width="match_parent" + android:layout_height="200dp" + android:layout_marginBottom="8dp" + android:layout_marginEnd="8dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:ems="10" + android:gravity="top" + android:hint="@string/comment" + android:inputType="textMultiLine" + app:layout_constraintBottom_toTopOf="@+id/linearLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/new_latitude" /> + + </LinearLayout> + </ScrollView> <LinearLayout android:id="@+id/linearLayout" style="?android:attr/buttonBarStyle" - android:layout_width="0dp" + android:layout_width="360dp" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:layout_marginEnd="8dp" diff --git a/app/src/main/res/layout/activity_reset_password.xml b/app/src/main/res/layout/activity_reset_password.xml new file mode 100644 index 0000000..d4cbff0 --- /dev/null +++ b/app/src/main/res/layout/activity_reset_password.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.design.widget.CoordinatorLayout 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:layout_gravity="center" + android:background="@color/colorPrimary" + android:fitsSystemWindows="true" + tools:context="org.marcinzelent.liberavem.LoginActivity"> + + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="30dp" + android:gravity="center" + android:orientation="vertical" + android:padding="@dimen/activity_horizontal_margin"> + + + <ImageView + android:layout_width="@dimen/logo_w_h" + android:layout_height="@dimen/logo_w_h" + android:layout_gravity="center_horizontal" + android:layout_marginBottom="10dp" + android:src="@mipmap/ic_launcher" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:padding="10dp" + android:text="@string/lbl_forgot_password" + android:textColor="@android:color/white" + android:textSize="20dp" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:gravity="center_horizontal" + android:padding="@dimen/activity_horizontal_margin" + android:text="@string/forgot_password_msg" + android:textColor="@android:color/white" + android:textSize="14dp" /> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/email" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:layout_marginTop="20dp" + android:hint="@string/hint_email" + android:inputType="textEmailAddress" + android:textColor="@android:color/white" + android:textColorHint="@android:color/white" /> + </android.support.design.widget.TextInputLayout> + + <!-- Login Button --> + + <Button + android:id="@+id/btn_reset_password" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:background="@color/colorAccent" + android:text="@string/btn_reset_password" + android:textColor="@android:color/black" /> + + <Button + android:id="@+id/btn_back" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + android:background="@null" + android:text="@string/btn_back" + android:textColor="@color/colorAccent" /> + + </LinearLayout> + + <ProgressBar + android:id="@+id/progressBar" + android:layout_width="30dp" + android:layout_height="30dp" + android:layout_gravity="center|bottom" + android:layout_marginBottom="20dp" + android:visibility="gone" /> +</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_signup.xml b/app/src/main/res/layout/activity_signup.xml new file mode 100644 index 0000000..2d4d966 --- /dev/null +++ b/app/src/main/res/layout/activity_signup.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true" + tools:context="org.marcinzelent.liberavem.LoginActivity"> + + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@color/colorPrimaryDark" + android:gravity="center" + android:orientation="vertical" + android:padding="@dimen/activity_horizontal_margin"> + + + <ImageView + android:layout_width="@dimen/logo_w_h" + android:layout_height="@dimen/logo_w_h" + android:layout_gravity="center_horizontal" + android:layout_marginBottom="30dp" + android:src="@mipmap/ic_launcher" /> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/email" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/email" + android:inputType="textEmailAddress" + android:maxLines="1" + android:singleLine="true" + android:textColor="@android:color/white" /> + + </android.support.design.widget.TextInputLayout> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <EditText + android:id="@+id/password" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:focusableInTouchMode="true" + android:hint="@string/hint_password" + android:imeActionId="@+id/login" + android:imeOptions="actionUnspecified" + android:inputType="textPassword" + android:maxLines="1" + android:singleLine="true" + android:textColor="@android:color/white" /> + + </android.support.design.widget.TextInputLayout> + + <Button + android:id="@+id/sign_up_button" + style="?android:textAppearanceSmall" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:background="@color/colorAccent" + android:text="@string/action_sign_in_short" + android:textColor="@android:color/black" + android:textStyle="bold" /> + + <Button + android:id="@+id/btn_reset_password" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:background="@null" + android:text="@string/btn_forgot_password" + android:textAllCaps="false" + android:textColor="@color/colorAccent" /> + + <!-- Link to Login Screen --> + + <Button + android:id="@+id/sign_in_button" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dip" + android:background="@null" + android:text="@string/btn_link_to_login" + android:textAllCaps="false" + android:textColor="@color/white" + android:textSize="15dp" /> + </LinearLayout> + + <ProgressBar + android:id="@+id/progressBar" + android:layout_width="30dp" + android:layout_height="30dp" + android:layout_gravity="center|bottom" + android:layout_marginBottom="20dp" + android:visibility="gone" /> +</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml index c6e5d7f..208efd6 100644 --- a/app/src/main/res/menu/activity_main_drawer.xml +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -20,6 +20,10 @@ android:id="@+id/nav_about" android:icon="@android:drawable/ic_menu_info_details" android:title="@string/about" /> + <item + android:id="@+id/nav_signout" + android:icon="@android:drawable/ic_menu_view" + android:title="@string/sign_out" /> </group> </menu> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 3ab3e9c..a3b6a98 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,4 +3,18 @@ <color name="colorPrimary">#3F51B5</color> <color name="colorPrimaryDark">#303F9F</color> <color name="colorAccent">#FF4081</color> + + <color name="bg_login">#26ae90</color> + <color name="bg_register">#2e3237</color> + <color name="bg_main">#428bca</color> + <color name="white">#ffffff</color> + <color name="input_login">#222222</color> + <color name="input_login_hint">#999999</color> + <color name="input_register">#888888</color> + <color name="input_register_bg">#3b4148</color> + <color name="input_register_hint">#5e6266</color> + <color name="btn_login">#26ae90</color> + <color name="btn_login_bg">#eceef1</color> + <color name="lbl_name">#333333</color> + <color name="btn_logut_bg">#ff6861</color> </resources> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 4ab4520..f3fc089 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -5,4 +5,5 @@ <dimen name="nav_header_vertical_spacing">8dp</dimen> <dimen name="nav_header_height">176dp</dimen> <dimen name="fab_margin">16dp</dimen> + <dimen name="logo_w_h">100dp</dimen> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4885413..15effa3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -103,4 +103,35 @@ <string name="cancel">Cancel</string> <string name="add">Add</string> <string name="observation_details">Observation details</string> + + <!-- Strings related to login --> + <string name="action_sign_in_short">Register</string> + <string name="email">Email</string> + <string name="minimum_password">Password too short, enter minimum 6 characters!</string> + <string name="auth_failed">Authentication failed, check your email and password or sign up</string> + <string name="change_email">Change Email</string> + <string name="change_password">Change Password</string> + <string name="send_password_reset_email">Send Password reset email</string> + <string name="remove_user">Remove user</string> + <string name="new_pass">New Password</string> + <string name="title_activity_profile">Firebase</string> + <string name="title_activity_login">Sign in</string> + <string name="hint_email">Email</string> + <string name="hint_password">Password</string> + <string name="hint_name">Fullname</string> + <string name="btn_login">LOGIN</string> + <string name="btn_link_to_register">Not a member? Get registered in Firebase now!</string> + <string name="btn_link_to_login">Already registered. Login Me!</string> + <string name="title_activity_reset_password">ResetPasswordActivity</string> + <string name="btn_forgot_password">Forgot your password?</string> + <string name="btn_reset_password">Reset Password</string> + <string name="btn_back"><![CDATA[<< Back]]></string> + <string name="hint_new_email">New Email</string> + <string name="btn_change">Change</string> + <string name="btn_send">Send</string> + <string name="btn_remove">Remove</string> + <string name="btn_sign_out">Sign Out</string> + <string name="lbl_forgot_password">Forgot password?</string> + <string name="forgot_password_msg">We just need your registered Email Id to sent you password reset instructions.</string> + <string name="sign_out">Sign out</string> </resources> |