Commit 3acf9530 authored by Willard's avatar Willard

Fix Login working even if form has error, add separate register button

parent f2414842
...@@ -2,7 +2,7 @@ apply plugin: 'com.android.application' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 23 compileSdkVersion 23
buildToolsVersion "23.0.3" buildToolsVersion "24.0.3"
defaultConfig { defaultConfig {
applicationId "com.testapp" applicationId "com.testapp"
minSdkVersion 15 minSdkVersion 15
......
...@@ -226,13 +226,12 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks< ...@@ -226,13 +226,12 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
showProgress(true); showProgress(true);
mAuthTask = new UserLoginTask(username, password); mAuthTask = new UserLoginTask(username, password);
mAuthTask.execute((Void) null); mAuthTask.execute((Void) null);
}
Intent intent = new Intent(this, NavDrawerActivity.class); Intent intent = new Intent(this, NavDrawerActivity.class);
intent.putExtra(EXTRA_MESSAGE, "Signed in successfully"); intent.putExtra(EXTRA_MESSAGE, "Signed in successfully");
startActivity(intent); startActivity(intent);
} }
}
private boolean isEmailValid(String email) { private boolean isEmailValid(String email) {
//TODO: Replace this with your own logic //TODO: Replace this with your own logic
......
...@@ -74,37 +74,24 @@ ...@@ -74,37 +74,24 @@
<Button <Button
android:id="@+id/email_sign_in_button" android:id="@+id/email_sign_in_button"
style="?android:textAppearanceSmall"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/action_sign_in" android:text="@string/action_sign_in"/>
android:textStyle="bold" />
<Button <Button
android:id="@+id/use_as_guest_button" android:id="@+id/register_button"
style="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_guest"
android:textStyle="bold" />
<Button
android:text="sample dish"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary" android:text="@string/action_guest"/>
android:layout_marginTop="16dp"
android:id="@+id/sample_dish" />
<Button <Button
android:text="Sample Stall" android:id="@+id/use_as_guest_button"
style="@android:style/Widget.Material.Light.Button.Borderless"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/sample_stall" android:text="@string/action_register"
android:textColor="?android:attr/textColorSecondary" android:elevation="0dp"/>
android:layout_marginTop="16dp" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
......
...@@ -19,15 +19,6 @@ ...@@ -19,15 +19,6 @@
android:id="@+id/nav_type" android:id="@+id/nav_type"
android:title="@string/drawer_3" android:title="@string/drawer_3"
android:checkable="false" /> android:checkable="false" />
<item android:title="@string/drawer_3_1"
android:id="@+id/nav_type_main"
android:checkable="true" />
<item android:title="@string/drawer_3_2"
android:id="@+id/nav_type_drink"
android:checkable="true" />
<item android:title="@string/drawer_3_3"
android:id="@+id/nav_type_dessert"
android:checkable="true" />
<item <item
android:id="@+id/nav_pricerange" android:id="@+id/nav_pricerange"
...@@ -39,15 +30,6 @@ ...@@ -39,15 +30,6 @@
android:id="@+id/nav_locations" android:id="@+id/nav_locations"
android:title="@string/drawer_5" android:title="@string/drawer_5"
android:checkable="false" /> android:checkable="false" />
<item android:title="@string/drawer_5_3"
android:id="@+id/nav_locations_zekaf"
android:checkable="true" />
<item android:title="@string/drawer_5_1"
android:checkable="true"
android:id="@+id/nav_location_gonzaga" />
<item android:title="@string/drawer_5_2"
android:id="@+id/nav_location_JSEC"
android:checkable="true" />
</group> </group>
</menu> </menu>
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
<!-- Strings related to login --> <!-- Strings related to login -->
<string name="prompt_username">Username</string> <string name="prompt_username">Username</string>
<string name="prompt_password">Password</string> <string name="prompt_password">Password</string>
<string name="action_sign_in">Sign in or register</string> <string name="action_sign_in">Sign in</string>
<string name="action_sign_in_short">Sign in</string> <string name="action_sign_in_short">Sign in</string>
<string name="action_register">New User? Register Here</string>
<string name="error_invalid_email">This email address is invalid</string> <string name="error_invalid_email">This email address is invalid</string>
<string name="error_invalid_password">This password is too short</string> <string name="error_invalid_password">This password is too short</string>
<string name="error_incorrect_password">This password is incorrect</string> <string name="error_incorrect_password">This password is incorrect</string>
...@@ -17,14 +18,8 @@ ...@@ -17,14 +18,8 @@
<string name="drawer_1">All Items</string> <string name="drawer_1">All Items</string>
<string name="drawer_2">Filters</string> <string name="drawer_2">Filters</string>
<string name="drawer_3">Type</string> <string name="drawer_3">Type</string>
<string name="drawer_3_1"> Main Course</string>
<string name="drawer_3_2"> Drink</string>
<string name="drawer_3_3"> Dessert</string>
<string name="drawer_4">Price Range</string> <string name="drawer_4">Price Range</string>
<string name="drawer_5">Locations</string> <string name="drawer_5">Locations</string>
<string name="drawer_5_1"> Gonzaga</string>
<string name="drawer_5_2"> JSEC</string>
<string name="drawer_5_3"> Zekaf</string>
<string name="drawer_6">Cuisine</string> <string name="drawer_6">Cuisine</string>
<string name="hint_search">Search</string> <string name="hint_search">Search</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment