Skip to content

Commit

Permalink
Eliminate item animations in ConversationFragment
Browse files Browse the repository at this point in the history
Experience feels faster this way too

// FREEBIE
  • Loading branch information
moxie0 committed Jan 8, 2017
1 parent d599c05 commit 5804213
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/org/thoughtcrime/securesms/ConversationFragment.java
Expand Up @@ -109,6 +109,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bu
list.setHasFixedSize(false);
list.setLayoutManager(layoutManager);
list.addOnScrollListener(scrollListener);
list.setItemAnimator(null);

loadMoreView = inflater.inflate(R.layout.load_more_header, container, false);
loadMoreView.setOnClickListener(new OnClickListener() {
Expand Down Expand Up @@ -171,7 +172,6 @@ private void initializeListAdapter() {
if (this.recipients != null && this.threadId != -1) {
list.setAdapter(new ConversationAdapter(getActivity(), masterSecret, locale, selectionClickListener, null, this.recipients));
getLoaderManager().restartLoader(0, Bundle.EMPTY, this);
list.getItemAnimator().setMoveDuration(120);
}
}

Expand Down Expand Up @@ -236,13 +236,7 @@ public void reload(Recipients recipients, long threadId) {
}

public void scrollToBottom() {
list.getItemAnimator().isRunning(new ItemAnimatorFinishedListener() {
@Override
public void onAnimationsFinished() {
list.stopScroll();
list.smoothScrollToPosition(0);
}
});
list.smoothScrollToPosition(0);
}

private void handleCopyMessage(final Set<MessageRecord> messageRecords) {
Expand Down

0 comments on commit 5804213

Please sign in to comment.