|
|
@ -360,6 +360,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
static final int REQUEST_PICK_CONTACT = 23;
|
|
|
|
static final int REQUEST_PICK_CONTACT = 23;
|
|
|
|
static final int REQUEST_BUTTONS = 24;
|
|
|
|
static final int REQUEST_BUTTONS = 24;
|
|
|
|
private static final int REQUEST_ASKED_RAW = 25;
|
|
|
|
private static final int REQUEST_ASKED_RAW = 25;
|
|
|
|
|
|
|
|
private static final int REQUEST_ALL_READ = 26;
|
|
|
|
|
|
|
|
|
|
|
|
static final String ACTION_STORE_RAW = BuildConfig.APPLICATION_ID + ".STORE_RAW";
|
|
|
|
static final String ACTION_STORE_RAW = BuildConfig.APPLICATION_ID + ".STORE_RAW";
|
|
|
|
static final String ACTION_DECRYPT = BuildConfig.APPLICATION_ID + ".DECRYPT";
|
|
|
|
static final String ACTION_DECRYPT = BuildConfig.APPLICATION_ID + ".DECRYPT";
|
|
|
@ -4482,11 +4483,25 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onMenuMarkAllRead() {
|
|
|
|
private void onMenuMarkAllRead() {
|
|
|
|
new AlertDialog.Builder(getContext())
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
.setTitle(R.string.title_mark_all_read)
|
|
|
|
boolean all_read_asked = prefs.getBoolean("all_read_asked", false);
|
|
|
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
if (all_read_asked) {
|
|
|
|
@Override
|
|
|
|
markAllRead();
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
|
|
|
args.putString("question", getString(R.string.title_mark_all_read));
|
|
|
|
|
|
|
|
args.putString("notagain", "all_read_asked");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FragmentDialogAsk ask = new FragmentDialogAsk();
|
|
|
|
|
|
|
|
ask.setArguments(args);
|
|
|
|
|
|
|
|
ask.setTargetFragment(FragmentMessages.this, REQUEST_ALL_READ);
|
|
|
|
|
|
|
|
ask.show(getParentFragmentManager(), "messages:allread");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void markAllRead() {
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
args.putString("type", type);
|
|
|
|
args.putString("type", type);
|
|
|
|
args.putLong("folder", folder);
|
|
|
|
args.putLong("folder", folder);
|
|
|
@ -4531,11 +4546,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.execute(FragmentMessages.this, args, "message:read");
|
|
|
|
}.execute(FragmentMessages.this, args, "messages:allread");
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.setNegativeButton(android.R.string.cancel, null)
|
|
|
|
|
|
|
|
.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onMenuSyncMore() {
|
|
|
|
private void onMenuSyncMore() {
|
|
|
@ -6047,6 +6058,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
if (resultCode == RESULT_OK)
|
|
|
|
if (resultCode == RESULT_OK)
|
|
|
|
_onActionRaw();
|
|
|
|
_onActionRaw();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REQUEST_ALL_READ:
|
|
|
|
|
|
|
|
if (requestCode == RESULT_OK)
|
|
|
|
|
|
|
|
markAllRead();
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
Log.e(ex);
|
|
|
|
Log.e(ex);
|
|
|
|