Skip to content

Commit 2f58f53

Browse files
committed
Login menu added
1 parent e91642d commit 2f58f53

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/edu/sharif/homework1/SignupFragment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
4646
openSignupStudentFragment();
4747
}
4848
});
49+
50+
binding.loginButton.setOnClickListener(view1 -> {
51+
NavHostFragment.findNavController(SignupFragment.this)
52+
.navigate(SignupFragmentDirections.
53+
actionSignupFragmentToLoginFragment());
54+
});
4955
}
5056

5157
private boolean areFieldsValid(boolean isStudentClicked) {

app/src/main/res/layout/fragment_signup.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
tools:context=".SignupFragment">
88

99
<LinearLayout
10+
android:id="@+id/linearLayout3"
1011
android:layout_width="0dp"
1112
android:layout_height="wrap_content"
1213
android:gravity="center"
@@ -77,4 +78,17 @@
7778
</LinearLayout>
7879
</LinearLayout>
7980

81+
<Button
82+
android:id="@+id/loginButton"
83+
android:layout_width="wrap_content"
84+
android:layout_height="wrap_content"
85+
android:text="already have an account? log in"
86+
android:textSize="16sp"
87+
app:layout_constraintBottom_toBottomOf="parent"
88+
app:layout_constraintEnd_toEndOf="parent"
89+
app:layout_constraintHorizontal_bias="0.498"
90+
app:layout_constraintStart_toStartOf="parent"
91+
app:layout_constraintTop_toBottomOf="@+id/linearLayout3"
92+
app:layout_constraintVertical_bias="0.328" />
93+
8094
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/navigation/nav_graph.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<action
1717
android:id="@+id/action_signup_to_student"
1818
app:destination="@id/studentSignupFragment" />
19+
<action
20+
android:id="@+id/action_SignupFragment_to_loginFragment"
21+
app:destination="@id/loginFragment" />
1922
</fragment>
2023
<fragment
2124
android:id="@+id/studentSignupFragment"
@@ -213,4 +216,19 @@
213216
android:name="trainingName"
214217
app:argType="string" />
215218
</fragment>
219+
<fragment
220+
android:id="@+id/loginFragment"
221+
android:name="edu.sharif.homework1.LoginFragment"
222+
android:label="fragment_login"
223+
tools:layout="@layout/fragment_login" >
224+
<action
225+
android:id="@+id/action_loginFragment_to_SignupFragment"
226+
app:destination="@id/SignupFragment" />
227+
<action
228+
android:id="@+id/action_loginFragment_to_studentPanelFragment"
229+
app:destination="@id/studentPanelFragment" />
230+
<action
231+
android:id="@+id/action_loginFragment_to_professorPanelFragment"
232+
app:destination="@id/professorPanelFragment" />
233+
</fragment>
216234
</navigation>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<string name="training_name">training name</string>
3030
<string name="Create_Training">create training</string>
3131
<string name="Create_New_Training">create new training</string>
32+
<string name="login">login</string>
33+
<string name="UserName">username</string>
3234

3335

3436
</resources>

0 commit comments

Comments
 (0)