From c25b7fae47cccc02ef9aac6a36f8fa3b275396c6 Mon Sep 17 00:00:00 2001 From: Caden Date: Thu, 22 Feb 2018 16:34:03 -0500 Subject: [PATCH] Release Version 1.05 - Updated navigation drawer - Updated email and password validation --- README.md | 8 + app/.idea/workspace.xml | 640 ++++++++---------- app/build.gradle | 14 +- app/src/main/AndroidManifest.xml | 3 +- .../caden/drawingtest/DrawingActivity.java | 58 +- .../caden/drawingtest/ImageManager.java | 4 +- .../caden/drawingtest/LoginActivity.java | 16 +- .../drawingtest/RegistrationActivity.java | 42 +- .../com/example/caden/drawingtest/Util.java | 34 + app/src/main/res/layout/activity_drawing.xml | 3 +- app/src/main/res/layout/nav_header.xml | 1 + app/src/main/res/menu/nav_drawer_menu.xml | 12 +- 12 files changed, 431 insertions(+), 404 deletions(-) create mode 100644 app/src/main/java/com/example/caden/drawingtest/Util.java diff --git a/README.md b/README.md index 6ef65e5..8f6cf78 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,14 @@ Android drawing application for annotating the backbone of worms. ## Releases +### 1.05 (2018-02-22) +- More robust email validation +- Improved password fields +- Added basic navigation drawer to access user profile +- Google Sign-in now fully supported +- Added push notification support +- Firebase analytics + ### 1.04 (2018-01-24) - Added quick options to marking bad images rather than just a general comment box - Resolved an issue where an empty email or password login would lead to a crash diff --git a/app/.idea/workspace.xml b/app/.idea/workspace.xml index 623ba10..003776a 100644 --- a/app/.idea/workspace.xml +++ b/app/.idea/workspace.xml @@ -14,73 +14,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + - - + + + + + - - - - - + + + - - + + + + + - - + + - - - + + - - - + + + - - - - - + + + - - + + + + + - - - - - - - + + + - - + + - - - - - + + + - - - - + + + + + + + - - + + - - + + - - + + + + + - - + + + + + + + + + + + + + + + + + @@ -214,6 +177,9 @@ image signin log_out + firebas + login + google @@ -2099,32 +2065,34 @@ @@ -2148,33 +2116,30 @@ - - - - + - - - - - - + + @@ -2190,6 +2155,10 @@ @@ -2205,7 +2174,7 @@ - @@ -2250,17 +2219,29 @@ + + + + + - + + + + - @@ -2271,6 +2252,8 @@ + + - @@ -2650,7 +2611,7 @@ - + @@ -2660,6 +2621,7 @@ + @@ -2674,30 +2636,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2749,338 +2687,322 @@ - + - - + + - + - - + + + - + + - - + + - + - - - + + - + - - - - - - - - - - - - + + - + - - + + - + - - - + + - + - - - + + - - - + + + + + + + + + + + - - + + + + + + + + + + + + - - + + - + - - - + + - + - - - + + - - - - + - - - - - + + - + - - - + + - - - - + - - - + + - - - - + - - + + - - - - + - - + + - - - - + - - - - - + + - + - - - + + - + + + + - - + + - + + + + - - + + - + - - - + + + + + - + + + + - - + + - + - - + + - - - + - + - - + + - - - + - - + + - - - - - + + + - + + + + - - + + - - + + - - - - + + - + + - + - - - - - - - + + + - + - - + + - + + + + - - - - - - - + + + - - + + - - - - - + + + - + + + + + + - - - - - + + + diff --git a/app/build.gradle b/app/build.gradle index 5852a43..f3aacd5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { minSdkVersion 21 targetSdkVersion 26 versionCode 1 - versionName "1.04" + versionName "1.05" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -35,21 +35,23 @@ dependencies { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) + + compile 'com.android.support:appcompat-v7:26.1.0' + compile 'com.android.support.constraint:constraint-layout:1.0.2' + compile 'com.android.support:cardview-v7:26.1.0' + testCompile 'junit:junit:4.12' + implementation 'com.android.support:design:26.1.0' + compile 'com.google.firebase:firebase-storage:11.8.0' compile 'com.google.firebase:firebase-auth:11.8.0' compile 'com.google.android.gms:play-services-auth:11.8.0' compile 'com.google.firebase:firebase-messaging:11.8.0' compile 'com.google.firebase:firebase-database:11.8.0' compile 'com.google.firebase:firebase-perf:11.8.0' - compile 'com.android.support:appcompat-v7:26.1.0' - compile 'com.android.support.constraint:constraint-layout:1.0.2' - compile 'com.android.support:cardview-v7:26.1.0' compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') { transitive = true } compile 'com.google.firebase:firebase-core:11.8.0' - testCompile 'junit:junit:4.12' - implementation 'com.android.support:design:26.1.0' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c20caaf..64f56b6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -38,6 +38,7 @@ + - - { - if (task.isSuccessful()) { - // Sign in success, update UI with the signed-in user's information - transition(); - } else { - // If sign in fails, display a message to the user. - Snackbar sd = Snackbar.make(v, - String.format("\uD83D\uDE21\uD83D\uDE21\uD83D\uDE21 %s", - task.getException().getMessage()), Snackbar.LENGTH_LONG); - sd.show(); - } - }); - + /* Email & Password Validation */ + if (email.equals("")) { + txt_email.setError("Email cannot be empty"); + txt_email.requestFocus(); + } else if (password.equals("")) { + txt_psw.setError("Password cannot be empty"); + txt_psw.requestFocus(); + } else if (!Util.isPasswordValid(password)) { + txt_psw.setError("Password cannot be less than 8 characters"); + txt_psw.requestFocus(); + } else if (!Util.isEmailValid(email)) { + txt_email.setError("Email format is not valid"); + txt_email.requestFocus(); + } else { + mAuth.createUserWithEmailAndPassword(email, password) + .addOnCompleteListener(this, task -> { + if (task.isSuccessful()) { + // Sign in success, update UI with the signed-in user's information + transition(); + } else { + // If sign in fails, display a message to the user. + Snackbar sd = Snackbar.make(v, + String.format("\uD83D\uDE21\uD83D\uDE21\uD83D\uDE21 %s", + task.getException().getMessage()), Snackbar.LENGTH_LONG); + sd.show(); + } + }); + } } private void transition() { diff --git a/app/src/main/java/com/example/caden/drawingtest/Util.java b/app/src/main/java/com/example/caden/drawingtest/Util.java new file mode 100644 index 0000000..ee86134 --- /dev/null +++ b/app/src/main/java/com/example/caden/drawingtest/Util.java @@ -0,0 +1,34 @@ +package com.example.caden.drawingtest; + +import java.util.regex.Pattern; + +/** + * Created by caden on 2/13/18. + */ + +class Util { + + private static final Pattern emailPtr = Pattern.compile("(?:(?:\\r\\n)?[ \\t])*(?:(?:(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*))*@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[ \\t])*))*|(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*)*\\<(?:(?:\\r\\n)?[ \\t])*(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>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[ \\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*))*)?;\\s*)"); + private static final Pattern passwordPtr = Pattern.compile("^.{8,}$"); + + /** + * RFC822 Compliant Email Validation + * + * @param s email string + * @return whether email is valid + */ + static boolean isEmailValid(String s) { + return emailPtr.matcher(s).matches(); + } + + /** + * Checks if password is at least 8 characters + * + * @param s password string + * @return whether password is valid + */ + static boolean isPasswordValid(String s) { + return passwordPtr.matcher(s).matches(); + } + +} diff --git a/app/src/main/res/layout/activity_drawing.xml b/app/src/main/res/layout/activity_drawing.xml index bfb5371..eee0a72 100644 --- a/app/src/main/res/layout/activity_drawing.xml +++ b/app/src/main/res/layout/activity_drawing.xml @@ -196,6 +196,7 @@ android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" - app:headerLayout="@layout/nav_header" /> + app:headerLayout="@layout/nav_header" + app:menu="@menu/nav_drawer_menu" /> \ No newline at end of file diff --git a/app/src/main/res/layout/nav_header.xml b/app/src/main/res/layout/nav_header.xml index ab8234d..83af92b 100644 --- a/app/src/main/res/layout/nav_header.xml +++ b/app/src/main/res/layout/nav_header.xml @@ -22,6 +22,7 @@ app:srcCompat="@mipmap/ic_launcher" /> - - + + + + + + + + \ No newline at end of file