mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Redirection to library fragment after sync
This commit is contained in:
parent
3286215462
commit
3bdfd66dfc
3 changed files with 17 additions and 15 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,20 +99,17 @@ 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) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
builder.setMessage("Force reload your entire music library")
|
||||
.setTitle("Force sync")
|
||||
.setNegativeButton(R.string.ignore, null)
|
||||
.setPositiveButton("Sync", (dialog, id) -> {
|
||||
PreferenceUtil.getInstance(requireContext()).setSync(false);
|
||||
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(false);
|
||||
activity.goToSync();
|
||||
})
|
||||
.show();
|
||||
}
|
||||
bind.syncMusicButton.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
builder.setMessage("Force reload your entire music library")
|
||||
.setTitle("Force sync")
|
||||
.setNegativeButton(R.string.ignore, null)
|
||||
.setPositiveButton("Sync", (dialog, id) -> {
|
||||
PreferenceUtil.getInstance(requireContext()).setSync(false);
|
||||
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(false);
|
||||
activity.goToSync();
|
||||
})
|
||||
.show();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue