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

Commit 3d8803e4 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Use different strings for list header

Bug 30189545

Change-Id: Iddcacad2af15b09083e7da1692ceaddb10db20e6
parent 54339a06
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -208,10 +208,16 @@

    <!-- List header indicating the number of contacts in the list [CHAR LIMIT=30] -->
    <plurals name="contacts_count">
        <item quantity="one">1 contact</item>
        <item quantity="one"><xliff:g id="count">%d</xliff:g> contact</item>
        <item quantity="other"><xliff:g id="count">%d</xliff:g> contacts</item>
    </plurals>

    <!-- List header indicating the number of contacts and account name in the list [CHAR LIMIT=30] -->
    <plurals name="contacts_count_with_account">
        <item quantity="one"><xliff:g id="count">%d</xliff:g> contact · <xliff:g id="account">%s</xliff:g></item>
        <item quantity="other"><xliff:g id="count">%d</xliff:g> contacts · <xliff:g id="account">%s</xliff:g></item>
    </plurals>

    <!-- Activity title indicating contacts are from a Google account [CHAR LIMIT=30] -->
    <string name="title_from_google">From Google</string>

+7 −8
Original line number Diff line number Diff line
@@ -327,14 +327,13 @@ public abstract class MultiSelectContactsListFragment<T extends MultiSelectEntry
        // Set text of count of contacts and account name (if it's a Google account)
        final TextView accountFilterHeader = (TextView) accountFilterContainer.findViewById(
                R.id.account_filter_header);
        final String headerText =  String.format(context.getResources().getQuantityString(
                R.plurals.contacts_count, memberCount), memberCount);
        final StringBuilder sb = new StringBuilder(headerText);
        if (GoogleAccountType.ACCOUNT_TYPE.equals(accountWithDataSet.type)) {
            sb.append(" \u00B7 "); // Unicode character 'MIDDLE DOT'
            sb.append(accountWithDataSet.name);
        }
        accountFilterHeader.setText(sb.toString());
        final String headerText = GoogleAccountType.ACCOUNT_TYPE.equals(accountWithDataSet.type)
                ? String.format(context.getResources().getQuantityString(
                        R.plurals.contacts_count_with_account, memberCount),
                                memberCount, accountWithDataSet.name)
                : context.getResources().getQuantityString(
                        R.plurals.contacts_count, memberCount, memberCount);
        accountFilterHeader.setText(headerText);
        accountFilterHeader.setAllCaps(false);

        // Set icon of the account