|
|
@ -789,24 +789,27 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
ibSeen.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibSeen.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View view) {
|
|
|
|
public void onClick(View view) {
|
|
|
|
boolean filter = prefs.getBoolean("filter_seen", true);
|
|
|
|
String name = getFilter("seen", type);
|
|
|
|
onMenuFilter("filter_seen", !filter);
|
|
|
|
boolean filter = prefs.getBoolean(name, true);
|
|
|
|
|
|
|
|
onMenuFilter(name, !filter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibUnflagged.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibUnflagged.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View view) {
|
|
|
|
public void onClick(View view) {
|
|
|
|
boolean filter = prefs.getBoolean("filter_unflagged", true);
|
|
|
|
String name = getFilter("unflagged", type);
|
|
|
|
onMenuFilter("filter_unflagged", !filter);
|
|
|
|
boolean filter = prefs.getBoolean(name, true);
|
|
|
|
|
|
|
|
onMenuFilter(name, !filter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibSnoozed.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibSnoozed.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View view) {
|
|
|
|
public void onClick(View view) {
|
|
|
|
boolean filter = prefs.getBoolean("filter_snoozed", true);
|
|
|
|
String name = getFilter("snoozed", type);
|
|
|
|
onMenuFilter("filter_snoozed", !filter);
|
|
|
|
boolean filter = prefs.getBoolean(name, true);
|
|
|
|
|
|
|
|
onMenuFilter(name, !filter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -4069,10 +4072,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
String sort = prefs.getString("sort", "time");
|
|
|
|
String sort = prefs.getString("sort", "time");
|
|
|
|
boolean ascending = prefs.getBoolean(
|
|
|
|
boolean ascending = prefs.getBoolean(
|
|
|
|
viewType == AdapterMessage.ViewType.THREAD ? "ascending_thread" : "ascending_list", false);
|
|
|
|
viewType == AdapterMessage.ViewType.THREAD ? "ascending_thread" : "ascending_list", false);
|
|
|
|
boolean filter_seen = prefs.getBoolean("filter_seen", false);
|
|
|
|
boolean filter_seen = prefs.getBoolean(getFilter("seen", type), false);
|
|
|
|
boolean filter_unflagged = prefs.getBoolean("filter_unflagged", false);
|
|
|
|
boolean filter_unflagged = prefs.getBoolean(getFilter("unflagged", type), false);
|
|
|
|
boolean filter_unknown = prefs.getBoolean("filter_unknown", false);
|
|
|
|
boolean filter_unknown = prefs.getBoolean(getFilter("unknown", type), false);
|
|
|
|
boolean filter_snoozed = prefs.getBoolean("filter_snoozed", true);
|
|
|
|
boolean filter_snoozed = prefs.getBoolean(getFilter("snoozed", type), true);
|
|
|
|
boolean filter_duplicates = prefs.getBoolean("filter_duplicates", true);
|
|
|
|
boolean filter_duplicates = prefs.getBoolean("filter_duplicates", true);
|
|
|
|
boolean language_detection = prefs.getBoolean("language_detection", false);
|
|
|
|
boolean language_detection = prefs.getBoolean("language_detection", false);
|
|
|
|
boolean compact = prefs.getBoolean("compact", false);
|
|
|
|
boolean compact = prefs.getBoolean("compact", false);
|
|
|
@ -4233,16 +4236,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
onMenuAscending(!item.isChecked());
|
|
|
|
onMenuAscending(!item.isChecked());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.id.menu_filter_seen) {
|
|
|
|
} else if (itemId == R.id.menu_filter_seen) {
|
|
|
|
onMenuFilter("filter_seen", !item.isChecked());
|
|
|
|
onMenuFilter(getFilter("seen", type), !item.isChecked());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.id.menu_filter_unflagged) {
|
|
|
|
} else if (itemId == R.id.menu_filter_unflagged) {
|
|
|
|
onMenuFilter("filter_unflagged", !item.isChecked());
|
|
|
|
onMenuFilter(getFilter("unflagged", type), !item.isChecked());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.id.menu_filter_unknown) {
|
|
|
|
} else if (itemId == R.id.menu_filter_unknown) {
|
|
|
|
onMenuFilter("filter_unknown", !item.isChecked());
|
|
|
|
onMenuFilter(getFilter("unknown", type), !item.isChecked());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.id.menu_filter_snoozed) {
|
|
|
|
} else if (itemId == R.id.menu_filter_snoozed) {
|
|
|
|
onMenuFilter("filter_snoozed", !item.isChecked());
|
|
|
|
onMenuFilter(getFilter("snoozed", type), !item.isChecked());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.id.menu_filter_duplicates) {
|
|
|
|
} else if (itemId == R.id.menu_filter_duplicates) {
|
|
|
|
onMenuFilterDuplicates(!item.isChecked());
|
|
|
|
onMenuFilterDuplicates(!item.isChecked());
|
|
|
@ -4513,9 +4516,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
long folder = args.getLong("folder");
|
|
|
|
long folder = args.getLong("folder");
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
boolean filter_unflagged = prefs.getBoolean("filter_unflagged", false);
|
|
|
|
boolean filter_unflagged = prefs.getBoolean(getFilter("unflagged", type), false);
|
|
|
|
boolean filter_unknown = prefs.getBoolean("filter_unknown", false);
|
|
|
|
boolean filter_unknown = prefs.getBoolean(getFilter("unknown", type), false);
|
|
|
|
boolean filter_snoozed = prefs.getBoolean("filter_snoozed", true);
|
|
|
|
boolean filter_snoozed = prefs.getBoolean(getFilter("snoozed", type), true);
|
|
|
|
boolean language_detection = prefs.getBoolean("language_detection", false);
|
|
|
|
boolean language_detection = prefs.getBoolean("language_detection", false);
|
|
|
|
String filter_language = prefs.getString("filter_language", null);
|
|
|
|
String filter_language = prefs.getString("filter_language", null);
|
|
|
|
|
|
|
|
|
|
|
@ -4809,9 +4812,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
boolean filter_seen = prefs.getBoolean("filter_seen", false);
|
|
|
|
boolean filter_seen = prefs.getBoolean(getFilter("seen", type), false);
|
|
|
|
boolean filter_unflagged = prefs.getBoolean("filter_unflagged", false);
|
|
|
|
boolean filter_unflagged = prefs.getBoolean(getFilter("unflagged", type), false);
|
|
|
|
boolean filter_unknown = prefs.getBoolean("filter_unknown", false);
|
|
|
|
boolean filter_unknown = prefs.getBoolean(getFilter("unknown", type), false);
|
|
|
|
boolean language_detection = prefs.getBoolean("language_detection", false);
|
|
|
|
boolean language_detection = prefs.getBoolean("language_detection", false);
|
|
|
|
String filter_language = prefs.getString("filter_language", null);
|
|
|
|
String filter_language = prefs.getString("filter_language", null);
|
|
|
|
boolean filter_active = (filter_seen || filter_unflagged || filter_unknown ||
|
|
|
|
boolean filter_active = (filter_seen || filter_unflagged || filter_unknown ||
|
|
|
@ -5543,6 +5546,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
return TextUtils.join(", ", displays);
|
|
|
|
return TextUtils.join(", ", displays);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static String getFilter(String name, String type) {
|
|
|
|
|
|
|
|
return "filter_" + (EntityFolder.isOutgoing(type) ? "out_" : "") + name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void lockMessage(long id) throws IOException {
|
|
|
|
private void lockMessage(long id) throws IOException {
|
|
|
|
Context context = getContext();
|
|
|
|
Context context = getContext();
|
|
|
|
if (context == null)
|
|
|
|
if (context == null)
|
|
|
|