Changed navigation in nav_graph for albumPageFragment

This commit is contained in:
CappielloAntonio 2021-05-01 17:15:12 +02:00
parent 7d17916a5e
commit 26440c0e21
2 changed files with 10 additions and 3 deletions

View file

@ -138,7 +138,7 @@ public class AlbumPageFragment extends Fragment {
if(artist != null) {
Bundle bundle = new Bundle();
bundle.putParcelable("artist_object", artist);
activity.navController.navigate(R.id.artistPageFragment, bundle);
activity.navController.navigate(R.id.action_albumPageFragment_to_artistPageFragment, bundle);
}
else Toast.makeText(requireContext(), "Error retrieving artist", Toast.LENGTH_SHORT).show();
});
@ -147,7 +147,7 @@ public class AlbumPageFragment extends Fragment {
Bundle bundle = new Bundle();
bundle.putString(Song.BY_YEAR, Song.BY_YEAR);
bundle.putInt("year_object", albumPageViewModel.getAlbum().getYear());
activity.navController.navigate(R.id.songListPageFragment, bundle);
activity.navController.navigate(R.id.action_albumPageFragment_to_songListPageFragment, bundle);
});
}

View file

@ -204,7 +204,14 @@
android:id="@+id/albumPageFragment"
android:name="com.cappielloantonio.play.ui.fragment.AlbumPageFragment"
android:label="AlbumPageFragment"
tools:layout="@layout/fragment_album_page" />
tools:layout="@layout/fragment_album_page">
<action
android:id="@+id/action_albumPageFragment_to_artistPageFragment"
app:destination="@id/artistPageFragment" />
<action
android:id="@+id/action_albumPageFragment_to_songListPageFragment"
app:destination="@id/songListPageFragment" />
</fragment>
<fragment
android:id="@+id/songListPageFragment"
android:name="com.cappielloantonio.play.ui.fragment.SongListPageFragment"