diff options
4 files changed, 26 insertions, 7 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 213d340dd..d8a8ffe19 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -51,7 +51,7 @@ <string name="recentCalls_editNumberBeforeCall">Edit number before call</string> <!-- Menu item used to add a number from the call log to contacts --> - <string name="recentCalls_addToContact">Add to contacts</string> + <string name="recentCalls_addToContact">Add to a contact</string> <!-- Menu item used to remove a single call from the call log --> <string name="recentCalls_removeFromRecentList">Delete from call history</string> @@ -500,7 +500,7 @@ <!-- Shortcut item used to add a number to an existing contact directly from search. [CHAR LIMIT=25] --> - <string name="search_shortcut_add_to_contact">Add to contact</string> + <string name="search_shortcut_add_to_contact">Add to a contact</string> <!-- Shortcut item used to send a text message directly from search. [CHAR LIMIT=25] --> <string name="search_shortcut_send_sms_message">Send SMS</string> diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java index eaa5cc808..20e88e22b 100644 --- a/src/com/android/dialer/list/AllContactsFragment.java +++ b/src/com/android/dialer/list/AllContactsFragment.java @@ -16,6 +16,7 @@ package com.android.dialer.list; +import android.content.Loader; import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Phone; @@ -39,6 +40,8 @@ import com.android.dialer.util.DialerUtils; */ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryListAdapter> { + private View mEmptyListView; + public AllContactsFragment() { setQuickContactEnabled(false); setAdjustSelectionBoundsEnabled(true); @@ -52,10 +55,11 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi public void onViewCreated(View view, android.os.Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - View emptyListView = view.findViewById(R.id.empty_list_view); - DialerUtils.configureEmptyListView(emptyListView, R.drawable.empty_contacts, + View mEmptyListView = view.findViewById(R.id.empty_list_view); + DialerUtils.configureEmptyListView(mEmptyListView, R.drawable.empty_contacts, R.string.all_contacts_empty, getResources()); - getListView().setEmptyView(emptyListView); + getListView().setEmptyView(mEmptyListView); + mEmptyListView.setVisibility(View.GONE); ViewUtil.addBottomPaddingToListViewForFab(getListView(), getResources()); } @@ -68,6 +72,15 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi } @Override + public void onLoadFinished(Loader<Cursor> loader, Cursor data) { + super.onLoadFinished(loader, data); + + if (data.getCount() == 0) { + mEmptyListView.setVisibility(View.VISIBLE); + } + } + + @Override protected ContactEntryListAdapter createListAdapter() { if (!PermissionsUtil.hasContactsPermissions(getActivity())) { return new EmptyContactsListAdapter(getActivity()); diff --git a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java index 8a4302319..17c573f1c 100644 --- a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +++ b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java @@ -3,6 +3,8 @@ package com.android.dialer.list; import android.content.Context; import android.content.res.Resources; import android.telephony.PhoneNumberUtils; +import android.text.BidiFormatter; +import android.text.TextDirectionHeuristics; import android.view.View; import android.view.ViewGroup; @@ -36,6 +38,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { private final boolean[] mShortcutEnabled = new boolean[SHORTCUT_COUNT]; + private final BidiFormatter mBidiFormatter = BidiFormatter.getInstance(); + public DialerPhoneNumberListAdapter(Context context) { super(context); @@ -141,7 +145,9 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { final String number = getFormattedQueryString(); switch (shortcutType) { case SHORTCUT_DIRECT_CALL: - text = resources.getString(R.string.search_shortcut_call_number, number); + text = resources.getString( + R.string.search_shortcut_call_number, + mBidiFormatter.unicodeWrap(number, TextDirectionHeuristics.LTR)); drawableId = R.drawable.ic_search_phone; break; case SHORTCUT_CREATE_NEW_CONTACT: diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index ebe45a131..1a1547692 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -204,7 +204,7 @@ public class VoicemailPlaybackPresenter public void onPause(boolean isFinishing) { // Do not pause for orientation changes. - if (mMediaPlayer.isPlaying() && isFinishing) { + if (mIsPrepared && mMediaPlayer.isPlaying() && isFinishing) { pausePlayback(); } |