Skip to content

Commit

Permalink
integrate fragments into navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboymalboro1884 committed May 28, 2024
1 parent 1e4c098 commit 99f4948
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
39 changes: 39 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "1069888063709",
"project_id": "gold-enterprise-413617",
"storage_bucket": "gold-enterprise-413617.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1069888063709:android:0edd47c70242cffda33334",
"android_client_info": {
"package_name": "ru.hse.goodtrip"
}
},
"oauth_client": [
{
"client_id": "1069888063709-kka7ibi7i6an8utq98a9jsqgpbhmfoji.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDI91sfo5mrEACBo5rtXyTDovTRGcdAMj0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1069888063709-kka7ibi7i6an8utq98a9jsqgpbhmfoji.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public void navigateToPostPageExternal(Trip trip) {
activity.getNavigationGraph().navigateToPostPage(trip);
}

public void navigateToAddFollowing() {
navController.navigate(R.id.navigation_add_following);
}

public void navigateToMyTrips() {
navController.navigate(R.id.navigation_my_trips);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
renderFollowing();
setButtonClickListeners();
}

private void setButtonClickListeners() {
binding.addFollowingButton.setOnClickListener(
v -> ((MainActivity) requireActivity()).getNavigationGraph().navigateToAddFollowing());
}

private void renderFollowing() {
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/layout/fragment_following.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
android:gravity="center"
android:orientation="vertical"
android:layout_height="wrap_content">
<Button
android:id="@+id/addFollowingButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button"
android:text="Find user"
/>

</LinearLayout>
</androidx.core.widget.NestedScrollView>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/navigation/profile_navigation_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
tools:layout="@layout/fragment_profile_following"
android:id="@+id/navigation_profile_following"
android:name="ru.hse.goodtrip.ui.profile.following.ProfileFollowingFragment" />
<fragment
tools:layout="@layout/fragment_add_following"
android:id="@+id/navigation_add_following"
android:name="ru.hse.goodtrip.ui.profile.following.AddFollowingFragment" />
<fragment
tools:layout="@layout/fragment_maps_following"
android:id="@+id/navigation_map_following"
Expand Down

0 comments on commit 99f4948

Please sign in to comment.