Skip to content

Commit 6cf56dc

Browse files
authored
Beautified the login page (#104)
1 parent 2c3ecd8 commit 6cf56dc

File tree

3 files changed

+73
-24
lines changed

3 files changed

+73
-24
lines changed

Pathways/app/src/main/java/com/example/pathways/LoginActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public void onCreate(Bundle savedInstanceState) {
7474
_progressBar = new ProgressBar(this);
7575
auth = FirebaseAuth.getInstance();
7676

77+
getSupportActionBar().hide();
78+
79+
7780
_submitButton.setOnClickListener(new View.OnClickListener() {
7881
@Override
7982
public void onClick(View view) {
@@ -117,8 +120,8 @@ public void onComplete(@NonNull Task<AuthResult> task) {
117120
//updateUI(user);
118121
} else {
119122
// If sign in fails, display a message to the user.
120-
Log.w(TAG, "createUserWithEmail:failure", task.getException());
121-
Toast.makeText(LoginActivity.this, "Authentication failed.",
123+
Log.w(TAG, "createUserWithEmail:failure" + task.getException().getMessage());
124+
Toast.makeText(LoginActivity.this, "Registration failed: " + task.getException().getMessage(),
122125
Toast.LENGTH_LONG).show();
123126
//updateUI(null);
124127
}
237 KB
Loading
Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,46 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
5-
xmlns:app="http://schemas.android.com/apk/res-auto">
6-
<LinearLayout
7-
android:orientation="vertical"
8-
android:gravity="center"
6+
android:background="@drawable/horizon"
7+
>
8+
9+
<androidx.constraintlayout.widget.Guideline
10+
android:id="@+id/guideline"
11+
android:layout_width="wrap_content"
12+
android:orientation="horizontal"
913
android:layout_height="wrap_content"
14+
app:layout_constraintGuide_percent="0.27" />
15+
16+
<LinearLayout
1017
android:layout_width="match_parent"
11-
app:layout_constraintBottom_toBottomOf="parent"
12-
app:layout_constraintTop_toTopOf="parent"
18+
android:layout_height="wrap_content"
19+
android:layout_marginLeft="20dp"
20+
android:layout_marginRight="20dp"
21+
android:gravity="center"
22+
android:orientation="vertical"
23+
app:layout_constraintLeft_toLeftOf="parent"
1324
app:layout_constraintRight_toRightOf="parent"
14-
app:layout_constraintLeft_toLeftOf="parent">
25+
app:layout_constraintTop_toBottomOf="@id/guideline">
26+
27+
<TextView
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:text="Pathways"
31+
android:fontFamily="futura"
32+
android:textColor="@color/quantum_white_text"
33+
android:textSize="48sp"
34+
/>
35+
36+
<TextView
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:fontFamily="futura"
40+
android:textColor="@color/quantum_white_text"
41+
android:text="Discovering New Horizons"
42+
android:textSize="18sp"
43+
/>
1544

1645
<EditText
1746
android:id="@+id/email"
@@ -22,26 +51,43 @@
2251
android:inputType="text" />
2352

2453
<EditText
54+
android:id="@+id/password"
2555
android:layout_width="match_parent"
2656
android:layout_height="wrap_content"
27-
android:id="@+id/password"
28-
android:inputType="textPassword"
29-
android:hint="Password"
3057
android:layout_weight=".1"
31-
/>
58+
android:hint="Password"
59+
android:inputType="textPassword" />
3260

33-
<Button
34-
android:id="@+id/submit_button"
35-
android:layout_width="match_parent"
36-
android:layout_height="wrap_content"
37-
android:text="Submit"
38-
android:layout_weight=".1"/>
39-
<Button
40-
android:id="@+id/register_button"
61+
<LinearLayout
62+
android:orientation="horizontal"
4163
android:layout_width="match_parent"
42-
android:layout_height="wrap_content"
43-
android:text="Register"
44-
android:layout_weight=".1"/>
64+
android:layout_height="wrap_content">
65+
66+
<com.google.android.material.button.MaterialButton
67+
android:id="@+id/register_button"
68+
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
69+
android:textColor="@color/quantum_white_text"
70+
android:layout_width="match_parent"
71+
android:layout_height="wrap_content"
72+
android:theme="@style/Theme.MaterialComponents"
73+
app:strokeColor="@color/quantum_white_text"
74+
app:strokeWidth="1dp"
75+
android:layout_weight=".1"
76+
android:text="Register" />
77+
78+
<com.google.android.material.button.MaterialButton
79+
android:layout_marginLeft="5dp"
80+
android:id="@+id/submit_button"
81+
android:textColor="@color/quantum_white_text"
82+
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
83+
android:layout_width="match_parent"
84+
android:layout_height="wrap_content"
85+
android:theme="@style/Theme.MaterialComponents"
86+
android:layout_weight=".1"
87+
app:strokeColor="@color/quantum_white_text"
88+
app:strokeWidth="1dp"
89+
android:text="Submit" />
4590

91+
</LinearLayout>
4692
</LinearLayout>
4793
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)