Fixed collapsing messages

pull/147/head
M66B 7 years ago
parent 4e8a12d900
commit 646e0a8fcd

@ -2478,14 +2478,14 @@ public class FragmentMessages extends FragmentBase {
return true; return true;
} }
if (values.containsKey("expanded")) { int count = (values.containsKey("expanded") ? values.get("expanded").size() : 0);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
if (values.get("expanded").size() > 1 || prefs.getBoolean("collapse", false)) { boolean collapse = prefs.getBoolean("collapse", false);
if ((count == 1 && collapse) || count > 1) {
values.get("expanded").clear(); values.get("expanded").clear();
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
return true; return true;
} }
}
return false; return false;
} }

Loading…
Cancel
Save