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'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.testapp"
minSdkVersion 15
......
......@@ -226,13 +226,12 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
showProgress(true);
mAuthTask = new UserLoginTask(username, password);
mAuthTask.execute((Void) null);
}
Intent intent = new Intent(this, NavDrawerActivity.class);
intent.putExtra(EXTRA_MESSAGE, "Signed in successfully");
startActivity(intent);
}
}
private boolean isEmailValid(String email) {
//TODO: Replace this with your own logic
......
......@@ -74,37 +74,24 @@
<Button
android:id="@+id/email_sign_in_button"
style="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_sign_in"
android:textStyle="bold" />
android:text="@string/action_sign_in"/>
<Button
android:id="@+id/use_as_guest_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:id="@+id/register_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginTop="16dp"
android:id="@+id/sample_dish" />
android:text="@string/action_guest"/>
<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_height="wrap_content"
android:id="@+id/sample_stall"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginTop="16dp" />
android:text="@string/action_register"
android:elevation="0dp"/>
</LinearLayout>
</ScrollView>
......
......@@ -19,15 +19,6 @@
android:id="@+id/nav_type"
android:title="@string/drawer_3"
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
android:id="@+id/nav_pricerange"
......@@ -39,15 +30,6 @@
android:id="@+id/nav_locations"
android:title="@string/drawer_5"
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>
</menu>
......@@ -4,8 +4,9 @@
<!-- Strings related to login -->
<string name="prompt_username">Username</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_register">New User? Register Here</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_incorrect_password">This password is incorrect</string>
......@@ -17,14 +18,8 @@
<string name="drawer_1">All Items</string>
<string name="drawer_2">Filters</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_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="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