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

Commit bc38e1f5 authored by Bai Tao's avatar Bai Tao
Browse files

Add help text when user creates the shortcut but there is no contact.

bug: 2139262
Change-Id: I04e8da5424f11e1e834e3bab6ea1b4c51b37b385
parent bf35bf07
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -414,6 +414,12 @@
    <!-- Dialog title displayed when loading a phone number from the SIM card for speed dial -->
    <string name="simContacts_title">SIM card contacts</string>

    <!-- Displayed full screen when the user want to create a shortcut, but there is no contacts, and contact syncing is enabled -->
    <string name="noContactsHelpTextWithSyncForCreateShortcut">"You don't have any contacts to display. (If you just added an account, it can take a few minutes to sync contacts.)"</string>

    <!-- Displayed full screen when the user want to create a shortcut, but there is no contacts -->
    <string name="noContactsHelpTextForCreateShortcut">"You don't have any contacts to display."</string>

    <!-- Displayed full screen when the user has no contacts and they are displaying the My Contacts group, and contact syncing is disabled -->
    <string name="noContactsHelpText">"You don't have any contacts to display.\n\nTo add contacts, press <font fgcolor="#ffffffff"><b>Menu</b></font> and touch:\n
        \n<li><font fgcolor="#ffffffff"><b>Accounts</b></font> to add or configure an account with contacts you can sync to the phone\n</li>
+12 −6
Original line number Diff line number Diff line
@@ -962,16 +962,22 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
        } else {
            boolean hasSim = ((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE))
                    .hasIccCard();

            if (hasSim) {
            boolean createShortcut = Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction());
            if (mSyncEnabled) {
                if (createShortcut) {
                    // Help text is the same no matter whether there is SIM or not.
                    empty.setText(getText(R.string.noContactsHelpTextWithSyncForCreateShortcut));
                } else if (hasSim) {
                    empty.setText(getText(R.string.noContactsHelpTextWithSync));
                } else {
                    empty.setText(getText(R.string.noContactsHelpText));
                    empty.setText(getText(R.string.noContactsNoSimHelpTextWithSync));
                }
            } else {
                if (mSyncEnabled) {
                    empty.setText(getText(R.string.noContactsNoSimHelpTextWithSync));
                if (createShortcut) {
                    // Help text is the same no matter whether there is SIM or not.
                    empty.setText(getText(R.string.noContactsHelpTextForCreateShortcut));
                } else if (hasSim) {
                    empty.setText(getText(R.string.noContactsHelpText));
                } else {
                    empty.setText(getText(R.string.noContactsNoSimHelpText));
                }