Apply correct styles to account filter activities on tablets
We use dialtacts_theme_color defined in ContactsCommon to ensure that
both Contacts and Dialer work well.
In addition, ag/808228 checked the "Customize" filter on click to enable
Talkback. We may need to uncheck it when user presses "Cancel" on
CustomContactListFilterActivity, to avoid 2 filters being checked at the
same time. This error doesn't occur on phones, and occurs only on tablets.
Bug: 26439461
Bug: 25629359
Change-Id: Idc31eb1abd55fd2468c85a6671eb6317092d7017
diff --git a/src/com/android/contacts/common/list/AccountFilterActivity.java b/src/com/android/contacts/common/list/AccountFilterActivity.java
index 20be63b..966637b 100644
--- a/src/com/android/contacts/common/list/AccountFilterActivity.java
+++ b/src/com/android/contacts/common/list/AccountFilterActivity.java
@@ -63,6 +63,10 @@
private ContactListFilter mCurrentFilter;
+ private ContactListFilterView mCustomFilterView; // the "Customize" filter
+
+ private boolean mIsCustomFilterViewSelected;
+
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -170,6 +174,8 @@
final ContactListFilter filter = (ContactListFilter) view.getTag();
if (filter == null) return; // Just in case
if (filter.filterType == ContactListFilter.FILTER_TYPE_CUSTOM) {
+ mCustomFilterView = listFilterView;
+ mIsCustomFilterViewSelected = listFilterView.isChecked();
final Intent intent = new Intent(this,
CustomContactListFilterActivity.class);
listFilterView.setActivated(true);
@@ -190,6 +196,12 @@
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (resultCode == AppCompatActivity.RESULT_CANCELED && mCustomFilterView != null &&
+ !mIsCustomFilterViewSelected) {
+ mCustomFilterView.setActivated(false);
+ return;
+ }
+
if (resultCode != AppCompatActivity.RESULT_OK) {
return;
}
diff --git a/src/com/android/contacts/common/list/ContactListFilterView.java b/src/com/android/contacts/common/list/ContactListFilterView.java
index c6cc597..6df8e21 100644
--- a/src/com/android/contacts/common/list/ContactListFilterView.java
+++ b/src/com/android/contacts/common/list/ContactListFilterView.java
@@ -78,6 +78,10 @@
setContentDescription(generateContentDescription());
}
+ public boolean isChecked() {
+ return mRadioButton.isChecked();
+ }
+
public void bindView(AccountTypeManager accountTypes) {
if (mAccountType == null) {
mIcon = (ImageView) findViewById(R.id.icon);