From a185750bb7a7cda861714f446cd9288fb4d1cd09 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Wed, 9 Jan 2013 20:39:05 -0800 Subject: [PATCH] Preserve ConversationList scroll state in between onPause/onResume. --- .../securesms/ConversationListFragment.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationListFragment.java b/src/org/thoughtcrime/securesms/ConversationListFragment.java index 47a3061750..cbb81ebe46 100644 --- a/src/org/thoughtcrime/securesms/ConversationListFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationListFragment.java @@ -73,8 +73,8 @@ public class ConversationListFragment extends SherlockListFragment @Override public void onAttach(Activity activity) { - super.onAttach(activity); - this.listener = (ConversationSelectedListener)activity; + super.onAttach(activity); + this.listener = (ConversationSelectedListener)activity; } @Override @@ -100,12 +100,14 @@ public class ConversationListFragment extends SherlockListFragment } public void setMasterSecret(MasterSecret masterSecret) { - this.masterSecret = masterSecret; - initializeListAdapter(); + if (this.masterSecret != masterSecret) { + this.masterSecret = masterSecret; + initializeListAdapter(); + } } @SuppressLint({ "NewApi", "NewApi" }) -private void initializeSearch(android.widget.SearchView searchView) { + private void initializeSearch(android.widget.SearchView searchView) { searchView.setOnQueryTextListener(new android.widget.SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) {