Eliminate flicker when entering multiselect.
This commit is contained in:
parent
92e506b117
commit
2d0feca278
2 changed files with 8 additions and 6 deletions
|
@ -489,8 +489,10 @@ public class ConversationAdapter
|
|||
* Conversation search query updated. Allows rendering of text highlighting.
|
||||
*/
|
||||
void onSearchQueryUpdated(String query) {
|
||||
this.searchQuery = query;
|
||||
notifyDataSetChanged();
|
||||
if (!Objects.equals(query, this.searchQuery)) {
|
||||
this.searchQuery = query;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1365,7 +1365,7 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
|||
public void onItemClick(MultiselectPart item) {
|
||||
if (actionMode != null) {
|
||||
((ConversationAdapter) list.getAdapter()).toggleSelection(item);
|
||||
list.getAdapter().notifyDataSetChanged();
|
||||
list.invalidateItemDecorations();
|
||||
|
||||
if (getListAdapter().getSelectedItems().size() == 0) {
|
||||
actionMode.finish();
|
||||
|
@ -1405,7 +1405,7 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
|||
} else {
|
||||
clearFocusedItem();
|
||||
((ConversationAdapter) list.getAdapter()).toggleSelection(item);
|
||||
list.getAdapter().notifyDataSetChanged();
|
||||
list.invalidateItemDecorations();
|
||||
|
||||
actionMode = ((AppCompatActivity)getActivity()).startSupportActionMode(actionModeCallback);
|
||||
}
|
||||
|
@ -1740,7 +1740,7 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
|||
((ConversationAdapter) list.getAdapter()).toggleSelection(part);
|
||||
});
|
||||
|
||||
list.getAdapter().notifyDataSetChanged();
|
||||
list.invalidateItemDecorations();
|
||||
|
||||
actionMode = ((AppCompatActivity)getActivity()).startSupportActionMode(actionModeCallback);
|
||||
}
|
||||
|
@ -1884,7 +1884,7 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
|
|||
@Override
|
||||
public void onDestroyActionMode(ActionMode mode) {
|
||||
((ConversationAdapter)list.getAdapter()).clearSelection();
|
||||
list.getAdapter().notifyDataSetChanged();
|
||||
list.invalidateItemDecorations();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
WindowUtil.setStatusBarColor(requireActivity().getWindow(), statusBarColor);
|
||||
|
|
Loading…
Add table
Reference in a new issue