Make sure swiped item will be moved back

pull/159/head
M66B 5 years ago
parent 3da3d14a92
commit c474d399e8

@ -1301,13 +1301,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) { public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
final TupleMessageEx message = getMessage(viewHolder); final TupleMessageEx message = getMessage(viewHolder);
if (message == null) { if (message == null) {
adapter.notifyItemChanged(viewHolder.getAdapterPosition()); adapter.notifyDataSetChanged();
return; return;
} }
TupleAccountSwipes swipes = accountSwipes.get(message.account); TupleAccountSwipes swipes = accountSwipes.get(message.account);
if (swipes == null) { if (swipes == null) {
adapter.notifyItemChanged(viewHolder.getAdapterPosition()); adapter.notifyDataSetChanged();
return; return;
} }
@ -1348,7 +1348,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
} }
private void swipeAsk(final @NonNull TupleMessageEx message, @NonNull RecyclerView.ViewHolder viewHolder) { private void swipeAsk(final @NonNull TupleMessageEx message, @NonNull RecyclerView.ViewHolder viewHolder) {
adapter.notifyItemChanged(viewHolder.getAdapterPosition()); adapter.notifyDataSetChanged();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), viewHolder.itemView); PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), viewHolder.itemView);
popupMenu.setGravity(Gravity.RIGHT); popupMenu.setGravity(Gravity.RIGHT);

Loading…
Cancel
Save