Revert "Long press primary folders to reload"

This reverts commit 626eef1922.
This commit is contained in:
M66B 2018-12-01 10:26:18 +01:00
parent 675df46367
commit 148e057db0
1 changed files with 5 additions and 28 deletions

View File

@ -1159,7 +1159,7 @@ public class FragmentMessages extends FragmentEx {
menu.findItem(R.id.menu_search).setVisible(folder >= 0 && search == null);
menu.findItem(R.id.menu_sort_on).setVisible(TextUtils.isEmpty(search));
menu.findItem(R.id.menu_folders).setVisible(primary >= 0);
//menu.findItem(R.id.menu_folders).setIcon(connected ? R.drawable.baseline_folder_24 : R.drawable.baseline_folder_open_24);
menu.findItem(R.id.menu_folders).setIcon(connected ? R.drawable.baseline_folder_24 : R.drawable.baseline_folder_open_24);
menu.findItem(R.id.menu_move_sent).setVisible(outbox);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
@ -1171,30 +1171,6 @@ public class FragmentMessages extends FragmentEx {
else if ("starred".equals(sort))
menu.findItem(R.id.menu_sort_on_starred).setChecked(true);
ImageButton ibFolders = new ImageButton(getContext());
ibFolders.setImageResource(connected ? R.drawable.baseline_folder_24 : R.drawable.baseline_folder_open_24);
ibFolders.setColorFilter(Helper.resolveColor(getContext(), android.R.attr.textColorPrimary));
ibFolders.setBackground(null);
ibFolders.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onMenuFolders();
}
});
ibFolders.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
ServiceSynchronize.reload(getContext(), "folders");
return true;
}
});
MenuItem menuFolders = menu.findItem(R.id.menu_folders);
menuFolders.setActionView(ibFolders);
super.onPrepareOptionsMenu(menu);
}
@ -1216,9 +1192,10 @@ public class FragmentMessages extends FragmentEx {
loadMessages();
return true;
//case R.id.menu_folders:
// onMenuFolders();
// return true;
case R.id.menu_folders:
onMenuFolders();
loadMessages();
return true;
case R.id.menu_move_sent:
onMenuMoveSent();