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

Commit 7ca4fade authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

Merge "Use quantitiy string for sharing contacts"

parents 2c1c2dde 281689f7
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -421,8 +421,11 @@
    <!-- The menu item to add the the currently viewed contact to your contacts [CHAR LIMIT=30] -->
    <string name="menu_add_contact">Add to contacts</string>

    <!-- Dialog title when picking the application to share a contact with. -->
    <string name="share_via">Share contact via</string>
    <!-- Dialog title when picking the application to share one or multiple contacts with. [CHAR LIMIT=40] -->
    <plurals name="title_share_via">
        <item quantity="one">Share contact via</item>
        <item quantity="other">Share contacts via</item>
    </plurals>

    <!-- Title for the disambiguation dialog that requests the user choose an account for the new label to be created under [CHAR LIMIT=NONE] -->
    <string name="dialog_new_group_account">Choose account</string>
+4 −3
Original line number Diff line number Diff line
@@ -1346,9 +1346,10 @@ public class PeopleActivity extends AppCompatContactsActivity implements
        intent.setType(Contacts.CONTENT_VCARD_TYPE);
        intent.putExtra(Intent.EXTRA_STREAM, uri);
        try {
            // TODO(wenyiw): show different strings based on number of contacts.
            startActivityForResult(Intent.createChooser(intent, getText(R.string.share_via)),
                    ACTIVITY_REQUEST_CODE_SHARE);
            startActivityForResult(Intent.createChooser(intent, getResources().getQuantityString(
                    R.plurals.title_share_via,
                    /* quantity */ mAllFragment.getSelectedContactIds().size()))
                    , ACTIVITY_REQUEST_CODE_SHARE);
        } catch (final ActivityNotFoundException ex) {
            Toast.makeText(this, R.string.share_error, Toast.LENGTH_SHORT).show();
        }
+2 −1
Original line number Diff line number Diff line
@@ -2813,7 +2813,8 @@ public class QuickContactActivity extends ContactsActivity
        intent.putExtra(Intent.EXTRA_STREAM, shareUri);

        // Launch chooser to share contact via
        final CharSequence chooseTitle = getText(R.string.share_via);
        final CharSequence chooseTitle = getResources().getQuantityString(
                R.plurals.title_share_via, /* quantity */ 1);
        final Intent chooseIntent = Intent.createChooser(intent, chooseTitle);

        try {