Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 692cb6a2 authored by Daisuke Miyakawa's avatar Daisuke Miyakawa
Browse files

Show all contacts on invalid contact selection

Happens when a contact is created but it isn't shown due to
contact fliter (e.g. the contact is for the account A while the
filter shows only contacts for the account B). Single contact
mode is just confusing in that case, so now let's show all contacts
and notify the change to the user.

Bug: 5031526
Change-Id: Ica75178d10b4a9b95c44cc4f75f56b65fbc67da8
parent 15caabb7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1757,4 +1757,8 @@

    <!-- String describing the text on the header of the profile contact in the contacts list [CHAR LIMIT=20] -->
    <string name="user_profile_contacts_list_header">ME</string>

    <!-- Toast shown when the app starts showing all contacts regardless of its current
         contact filter state. [CHAR LIMIT=64] -->
    <string name="toast_displaying_all_contacts">Displaying all contacts</string>
</resources>
+5 −12
Original line number Diff line number Diff line
@@ -1024,18 +1024,11 @@ public class PeopleActivity extends ContactsActivity

        @Override
        public void onInvalidSelection() {
            ContactListFilter filter;
            ContactListFilter currentFilter = mAllFragment.getFilter();
            if (currentFilter != null
                    && currentFilter.filterType == ContactListFilter.FILTER_TYPE_SINGLE_CONTACT) {
                filter = ContactListFilter.createFilterWithType(
            Toast.makeText(PeopleActivity.this, R.string.toast_displaying_all_contacts,
                    Toast.LENGTH_LONG).show();
            ContactListFilter filter = ContactListFilter.createFilterWithType(
                    ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS);
            mAllFragment.setFilter(filter);
            } else {
                filter = ContactListFilter.createFilterWithType(
                        ContactListFilter.FILTER_TYPE_SINGLE_CONTACT);
                mAllFragment.setFilter(filter, false);
            }
            mContactListFilterController.setContactListFilter(filter, true);
        }
    }