diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/dialer/app/DialtactsActivity.java | 27 | ||||
-rw-r--r-- | java/com/android/dialer/app/list/SearchFragment.java | 2 | ||||
-rw-r--r-- | java/com/android/dialer/app/list/SmartDialNumberListAdapter.java | 10 | ||||
-rw-r--r-- | java/com/android/dialer/app/list/SmartDialSearchFragment.java | 2 | ||||
-rw-r--r-- | java/com/android/dialer/app/res/values/dimens.xml | 3 | ||||
-rw-r--r-- | java/com/android/dialer/app/res/values/donottranslate_config.xml | 5 | ||||
-rw-r--r-- | java/com/android/dialer/app/res/values/strings.xml | 53 | ||||
-rw-r--r-- | java/com/android/dialer/common/FragmentUtils.java | 38 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/DialpadFragment.java (renamed from java/com/android/dialer/app/dialpad/DialpadFragment.java) | 173 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/PseudoEmergencyAnimator.java (renamed from java/com/android/dialer/app/dialpad/PseudoEmergencyAnimator.java) | 63 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/SmartDialCursorLoader.java (renamed from java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java) | 2 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java (renamed from java/com/android/dialer/app/SpecialCharSequenceMgr.java) | 4 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/UnicodeDialerKeyListener.java (renamed from java/com/android/dialer/app/dialpad/UnicodeDialerKeyListener.java) | 2 | ||||
-rwxr-xr-x | java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_add_call.png (renamed from java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_add_call.png) | bin | 1649 -> 1649 bytes | |||
-rwxr-xr-x | java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_current_call.png (renamed from java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_current_call.png) | bin | 2305 -> 2305 bytes | |||
-rwxr-xr-x | java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_tt_keypad.png (renamed from java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_tt_keypad.png) | bin | 2419 -> 2419 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_add_call.png (renamed from java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_add_call.png) | bin | 1309 -> 1309 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_current_call.png (renamed from java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_current_call.png) | bin | 1581 -> 1581 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_tt_keypad.png (renamed from java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_tt_keypad.png) | bin | 1586 -> 1586 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_add_call.png (renamed from java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_add_call.png) | bin | 2150 -> 2150 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_current_call.png (renamed from java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_current_call.png) | bin | 3154 -> 3154 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_tt_keypad.png (renamed from java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_tt_keypad.png) | bin | 3298 -> 3298 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_add_call.png (renamed from java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_add_call.png) | bin | 2583 -> 2583 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_current_call.png (renamed from java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_current_call.png) | bin | 3622 -> 3622 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_tt_keypad.png (renamed from java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_tt_keypad.png) | bin | 3229 -> 3229 bytes | |||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable/ic_wifi_calling.xml (renamed from java/com/android/dialer/app/res/drawable/ic_wifi_calling.xml) | 0 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable/shadow_fade_left.xml (renamed from java/com/android/dialer/app/res/drawable/shadow_fade_left.xml) | 0 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/drawable/shadow_fade_up.xml (renamed from java/com/android/dialer/app/res/drawable/shadow_fade_up.xml) | 0 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/layout-land/dialpad_fragment.xml (renamed from java/com/android/dialer/app/res/layout-land/dialpad_fragment.xml) | 2 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/layout/dialpad_chooser_list_item.xml (renamed from java/com/android/dialer/app/res/layout/dialpad_chooser_list_item.xml) | 0 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/layout/dialpad_fragment.xml (renamed from java/com/android/dialer/app/res/layout/dialpad_fragment.xml) | 2 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/menu/dialpad_options.xml (renamed from java/com/android/dialer/app/res/menu/dialpad_options.xml) | 0 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/values/dimens.xml | 3 | ||||
-rw-r--r-- | java/com/android/dialer/dialpadview/res/values/strings.xml | 59 |
34 files changed, 230 insertions, 220 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index d7edc6838..04545b5c7 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -73,10 +73,10 @@ import com.android.dialer.animation.AnimUtils; import com.android.dialer.animation.AnimationListenerAdapter; import com.android.dialer.app.calllog.CallLogActivity; import com.android.dialer.app.calllog.CallLogAdapter; +import com.android.dialer.app.calllog.CallLogAsync; import com.android.dialer.app.calllog.CallLogFragment; import com.android.dialer.app.calllog.CallLogNotificationsService; import com.android.dialer.app.calllog.IntentProvider; -import com.android.dialer.app.dialpad.DialpadFragment; import com.android.dialer.app.list.DialtactsPagerAdapter; import com.android.dialer.app.list.DialtactsPagerAdapter.TabIndex; import com.android.dialer.app.list.DragDropController; @@ -102,6 +102,9 @@ import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.database.Database; import com.android.dialer.database.DialerDatabaseHelper; +import com.android.dialer.dialpadview.DialpadFragment; +import com.android.dialer.dialpadview.DialpadFragment.DialpadListener; +import com.android.dialer.dialpadview.DialpadFragment.LastOutgoingCallCallback; import com.android.dialer.interactions.PhoneNumberInteraction; import com.android.dialer.interactions.PhoneNumberInteraction.InteractionErrorCode; import com.android.dialer.logging.DialerImpression; @@ -153,7 +156,8 @@ public class DialtactsActivity extends TransactionSafeActivity ActionBarController.ActivityUi, PhoneNumberInteraction.InteractionErrorListener, PhoneNumberInteraction.DisambigDialogDismissedListener, - ActivityCompat.OnRequestPermissionsResultCallback { + ActivityCompat.OnRequestPermissionsResultCallback, + DialpadListener { public static final boolean DEBUG = false; @VisibleForTesting public static final String TAG_DIALPAD_FRAGMENT = "dialpad"; @@ -346,6 +350,7 @@ public class DialtactsActivity extends TransactionSafeActivity return false; } }; + /** * The text returned from a voice search query. Set in {@link #onActivityResult} and used in * {@link #onResume()} to populate the search box. @@ -403,12 +408,12 @@ public class DialtactsActivity extends TransactionSafeActivity actionBar.setBackgroundDrawable(null); SearchEditTextLayout searchEditTextLayout = - (SearchEditTextLayout) actionBar.getCustomView().findViewById(R.id.search_view_container); + actionBar.getCustomView().findViewById(R.id.search_view_container); searchEditTextLayout.setPreImeKeyListener(mSearchEditTextLayoutListener); mActionBarController = new ActionBarController(this, searchEditTextLayout); - mSearchView = (EditText) searchEditTextLayout.findViewById(R.id.search_view); + mSearchView = searchEditTextLayout.findViewById(R.id.search_view); mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener); mVoiceSearchButton = searchEditTextLayout.findViewById(R.id.voice_search_button); searchEditTextLayout @@ -431,14 +436,13 @@ public class DialtactsActivity extends TransactionSafeActivity mIsLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; mPreviouslySelectedTabIndex = DialtactsPagerAdapter.TAB_INDEX_SPEED_DIAL; - FloatingActionButton floatingActionButton = - (FloatingActionButton) findViewById(R.id.floating_action_button); + FloatingActionButton floatingActionButton = findViewById(R.id.floating_action_button); floatingActionButton.setOnClickListener(this); mFloatingActionButtonController = new FloatingActionButtonController(this, floatingActionButton); ImageButton optionsMenuButton = - (ImageButton) searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); + searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); optionsMenuButton.setOnClickListener(this); mOverflowMenu = buildOptionsMenu(optionsMenuButton); optionsMenuButton.setOnTouchListener(mOverflowMenu.getDragToOpenListener()); @@ -857,7 +861,15 @@ public class DialtactsActivity extends TransactionSafeActivity setTitle(R.string.launcherDialpadActivityLabel); } + @Override + public void getLastOutgoingCall(LastOutgoingCallCallback callback) { + new CallLogAsync() + .getLastOutgoingCall( + new CallLogAsync.GetLastOutgoingCallArgs(this, callback::lastOutgoingCall)); + } + /** Callback from child DialpadFragment when the dialpad is shown. */ + @Override public void onDialpadShown() { LogUtil.d("DialtactsActivity.onDialpadShown", ""); Assert.isNotNull(mDialpadFragment); @@ -876,6 +888,7 @@ public class DialtactsActivity extends TransactionSafeActivity * * @see #commitDialpadFragmentHide */ + @Override public void hideDialpadFragment(boolean animate, boolean clearDialpad) { if (mDialpadFragment == null || mDialpadFragment.getView() == null) { return; diff --git a/java/com/android/dialer/app/list/SearchFragment.java b/java/com/android/dialer/app/list/SearchFragment.java index 00a2708a1..e21e073bd 100644 --- a/java/com/android/dialer/app/list/SearchFragment.java +++ b/java/com/android/dialer/app/list/SearchFragment.java @@ -38,10 +38,10 @@ import com.android.contacts.common.list.OnPhoneNumberPickerActionListener; import com.android.contacts.common.list.PhoneNumberPickerFragment; import com.android.dialer.animation.AnimUtils; import com.android.dialer.app.R; -import com.android.dialer.app.dialpad.DialpadFragment.ErrorDialogFragment; import com.android.dialer.app.widget.DialpadSearchEmptyContentView; import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.common.LogUtil; +import com.android.dialer.dialpadview.DialpadFragment.ErrorDialogFragment; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.util.DialerUtils; diff --git a/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java b/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java index 566a15d53..3b00c7643 100644 --- a/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java +++ b/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java @@ -20,9 +20,9 @@ import android.database.Cursor; import android.support.annotation.NonNull; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; -import android.util.Log; import com.android.contacts.common.list.ContactListItemView; -import com.android.dialer.app.dialpad.SmartDialCursorLoader; +import com.android.dialer.common.LogUtil; +import com.android.dialer.dialpadview.SmartDialCursorLoader; import com.android.dialer.smartdial.SmartDialMatchPosition; import com.android.dialer.smartdial.SmartDialNameMatcher; import com.android.dialer.smartdial.SmartDialPrefix; @@ -43,14 +43,14 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { setShortcutEnabled(SmartDialNumberListAdapter.SHORTCUT_DIRECT_CALL, false); if (DEBUG) { - Log.v(TAG, "Constructing List Adapter"); + LogUtil.v(TAG, "Constructing List Adapter"); } } /** Sets query for the SmartDialCursorLoader. */ public void configureLoader(SmartDialCursorLoader loader) { if (DEBUG) { - Log.v(TAG, "Configure Loader with query" + getQueryString()); + LogUtil.v(TAG, "Configure Loader with query" + getQueryString()); } if (getQueryString() == null) { @@ -77,7 +77,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { for (SmartDialMatchPosition match : nameMatches) { view.addNameHighlightSequence(match.start, match.end); if (DEBUG) { - Log.v( + LogUtil.v( TAG, cursor.getString(PhoneQuery.DISPLAY_NAME) + " " diff --git a/java/com/android/dialer/app/list/SmartDialSearchFragment.java b/java/com/android/dialer/app/list/SmartDialSearchFragment.java index 2ebc06bc3..e97a16c19 100644 --- a/java/com/android/dialer/app/list/SmartDialSearchFragment.java +++ b/java/com/android/dialer/app/list/SmartDialSearchFragment.java @@ -28,10 +28,10 @@ import android.os.Bundle; import android.support.v13.app.FragmentCompat; import com.android.contacts.common.list.ContactEntryListAdapter; import com.android.dialer.app.R; -import com.android.dialer.app.dialpad.SmartDialCursorLoader; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.common.LogUtil; import com.android.dialer.database.DialerDatabaseHelper; +import com.android.dialer.dialpadview.SmartDialCursorLoader; import com.android.dialer.util.PermissionsUtil; import com.android.dialer.widget.EmptyContentView; import java.util.Arrays; diff --git a/java/com/android/dialer/app/res/values/dimens.xml b/java/com/android/dialer/app/res/values/dimens.xml index 90a8bb879..4327fb908 100644 --- a/java/com/android/dialer/app/res/values/dimens.xml +++ b/java/com/android/dialer/app/res/values/dimens.xml @@ -107,9 +107,6 @@ so this extra padding makes the entire touch target 40dp --> <dimen name="icon_padding">8dp</dimen> - <!-- Length of dialpad's shadows in dialer. --> - <dimen name="shadow_length">10dp</dimen> - <!-- Dimensions for individual preference cards --> <dimen name="preference_padding_top">16dp</dimen> <dimen name="preference_padding_bottom">16dp</dimen> diff --git a/java/com/android/dialer/app/res/values/donottranslate_config.xml b/java/com/android/dialer/app/res/values/donottranslate_config.xml index e7a8e6fc3..0d18d551e 100644 --- a/java/com/android/dialer/app/res/values/donottranslate_config.xml +++ b/java/com/android/dialer/app/res/values/donottranslate_config.xml @@ -29,9 +29,4 @@ keys, but for maximum flexibility it's controlled by a flag here (which can be overridden on a per-product basis.) --> <bool name="config_show_onscreen_dial_button">true</bool> - - <!-- Regular expression for prohibiting certain phone numbers in dialpad. - Ignored if empty. --> - <string name="config_prohibited_phone_number_regexp"></string> - </resources> diff --git a/java/com/android/dialer/app/res/values/strings.xml b/java/com/android/dialer/app/res/values/strings.xml index 5549881c3..4a7c68f91 100644 --- a/java/com/android/dialer/app/res/values/strings.xml +++ b/java/com/android/dialer/app/res/values/strings.xml @@ -176,12 +176,6 @@ --> <string name="description_search_button">search</string> - <!-- String describing the Dial ImageButton - - Used by AccessibilityService to announce the purpose of the button. - --> - <string name="description_dial_button">dial</string> - <!-- String describing the digits text box containing the number to dial. Used by AccessibilityService to announce the purpose of the view. @@ -247,10 +241,6 @@ <!-- Menu item used to show all calls in the call log. [CHAR LIMIT=30] --> <string name="menu_show_all_calls">Show all calls</string> - <!-- Menu items for dialpad options as part of Pause and Wait ftr [CHAR LIMIT=30] --> - <string name="add_2sec_pause">Add 2-sec pause</string> - <string name="add_wait">Add wait</string> - <!-- Label for the dialer app setting page [CHAR LIMIT=30]--> <string name="dialer_settings_label">Settings</string> @@ -264,21 +254,6 @@ <!-- Menu item to display all contacts [CHAR LIMIT=30] --> <string name="menu_allContacts">All contacts</string> - <!-- Item label: jump to the in-call DTMF dialpad. - (Part of a list of options shown in the dialer when another call - is already in progress.) --> - <string name="dialer_useDtmfDialpad">Use touch tone keypad</string> - - <!-- Item label: jump to the in-call UI. - (Part of a list of options shown in the dialer when another call - is already in progress.) --> - <string name="dialer_returnToInCallScreen">Return to call in progress</string> - - <!-- Item label: use the Dialer's keypad to add another call. - (Part of a list of options shown in the dialer when another call - is already in progress.) --> - <string name="dialer_addAnotherCall">Add call</string> - <!-- Description for incoming calls going to voice mail vs. not --> <string name="actionIncomingCall">Incoming calls</string> @@ -381,9 +356,6 @@ <!-- String describing the icon used to start a voice search --> <string name="description_start_voice_search">Start voice search</string> - <!-- Menu item used to call a contact, containing the number of the contact to call --> - <string name="menu_callNumber">Call <xliff:g id="number">%s</xliff:g></string> - <!-- String used for displaying calls to the voicemail number in the call log --> <string name="voicemail">Voicemail</string> @@ -425,34 +397,9 @@ <!-- A format string used for displaying the date, time and duration for a voicemail call log. For example: Jul 25, 2014 at 2:49 PM • 00:34 --> <string name="voicemailCallLogDateTimeFormatWithDuration"><xliff:g example="Jul 25, 2014 at 2:49PM" id="dateAndTime">%1$s</xliff:g> \u2022 <xliff:g example="01:22" id="duration">%2$s</xliff:g></string> - <!-- Dialog message which is shown when the user tries to make a phone call - to prohibited phone numbers [CHAR LIMIT=NONE] --> - <string msgid="4313552620858880999" name="dialog_phone_call_prohibited_message">Can\'t call this number</string> - - <!-- Dialog message which is shown when the user tries to check voicemail - while the system isn't ready for the access. [CHAR LIMIT=NONE] --> - <string name="dialog_voicemail_not_ready_message">To set up voicemail, go to Menu > Settings.</string> - - <!-- Dialog message which is shown when the user tries to check voicemail - while the system is in airplane mode. The user cannot access to - voicemail service in Airplane mode. [CHAR LIMI=NONE] --> - <string name="dialog_voicemail_airplane_mode_message">To call voicemail, first turn off Airplane mode.</string> - <!-- Message that appears in the favorites tab of the Phone app when the contact list has not fully loaded yet (below the favorite and frequent contacts) [CHAR LIMIT=20] --> <string name="contact_list_loading">Loading\u2026</string> - <!-- The title of a dialog that displays the IMEI of the phone --> - <string name="imei">IMEI</string> - - <!-- The title of a dialog that displays the MEID of the CDMA phone --> - <string name="meid">MEID</string> - - <!-- Dialog text displayed when loading a phone number from the SIM card for speed dial --> - <string name="simContacts_emptyLoading">Loading from SIM card\u2026</string> - - <!-- Dialog title displayed when loading a phone number from the SIM card for speed dial --> - <string name="simContacts_title">SIM card contacts</string> - <!-- Message displayed when there is no application available to handle voice search. [CHAR LIMIT=NONE] --> <string name="voice_search_not_available">Voice search not available</string> diff --git a/java/com/android/dialer/common/FragmentUtils.java b/java/com/android/dialer/common/FragmentUtils.java index cb036959d..ad7ec7390 100644 --- a/java/com/android/dialer/common/FragmentUtils.java +++ b/java/com/android/dialer/common/FragmentUtils.java @@ -16,6 +16,7 @@ package com.android.dialer.common; +import android.app.Activity; import android.support.annotation.CheckResult; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -62,6 +63,33 @@ public class FragmentUtils { return null; } + /** Version of {@link #getParent(Fragment, Class)} which supports {@link android.app.Fragment}. */ + @CheckResult(suggest = "#checkParent(Fragment, Class)}") + @Nullable + public static <T> T getParent( + @NonNull android.app.Fragment fragment, @NonNull Class<T> callbackInterface) { + if (callbackInterface.isInstance(parentForTesting)) { + @SuppressWarnings("unchecked") // Casts are checked using runtime methods + T parent = (T) parentForTesting; + return parent; + } + + android.app.Fragment parentFragment = fragment.getParentFragment(); + if (callbackInterface.isInstance(parentFragment)) { + @SuppressWarnings("unchecked") // Casts are checked using runtime methods + T parent = (T) parentFragment; + return parent; + } else { + Activity activity = fragment.getActivity(); + if (callbackInterface.isInstance(activity)) { + @SuppressWarnings("unchecked") // Casts are checked using runtime methods + T parent = (T) activity; + return parent; + } + } + return null; + } + /** Returns the parent or throws. Should perform check elsewhere(e.g. onAttach, newInstance). */ @NonNull public static <T> T getParentUnsafe( @@ -70,6 +98,16 @@ public class FragmentUtils { } /** + * Version of {@link #getParentUnsafe(Fragment, Class)} which supports {@link + * android.app.Fragment}. + */ + @NonNull + public static <T> T getParentUnsafe( + @NonNull android.app.Fragment fragment, @NonNull Class<T> callbackInterface) { + return Assert.isNotNull(getParent(fragment, callbackInterface)); + } + + /** * Ensures fragment has a parent that implements the corresponding interface * * @param frag The Fragment whose parents are to be checked diff --git a/java/com/android/dialer/app/dialpad/DialpadFragment.java b/java/com/android/dialer/dialpadview/DialpadFragment.java index d58caa50a..7ef21c2db 100644 --- a/java/com/android/dialer/app/dialpad/DialpadFragment.java +++ b/java/com/android/dialer/dialpadview/DialpadFragment.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package com.android.dialer.app.dialpad; +package com.android.dialer.dialpadview; -import android.Manifest.permission; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -25,10 +24,8 @@ import android.app.Fragment; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; -import android.content.pm.PackageManager; import android.content.res.Resources; import android.database.Cursor; import android.graphics.Bitmap; @@ -45,7 +42,6 @@ import android.provider.Settings; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; import android.support.design.widget.FloatingActionButton; -import android.support.v4.content.ContextCompat; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telephony.PhoneNumberFormattingTextWatcher; @@ -60,7 +56,6 @@ import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; @@ -75,19 +70,14 @@ import com.android.contacts.common.dialog.CallSubjectDialog; import com.android.contacts.common.util.StopWatch; import com.android.contacts.common.widget.FloatingActionButtonController; import com.android.dialer.animation.AnimUtils; -import com.android.dialer.app.DialtactsActivity; -import com.android.dialer.app.R; -import com.android.dialer.app.SpecialCharSequenceMgr; -import com.android.dialer.app.calllog.CallLogAsync; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.calllogutils.PhoneAccountUtils; +import com.android.dialer.common.FragmentUtils; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor; import com.android.dialer.common.concurrent.DialerExecutor.Worker; import com.android.dialer.common.concurrent.DialerExecutors; -import com.android.dialer.dialpadview.DialpadKeyButton; -import com.android.dialer.dialpadview.DialpadView; import com.android.dialer.location.GeoUtil; import com.android.dialer.logging.UiAction; import com.android.dialer.oem.MotorolaUtils; @@ -111,7 +101,6 @@ public class DialpadFragment extends Fragment DialpadKeyButton.OnPressedListener { private static final String TAG = "DialpadFragment"; - private static final boolean DEBUG = DialtactsActivity.DEBUG; private static final String EMPTY_NUMBER = ""; private static final char PAUSE = ','; private static final char WAIT = ';'; @@ -140,11 +129,8 @@ public class DialpadFragment extends Fragment private static final String PREF_DIGITS_FILLED_BY_INTENT = "pref_digits_filled_by_intent"; private final Object mToneGeneratorLock = new Object(); /** Set of dialpad keys that are currently being pressed */ - private final HashSet<View> mPressedDialpadKeys = new HashSet<View>(12); - // Last number dialed, retrieved asynchronously from the call DB - // in onCreate. This number is displayed when the user hits the - // send key and cleared in onPause. - private final CallLogAsync mCallLog = new CallLogAsync(); + private final HashSet<View> mPressedDialpadKeys = new HashSet<>(12); + private OnDialpadQueryChangedListener mDialpadQueryListener; private DialpadView mDialpadView; private EditText mDigits; @@ -156,8 +142,8 @@ public class DialpadFragment extends Fragment private PopupMenu mOverflowPopupMenu; private View mDelete; private ToneGenerator mToneGenerator; - private View mSpacer; private FloatingActionButtonController mFloatingActionButtonController; + private FloatingActionButton mFloatingActionButton; private ListView mDialpadChooser; private DialpadChooserAdapter mDialpadChooserAdapter; /** Regular expression prohibiting manual phone call. Can be empty, which means "no rule". */ @@ -367,7 +353,7 @@ public class DialpadFragment extends Fragment public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) { Trace.beginSection(TAG + " onCreateView"); Trace.beginSection(TAG + " inflate view"); - final View fragmentView = inflater.inflate(R.layout.dialpad_fragment, container, false); + View fragmentView = inflater.inflate(R.layout.dialpad_fragment, container, false); Trace.endSection(); Trace.beginSection(TAG + " buildLayer"); fragmentView.buildLayer(); @@ -375,7 +361,7 @@ public class DialpadFragment extends Fragment Trace.beginSection(TAG + " setup views"); - mDialpadView = (DialpadView) fragmentView.findViewById(R.id.dialpad_view); + mDialpadView = fragmentView.findViewById(R.id.dialpad_view); mDialpadView.setCanDigitsBeEdited(true); mDigits = mDialpadView.getDigits(); mDigits.setKeyListener(UnicodeDialerKeyListener.INSTANCE); @@ -401,32 +387,29 @@ public class DialpadFragment extends Fragment mDelete.setOnLongClickListener(this); } - mSpacer = fragmentView.findViewById(R.id.spacer); - mSpacer.setOnTouchListener( - new View.OnTouchListener() { - @Override - public boolean onTouch(View v, MotionEvent event) { - if (isDigitsEmpty()) { - if (getActivity() != null) { - return ((HostInterface) getActivity()).onDialpadSpacerTouchWithEmptyQuery(); + fragmentView + .findViewById(R.id.spacer) + .setOnTouchListener( + (v, event) -> { + if (isDigitsEmpty()) { + if (getActivity() != null) { + return ((HostInterface) getActivity()).onDialpadSpacerTouchWithEmptyQuery(); + } + return true; } - return true; - } - return false; - } - }); + return false; + }); mDigits.setCursorVisible(false); // Set up the "dialpad chooser" UI; see showDialpadChooser(). - mDialpadChooser = (ListView) fragmentView.findViewById(R.id.dialpadChooser); + mDialpadChooser = fragmentView.findViewById(R.id.dialpadChooser); mDialpadChooser.setOnItemClickListener(this); - FloatingActionButton floatingActionButton = - (FloatingActionButton) fragmentView.findViewById(R.id.dialpad_floating_action_button); - floatingActionButton.setOnClickListener(this); + mFloatingActionButton = fragmentView.findViewById(R.id.dialpad_floating_action_button); + mFloatingActionButton.setOnClickListener(this); mFloatingActionButtonController = - new FloatingActionButtonController(getActivity(), floatingActionButton); + new FloatingActionButtonController(getActivity(), mFloatingActionButton); Trace.endSection(); Trace.endSection(); return fragmentView; @@ -436,7 +419,6 @@ public class DialpadFragment extends Fragment return mDigits != null; } - @VisibleForTesting public EditText getDigitsWidget() { return mDigits; } @@ -504,11 +486,12 @@ public class DialpadFragment extends Fragment * screen to enter "Add Call" mode, this method will show correct UI for the mode. */ private void configureScreenFromIntent(Activity parent) { - // If we were not invoked with a DIAL intent, - if (!(parent instanceof DialtactsActivity)) { + // If we were not invoked with a DIAL intent + if (!Intent.ACTION_DIAL.equals(parent.getIntent().getAction())) { setStartedFromNewIntent(false); return; } + // See if we were invoked with a DIAL intent. If we were, fill in the appropriate // digits in the dialer field. Intent intent = parent.getIntent(); @@ -596,17 +579,17 @@ public class DialpadFragment extends Fragment DialpadKeyButton dialpadKey; - for (int i = 0; i < buttonIds.length; i++) { - dialpadKey = (DialpadKeyButton) fragmentView.findViewById(buttonIds[i]); + for (int buttonId : buttonIds) { + dialpadKey = fragmentView.findViewById(buttonId); dialpadKey.setOnPressedListener(this); } // Long-pressing one button will initiate Voicemail. - final DialpadKeyButton one = (DialpadKeyButton) fragmentView.findViewById(R.id.one); + final DialpadKeyButton one = fragmentView.findViewById(R.id.one); one.setOnLongClickListener(this); // Long-pressing zero button will enter '+' instead. - final DialpadKeyButton zero = (DialpadKeyButton) fragmentView.findViewById(R.id.zero); + final DialpadKeyButton zero = fragmentView.findViewById(R.id.zero); zero.setOnLongClickListener(this); } @@ -651,8 +634,8 @@ public class DialpadFragment extends Fragment mFloatingActionButtonController.changeIcon( res.getDrawable(iconId, null), res.getString(R.string.description_dial_button)); - final DialtactsActivity activity = (DialtactsActivity) getActivity(); - mDialpadQueryListener = activity; + mDialpadQueryListener = + FragmentUtils.getParentUnsafe(this, OnDialpadQueryChangedListener.class); final StopWatch stopWatch = StopWatch.start("Dialpad.onResume"); @@ -662,7 +645,7 @@ public class DialpadFragment extends Fragment stopWatch.lap("qloc"); - final ContentResolver contentResolver = activity.getContentResolver(); + final ContentResolver contentResolver = getActivity().getContentResolver(); // retrieve the DTMF tone play back setting. mDTMFToneEnabled = @@ -833,9 +816,6 @@ public class DialpadFragment extends Fragment */ @Override public void onPressed(View view, boolean pressed) { - if (DEBUG) { - LogUtil.d("DialpadFragment.onPressed", "view: " + view + ", pressed: " + pressed); - } if (pressed) { int resId = view.getId(); if (resId == R.id.one) { @@ -920,7 +900,6 @@ public class DialpadFragment extends Fragment mOverflowPopupMenu.show(); } else { LogUtil.w("DialpadFragment.onClick", "Unexpected event from: " + view); - return; } } @@ -1011,7 +990,7 @@ public class DialpadFragment extends Fragment } private void hideAndClearDialpad(boolean animate) { - ((DialtactsActivity) getActivity()).hideDialpadFragment(animate, true); + FragmentUtils.getParentUnsafe(this, DialpadListener.class).hideDialpadFragment(animate, true); } /** @@ -1281,11 +1260,7 @@ public class DialpadFragment extends Fragment * or ringing or dialing, or on hold). */ private boolean isPhoneInUse() { - final Context context = getActivity(); - if (context != null) { - return TelecomUtil.isInCall(context); - } - return false; + return getContext() != null && TelecomUtil.isInCall(getContext()); } /** @return true if the phone is a CDMA phone type */ @@ -1409,30 +1384,22 @@ public class DialpadFragment extends Fragment */ private void queryLastOutgoingCall() { mLastNumberDialed = EMPTY_NUMBER; - if (ContextCompat.checkSelfPermission(getActivity(), permission.READ_CALL_LOG) - != PackageManager.PERMISSION_GRANTED) { + if (!PermissionsUtil.hasCallLogReadPermissions(getContext())) { return; } - CallLogAsync.GetLastOutgoingCallArgs lastCallArgs = - new CallLogAsync.GetLastOutgoingCallArgs( - getActivity(), - new CallLogAsync.OnLastOutgoingCallComplete() { - @Override - public void lastOutgoingCall(String number) { - // TODO: Filter out emergency numbers if - // the carrier does not want redial for - // these. - // If the fragment has already been detached since the last time - // we called queryLastOutgoingCall in onResume there is no point - // doing anything here. - if (getActivity() == null) { - return; - } - mLastNumberDialed = number; - updateDeleteButtonEnabledState(); + FragmentUtils.getParentUnsafe(this, DialpadListener.class) + .getLastOutgoingCall( + number -> { + // TODO: Filter out emergency numbers if the carrier does not want redial for these. + + // If the fragment has already been detached since the last time we called + // queryLastOutgoingCall in onResume there is no point doing anything here. + if (getActivity() == null) { + return; } + mLastNumberDialed = number; + updateDeleteButtonEnabledState(); }); - mCallLog.getLastOutgoingCall(lastCallArgs); } private Intent newFlashIntent() { @@ -1444,18 +1411,17 @@ public class DialpadFragment extends Fragment @Override public void onHiddenChanged(boolean hidden) { super.onHiddenChanged(hidden); - final DialtactsActivity activity = (DialtactsActivity) getActivity(); - if (activity == null || getView() == null) { + if (getActivity() == null || getView() == null) { return; } - final DialpadView dialpadView = (DialpadView) getView().findViewById(R.id.dialpad_view); + final DialpadView dialpadView = getView().findViewById(R.id.dialpad_view); if (!hidden && !isDialpadChooserVisible()) { if (mAnimate) { dialpadView.animateShow(); } mFloatingActionButtonController.setVisible(false); mFloatingActionButtonController.scaleIn(mAnimate ? mDialpadSlideInDuration : 0); - activity.onDialpadShown(); + FragmentUtils.getParentUnsafe(this, DialpadListener.class).onDialpadShown(); mDigits.requestFocus(); } if (hidden) { @@ -1493,8 +1459,13 @@ public class DialpadFragment extends Fragment new PseudoEmergencyAnimator( new PseudoEmergencyAnimator.ViewProvider() { @Override - public View getView() { - return DialpadFragment.this.getView(); + public View getFab() { + return mFloatingActionButton; + } + + @Override + public Context getContext() { + return DialpadFragment.this.getContext(); } }); } @@ -1590,14 +1561,7 @@ public class DialpadFragment extends Fragment if (mMessageResId != 0) { builder.setMessage(mMessageResId); } - builder.setPositiveButton( - android.R.string.ok, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dismiss(); - } - }); + builder.setPositiveButton(android.R.string.ok, (dialog, which) -> dismiss()); return builder.create(); } } @@ -1616,7 +1580,7 @@ public class DialpadFragment extends Fragment private LayoutInflater mInflater; private ChoiceItem[] mChoiceItems = new ChoiceItem[NUM_ITEMS]; - public DialpadChooserAdapter(Context context) { + DialpadChooserAdapter(Context context) { // Cache the LayoutInflate to avoid asking for a new one each time. mInflater = LayoutInflater.from(context); @@ -1674,10 +1638,10 @@ public class DialpadFragment extends Fragment convertView = mInflater.inflate(R.layout.dialpad_chooser_list_item, null); } - TextView text = (TextView) convertView.findViewById(R.id.text); + TextView text = convertView.findViewById(R.id.text); text.setText(mChoiceItems[position].text); - ImageView icon = (ImageView) convertView.findViewById(R.id.icon); + ImageView icon = convertView.findViewById(R.id.icon); icon.setImageBitmap(mChoiceItems[position].icon); return convertView; @@ -1690,7 +1654,7 @@ public class DialpadFragment extends Fragment Bitmap icon; int id; - public ChoiceItem(String s, Bitmap b, int i) { + ChoiceItem(String s, Bitmap b, int i) { text = s; icon = b; id = i; @@ -1721,6 +1685,21 @@ public class DialpadFragment extends Fragment } } + /** Listener for dialpad's parent. */ + public interface DialpadListener { + void getLastOutgoingCall(LastOutgoingCallCallback callback); + + void onDialpadShown(); + + void hideDialpadFragment(boolean animate, boolean value); + } + + /** Callback for async lookup of the last number dialed. */ + public interface LastOutgoingCallCallback { + + void lastOutgoingCall(String number); + } + /** * Input: the ISO 3166-1 two letters country code of the country the user is in * diff --git a/java/com/android/dialer/app/dialpad/PseudoEmergencyAnimator.java b/java/com/android/dialer/dialpadview/PseudoEmergencyAnimator.java index be2964dfe..16bdd24c1 100644 --- a/java/com/android/dialer/app/dialpad/PseudoEmergencyAnimator.java +++ b/java/com/android/dialer/dialpadview/PseudoEmergencyAnimator.java @@ -14,13 +14,12 @@ * limitations under the License. */ -package com.android.dialer.app.dialpad; +package com.android.dialer.dialpadview; import android.animation.Animator; import android.animation.Animator.AnimatorListener; import android.animation.ArgbEvaluator; import android.animation.ValueAnimator; -import android.animation.ValueAnimator.AnimatorUpdateListener; import android.content.Context; import android.graphics.Color; import android.graphics.ColorFilter; @@ -28,12 +27,11 @@ import android.graphics.LightingColorFilter; import android.os.Handler; import android.os.Vibrator; import android.view.View; -import com.android.dialer.app.R; /** Animates the dial button on "emergency" phone numbers. */ public class PseudoEmergencyAnimator { - public static final String PSEUDO_EMERGENCY_NUMBER = "01189998819991197253"; + static final String PSEUDO_EMERGENCY_NUMBER = "01189998819991197253"; private static final int VIBRATE_LENGTH_MILLIS = 200; private static final int ITERATION_LENGTH_MILLIS = 1000; private static final int ANIMATION_ITERATION_COUNT = 6; @@ -57,21 +55,16 @@ public class PseudoEmergencyAnimator { ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo); mPseudoEmergencyColorAnimator.addUpdateListener( - new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animator) { - try { - int color = (int) animator.getAnimatedValue(); - ColorFilter colorFilter = new LightingColorFilter(Color.BLACK, color); + animator -> { + try { + int color = (int) animator.getAnimatedValue(); + ColorFilter colorFilter = new LightingColorFilter(Color.BLACK, color); - View floatingActionButtonContainer = - getView().findViewById(R.id.floating_action_button); - if (floatingActionButtonContainer != null) { - floatingActionButtonContainer.getBackground().setColorFilter(colorFilter); - } - } catch (Exception e) { - animator.cancel(); + if (mViewProvider.getFab() != null) { + mViewProvider.getFab().getBackground().setColorFilter(colorFilter); } + } catch (Exception e) { + animator.cancel(); } }); @@ -95,22 +88,17 @@ public class PseudoEmergencyAnimator { @Override public void onAnimationEnd(Animator animation) { try { - View floatingActionButtonContainer = - getView().findViewById(R.id.floating_action_button); - if (floatingActionButtonContainer != null) { - floatingActionButtonContainer.getBackground().clearColorFilter(); + if (mViewProvider.getFab() != null) { + mViewProvider.getFab().getBackground().clearColorFilter(); } new Handler() .postDelayed( - new Runnable() { - @Override - public void run() { - try { - vibrate(VIBRATE_LENGTH_MILLIS); - } catch (Exception e) { - // ignored - } + () -> { + try { + vibrate(VIBRATE_LENGTH_MILLIS); + } catch (Exception e) { + // ignored } }, ITERATION_LENGTH_MILLIS); @@ -135,17 +123,8 @@ public class PseudoEmergencyAnimator { } } - private View getView() { - return mViewProvider == null ? null : mViewProvider.getView(); - } - - private Context getContext() { - View view = getView(); - return view != null ? view.getContext() : null; - } - private void vibrate(long milliseconds) { - Context context = getContext(); + Context context = mViewProvider.getContext(); if (context != null) { Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); if (vibrator != null) { @@ -154,8 +133,10 @@ public class PseudoEmergencyAnimator { } } - public interface ViewProvider { + interface ViewProvider { + + View getFab(); - View getView(); + Context getContext(); } } diff --git a/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java b/java/com/android/dialer/dialpadview/SmartDialCursorLoader.java index a0c8b18d3..271535fce 100644 --- a/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java +++ b/java/com/android/dialer/dialpadview/SmartDialCursorLoader.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.dialer.app.dialpad; +package com.android.dialer.dialpadview; import android.content.AsyncTaskLoader; import android.content.Context; diff --git a/java/com/android/dialer/app/SpecialCharSequenceMgr.java b/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java index fd67f4704..e9fbd555f 100644 --- a/java/com/android/dialer/app/SpecialCharSequenceMgr.java +++ b/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.dialer.app; +package com.android.dialer.dialpadview; import android.app.Activity; import android.app.AlertDialog; @@ -96,7 +96,7 @@ public class SpecialCharSequenceMgr { private SpecialCharSequenceMgr() {} public static boolean handleChars(Context context, String input, EditText textField) { - //get rid of the separators so that the string gets parsed correctly + // get rid of the separators so that the string gets parsed correctly String dialString = PhoneNumberUtils.stripSeparators(input); if (handleDeviceIdDisplay(context, dialString) diff --git a/java/com/android/dialer/app/dialpad/UnicodeDialerKeyListener.java b/java/com/android/dialer/dialpadview/UnicodeDialerKeyListener.java index 051daf46e..e9201c0c2 100644 --- a/java/com/android/dialer/app/dialpad/UnicodeDialerKeyListener.java +++ b/java/com/android/dialer/dialpadview/UnicodeDialerKeyListener.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.dialer.app.dialpad; +package com.android.dialer.dialpadview; import android.telephony.PhoneNumberUtils; import android.text.Spanned; diff --git a/java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_add_call.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_add_call.png Binary files differindex 4e0d5649e..4e0d5649e 100755 --- a/java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_add_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_add_call.png diff --git a/java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_current_call.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_current_call.png Binary files differindex 2cf41d598..2cf41d598 100755 --- a/java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_current_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_current_call.png diff --git a/java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_tt_keypad.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_tt_keypad.png Binary files differindex 043685fd9..043685fd9 100755 --- a/java/com/android/dialer/app/res/drawable-hdpi/ic_dialer_fork_tt_keypad.png +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialer_fork_tt_keypad.png diff --git a/java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_add_call.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_add_call.png Binary files differindex 56ac2a33a..56ac2a33a 100644 --- a/java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_add_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_add_call.png diff --git a/java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_current_call.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_current_call.png Binary files differindex 16a44a078..16a44a078 100644 --- a/java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_current_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_current_call.png diff --git a/java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_tt_keypad.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_tt_keypad.png Binary files differindex 66df69eac..66df69eac 100644 --- a/java/com/android/dialer/app/res/drawable-mdpi/ic_dialer_fork_tt_keypad.png +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialer_fork_tt_keypad.png diff --git a/java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_add_call.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_add_call.png Binary files differindex aff140fcd..aff140fcd 100644 --- a/java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_add_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_add_call.png diff --git a/java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_current_call.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_current_call.png Binary files differindex 8975727e0..8975727e0 100644 --- a/java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_current_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_current_call.png diff --git a/java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_tt_keypad.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_tt_keypad.png Binary files differindex 4d48ea9ea..4d48ea9ea 100644 --- a/java/com/android/dialer/app/res/drawable-xhdpi/ic_dialer_fork_tt_keypad.png +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialer_fork_tt_keypad.png diff --git a/java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_add_call.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_add_call.png Binary files differindex 1657da4e2..1657da4e2 100644 --- a/java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_add_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_add_call.png diff --git a/java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_current_call.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_current_call.png Binary files differindex f25cce695..f25cce695 100644 --- a/java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_current_call.png +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_current_call.png diff --git a/java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_tt_keypad.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_tt_keypad.png Binary files differindex 7ac4d8b58..7ac4d8b58 100644 --- a/java/com/android/dialer/app/res/drawable-xxhdpi/ic_dialer_fork_tt_keypad.png +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialer_fork_tt_keypad.png diff --git a/java/com/android/dialer/app/res/drawable/ic_wifi_calling.xml b/java/com/android/dialer/dialpadview/res/drawable/ic_wifi_calling.xml index 968713376..968713376 100644 --- a/java/com/android/dialer/app/res/drawable/ic_wifi_calling.xml +++ b/java/com/android/dialer/dialpadview/res/drawable/ic_wifi_calling.xml diff --git a/java/com/android/dialer/app/res/drawable/shadow_fade_left.xml b/java/com/android/dialer/dialpadview/res/drawable/shadow_fade_left.xml index 6271a8f86..6271a8f86 100644 --- a/java/com/android/dialer/app/res/drawable/shadow_fade_left.xml +++ b/java/com/android/dialer/dialpadview/res/drawable/shadow_fade_left.xml diff --git a/java/com/android/dialer/app/res/drawable/shadow_fade_up.xml b/java/com/android/dialer/dialpadview/res/drawable/shadow_fade_up.xml index 86d37a9bc..86d37a9bc 100644 --- a/java/com/android/dialer/app/res/drawable/shadow_fade_up.xml +++ b/java/com/android/dialer/dialpadview/res/drawable/shadow_fade_up.xml diff --git a/java/com/android/dialer/app/res/layout-land/dialpad_fragment.xml b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_fragment.xml index 45ef933cb..6389853d9 100644 --- a/java/com/android/dialer/app/res/layout-land/dialpad_fragment.xml +++ b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_fragment.xml @@ -15,7 +15,7 @@ --> <view xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - class="com.android.dialer.app.dialpad.DialpadFragment$DialpadSlidingRelativeLayout" + class="com.android.dialer.dialpadview.DialpadFragment$DialpadSlidingRelativeLayout" android:layout_width="match_parent" android:layout_height="wrap_content"> diff --git a/java/com/android/dialer/app/res/layout/dialpad_chooser_list_item.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_chooser_list_item.xml index e00529614..e00529614 100644 --- a/java/com/android/dialer/app/res/layout/dialpad_chooser_list_item.xml +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_chooser_list_item.xml diff --git a/java/com/android/dialer/app/res/layout/dialpad_fragment.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_fragment.xml index 9b95e1fbf..2f62e1407 100644 --- a/java/com/android/dialer/app/res/layout/dialpad_fragment.xml +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_fragment.xml @@ -15,7 +15,7 @@ --> <view xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - class="com.android.dialer.app.dialpad.DialpadFragment$DialpadSlidingRelativeLayout" + class="com.android.dialer.dialpadview.DialpadFragment$DialpadSlidingRelativeLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> diff --git a/java/com/android/dialer/app/res/menu/dialpad_options.xml b/java/com/android/dialer/dialpadview/res/menu/dialpad_options.xml index 2921ea3bb..2921ea3bb 100644 --- a/java/com/android/dialer/app/res/menu/dialpad_options.xml +++ b/java/com/android/dialer/dialpadview/res/menu/dialpad_options.xml diff --git a/java/com/android/dialer/dialpadview/res/values/dimens.xml b/java/com/android/dialer/dialpadview/res/values/dimens.xml index 187ec9afa..ac4c7b499 100644 --- a/java/com/android/dialer/dialpadview/res/values/dimens.xml +++ b/java/com/android/dialer/dialpadview/res/values/dimens.xml @@ -45,4 +45,7 @@ <!-- Top/Bottom padding around the ILD rate display box. --> <dimen name="ild_margin_height">10dp</dimen> + + <!-- Length of dialpad's shadows in dialer. --> + <dimen name="shadow_length">10dp</dimen> </resources> diff --git a/java/com/android/dialer/dialpadview/res/values/strings.xml b/java/com/android/dialer/dialpadview/res/values/strings.xml index 920e6e25c..b3e92f1d9 100644 --- a/java/com/android/dialer/dialpadview/res/values/strings.xml +++ b/java/com/android/dialer/dialpadview/res/values/strings.xml @@ -14,7 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<resources> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="dialpad_star_number" translatable="false">*</string> <string name="dialpad_pound_number" translatable="false">#</string> @@ -50,4 +50,61 @@ --> <string name="description_voicemail_button">voicemail</string> + <!-- String describing the Dial ImageButton + + Used by AccessibilityService to announce the purpose of the button. + --> + <string name="description_dial_button">dial</string> + + <!-- Dialog message which is shown when the user tries to check voicemail + while the system is in airplane mode. The user cannot access to + voicemail service in Airplane mode. [CHAR LIMI=NONE] --> + <string name="dialog_voicemail_airplane_mode_message">To call voicemail, first turn off Airplane mode.</string> + + <!-- Dialog message which is shown when the user tries to check voicemail + while the system isn't ready for the access. [CHAR LIMIT=NONE] --> + <string name="dialog_voicemail_not_ready_message">To set up voicemail, go to Menu > Settings.</string> + + <!-- Menu items for dialpad options as part of Pause and Wait ftr [CHAR LIMIT=30] --> + <string name="add_2sec_pause">Add 2-sec pause</string> + <string name="add_wait">Add wait</string> + + <!-- Item label: jump to the in-call DTMF dialpad. + (Part of a list of options shown in the dialer when another call + is already in progress.) --> + <string name="dialer_useDtmfDialpad">Use touch tone keypad</string> + + <!-- Item label: jump to the in-call UI. + (Part of a list of options shown in the dialer when another call + is already in progress.) --> + <string name="dialer_returnToInCallScreen">Return to call in progress</string> + + <!-- Item label: use the Dialer's keypad to add another call. + (Part of a list of options shown in the dialer when another call + is already in progress.) --> + <string name="dialer_addAnotherCall">Add call</string> + + <!-- The title of a dialog that displays the IMEI of the phone --> + <string name="imei">IMEI</string> + + <!-- The title of a dialog that displays the MEID of the CDMA phone --> + <string name="meid">MEID</string> + + <!-- Dialog text displayed when loading a phone number from the SIM card for speed dial --> + <string name="simContacts_emptyLoading">Loading from SIM card\u2026</string> + + <!-- Dialog title displayed when loading a phone number from the SIM card for speed dial --> + <string name="simContacts_title">SIM card contacts</string> + + <!-- Menu item used to call a contact, containing the number of the contact to call --> + <string name="menu_callNumber">Call <xliff:g id="number">%s</xliff:g></string> + + + <!-- Regular expression for prohibiting certain phone numbers in dialpad. + Ignored if empty. --> + <string name="config_prohibited_phone_number_regexp" translatable="false"></string> + + <!-- Dialog message which is shown when the user tries to make a phone call + to prohibited phone numbers [CHAR LIMIT=NONE] --> + <string msgid="4313552620858880999" name="dialog_phone_call_prohibited_message">Can\'t call this number</string> </resources> |