From a7100cfcec8904b835fe14b3ccd367c94faa2ccd Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 3 Oct 2015 22:04:31 -0700 Subject: Dismiss filter dialog on rotation. This simplifies addressing a number of rotation cases by eliminating them completely. Otherwise, we need to worry about updating references, such as having the right fragment or activity reference to be able to provide the correct parent view for the snackbar. This is particularly complicated in some cases in Dialer because we have a fragment => adapter => viewholder hierarchy to pass through. Bug: 24638328 Change-Id: Ic8a5d2c3ca35742f5bb0986d77ae3b8d5f44e4dd --- .../android/dialer/filterednumber/FilterNumberDialogFragment.java | 8 +++++++- src/com/android/dialer/list/BlockedListSearchAdapter.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/dialer/filterednumber/FilterNumberDialogFragment.java b/src/com/android/dialer/filterednumber/FilterNumberDialogFragment.java index 1b953875c..476fee49b 100644 --- a/src/com/android/dialer/filterednumber/FilterNumberDialogFragment.java +++ b/src/com/android/dialer/filterednumber/FilterNumberDialogFragment.java @@ -123,6 +123,12 @@ public class FilterNumberDialogFragment extends DialogFragment { return builder.create(); } + @Override + public void onDestroy() { + this.dismissAllowingStateLoss(); + super.onDestroy(); + } + private String getBlockedMessage(String displayNumber) { return getString(R.string.snackbar_number_blocked, displayNumber); } @@ -194,4 +200,4 @@ public class FilterNumberDialogFragment extends DialogFragment { } }, getArguments().getInt(ARG_BLOCK_ID)); } -} \ No newline at end of file +} diff --git a/src/com/android/dialer/list/BlockedListSearchAdapter.java b/src/com/android/dialer/list/BlockedListSearchAdapter.java index 7ae24e468..dbfbc8b40 100644 --- a/src/com/android/dialer/list/BlockedListSearchAdapter.java +++ b/src/com/android/dialer/list/BlockedListSearchAdapter.java @@ -86,4 +86,4 @@ public class BlockedListSearchAdapter extends RegularSearchListAdapter { mFilteredNumberAsyncQueryHandler.startBlockedQuery( onCheckListener, normalizedNumber, number, countryIso); } -} \ No newline at end of file +} -- cgit v1.2.3