Refactoring

This commit is contained in:
M66B 2019-07-19 07:08:30 +02:00
parent e757446d5e
commit fa432a76d7
1 changed files with 12 additions and 8 deletions

View File

@ -410,16 +410,11 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.string.title_synchronize_now:
Bundle args = new Bundle();
args.putLong("folder", folder.id);
args.putBoolean("all", false);
Intent data = new Intent();
data.putExtra("args", args);
parentFragment.onActivityResult(FragmentFolders.REQUEST_SYNC, RESULT_OK, data);
onActionSync();
return true;
case R.string.title_synchronize_all:
onActionSynchronizeAll();
onActionSynAll();
return true;
case R.string.title_unified_folder:
@ -477,7 +472,16 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
}
}
private void onActionSynchronizeAll() {
private void onActionSync() {
Bundle args = new Bundle();
args.putLong("folder", folder.id);
args.putBoolean("all", false);
Intent data = new Intent();
data.putExtra("args", args);
parentFragment.onActivityResult(FragmentFolders.REQUEST_SYNC, RESULT_OK, data);
}
private void onActionSynAll() {
Bundle aargs = new Bundle();
aargs.putString("question",
context.getString(R.string.title_ask_sync_all, folder.getDisplayName(context)));