mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Remove item animations on conversation list recyclerview
// FREEBIE
This commit is contained in:
parent
eddb97013a
commit
4112f23f33
@ -52,6 +52,7 @@ import android.view.View.OnClickListener;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.ConversationListAdapter.ItemClickListener;
|
import org.thoughtcrime.securesms.ConversationListAdapter.ItemClickListener;
|
||||||
|
import org.thoughtcrime.securesms.components.recyclerview.DeleteItemAnimator;
|
||||||
import org.thoughtcrime.securesms.components.reminder.DefaultSmsReminder;
|
import org.thoughtcrime.securesms.components.reminder.DefaultSmsReminder;
|
||||||
import org.thoughtcrime.securesms.components.reminder.ExpiredBuildReminder;
|
import org.thoughtcrime.securesms.components.reminder.ExpiredBuildReminder;
|
||||||
import org.thoughtcrime.securesms.components.reminder.OutdatedBuildReminder;
|
import org.thoughtcrime.securesms.components.reminder.OutdatedBuildReminder;
|
||||||
@ -63,11 +64,8 @@ import org.thoughtcrime.securesms.components.reminder.ShareReminder;
|
|||||||
import org.thoughtcrime.securesms.components.reminder.SystemSmsImportReminder;
|
import org.thoughtcrime.securesms.components.reminder.SystemSmsImportReminder;
|
||||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||||
import org.thoughtcrime.securesms.database.MessagingDatabase;
|
|
||||||
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
||||||
import org.thoughtcrime.securesms.database.MessagingDatabase.SyncMessageId;
|
|
||||||
import org.thoughtcrime.securesms.database.loaders.ConversationListLoader;
|
import org.thoughtcrime.securesms.database.loaders.ConversationListLoader;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceReadUpdateJob;
|
|
||||||
import org.thoughtcrime.securesms.notifications.MarkReadReceiver;
|
import org.thoughtcrime.securesms.notifications.MarkReadReceiver;
|
||||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||||
@ -125,6 +123,7 @@ public class ConversationListFragment extends Fragment
|
|||||||
|
|
||||||
list.setHasFixedSize(true);
|
list.setHasFixedSize(true);
|
||||||
list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
list.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
list.setItemAnimator(new DeleteItemAnimator());
|
||||||
|
|
||||||
new ItemTouchHelper(new ArchiveListenerCallback()).attachToRecyclerView(list);
|
new ItemTouchHelper(new ArchiveListenerCallback()).attachToRecyclerView(list);
|
||||||
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package org.thoughtcrime.securesms.components.recyclerview;
|
||||||
|
|
||||||
|
|
||||||
|
import android.support.v7.widget.DefaultItemAnimator;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
|
||||||
|
public class DeleteItemAnimator extends DefaultItemAnimator {
|
||||||
|
|
||||||
|
public DeleteItemAnimator() {
|
||||||
|
setSupportsChangeAnimations(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean animateAdd(RecyclerView.ViewHolder viewHolder) {
|
||||||
|
dispatchAddFinished(viewHolder);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean animateMove(RecyclerView.ViewHolder viewHolder, int fromX, int fromY, int toX, int toY) {
|
||||||
|
dispatchMoveFinished(viewHolder);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user