Redirection to library fragment after sync

This commit is contained in:
CappielloAntonio 2021-04-14 17:37:24 +02:00
parent 3286215462
commit 3bdfd66dfc
3 changed files with 17 additions and 15 deletions

View file

@ -232,7 +232,7 @@ public class MainActivity extends BaseActivity {
if (Objects.requireNonNull(navController.getCurrentDestination()).getId() == R.id.landingFragment) {
navController.navigate(R.id.action_landingFragment_to_homeFragment);
} else if (Objects.requireNonNull(navController.getCurrentDestination()).getId() == R.id.syncFragment) {
navController.navigate(R.id.action_syncFragment_to_homeFragment);
navController.navigate(R.id.action_syncFragment_to_libraryFragment);
} else if (Objects.requireNonNull(navController.getCurrentDestination()).getId() == R.id.loginFragment) {
navController.navigate(R.id.action_loginFragment_to_homeFragment);
}

View file

@ -99,9 +99,7 @@ public class HomeFragment extends Fragment {
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
});
bind.syncMusicButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bind.syncMusicButton.setOnClickListener(v -> {
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
builder.setMessage("Force reload your entire music library")
.setTitle("Force sync")
@ -112,7 +110,6 @@ public class HomeFragment extends Fragment {
activity.goToSync();
})
.show();
}
});
}

View file

@ -54,6 +54,11 @@
app:destination="@id/homeFragment"
app:popUpTo="@id/syncFragment"
app:popUpToInclusive="true" />
<action
android:id="@+id/action_syncFragment_to_libraryFragment"
app:destination="@id/libraryFragment"
app:popUpTo="@id/syncFragment"
app:popUpToInclusive="true"/>
</fragment>
<fragment