diff options
Diffstat (limited to 'java/com/android/dialer/dialpadview')
69 files changed, 1980 insertions, 0 deletions
diff --git a/java/com/android/dialer/dialpadview/AndroidManifest.xml b/java/com/android/dialer/dialpadview/AndroidManifest.xml new file mode 100644 index 000000000..011a004b0 --- /dev/null +++ b/java/com/android/dialer/dialpadview/AndroidManifest.xml @@ -0,0 +1,3 @@ +<manifest + package="com.android.dialer.dialpadview"> +</manifest> diff --git a/java/com/android/dialer/dialpadview/DialpadKeyButton.java b/java/com/android/dialer/dialpadview/DialpadKeyButton.java new file mode 100644 index 000000000..24ca9cc86 --- /dev/null +++ b/java/com/android/dialer/dialpadview/DialpadKeyButton.java @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.dialer.dialpadview; + +import android.content.Context; +import android.graphics.RectF; +import android.os.Bundle; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewConfiguration; +import android.view.accessibility.AccessibilityEvent; +import android.view.accessibility.AccessibilityManager; +import android.view.accessibility.AccessibilityNodeInfo; +import android.widget.FrameLayout; + +/** + * Custom class for dialpad buttons. + * + * <p>When touch exploration mode is enabled for accessibility, this class implements the + * lift-to-type interaction model: + * + * <ul> + * <li>Hovering over the button will cause it to gain accessibility focus + * <li>Removing the hover pointer while inside the bounds of the button will perform a click action + * <li>If long-click is supported, hovering over the button for a longer period of time will switch + * to the long-click action + * <li>Moving the hover pointer outside of the bounds of the button will restore to the normal click + * action + * <ul> + */ +public class DialpadKeyButton extends FrameLayout { + + /** Timeout before switching to long-click accessibility mode. */ + private static final int LONG_HOVER_TIMEOUT = ViewConfiguration.getLongPressTimeout() * 2; + + /** Accessibility manager instance used to check touch exploration state. */ + private AccessibilityManager mAccessibilityManager; + + /** Bounds used to filter HOVER_EXIT events. */ + private RectF mHoverBounds = new RectF(); + + /** Whether this view is currently in the long-hover state. */ + private boolean mLongHovered; + + /** Alternate content description for long-hover state. */ + private CharSequence mLongHoverContentDesc; + + /** Backup of standard content description. Used for accessibility. */ + private CharSequence mBackupContentDesc; + + /** Backup of clickable property. Used for accessibility. */ + private boolean mWasClickable; + + /** Backup of long-clickable property. Used for accessibility. */ + private boolean mWasLongClickable; + + /** Runnable used to trigger long-click mode for accessibility. */ + private Runnable mLongHoverRunnable; + + private OnPressedListener mOnPressedListener; + + public DialpadKeyButton(Context context, AttributeSet attrs) { + super(context, attrs); + initForAccessibility(context); + } + + public DialpadKeyButton(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + initForAccessibility(context); + } + + public void setOnPressedListener(OnPressedListener onPressedListener) { + mOnPressedListener = onPressedListener; + } + + private void initForAccessibility(Context context) { + mAccessibilityManager = + (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE); + } + + public void setLongHoverContentDescription(CharSequence contentDescription) { + mLongHoverContentDesc = contentDescription; + + if (mLongHovered) { + super.setContentDescription(mLongHoverContentDesc); + } + } + + @Override + public void setContentDescription(CharSequence contentDescription) { + if (mLongHovered) { + mBackupContentDesc = contentDescription; + } else { + super.setContentDescription(contentDescription); + } + } + + @Override + public void setPressed(boolean pressed) { + super.setPressed(pressed); + if (mOnPressedListener != null) { + mOnPressedListener.onPressed(this, pressed); + } + } + + @Override + public void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + + mHoverBounds.left = getPaddingLeft(); + mHoverBounds.right = w - getPaddingRight(); + mHoverBounds.top = getPaddingTop(); + mHoverBounds.bottom = h - getPaddingBottom(); + } + + @Override + public boolean performAccessibilityAction(int action, Bundle arguments) { + if (action == AccessibilityNodeInfo.ACTION_CLICK) { + simulateClickForAccessibility(); + return true; + } + + return super.performAccessibilityAction(action, arguments); + } + + @Override + public boolean onHoverEvent(MotionEvent event) { + // When touch exploration is turned on, lifting a finger while inside + // the button's hover target bounds should perform a click action. + if (mAccessibilityManager.isEnabled() && mAccessibilityManager.isTouchExplorationEnabled()) { + switch (event.getActionMasked()) { + case MotionEvent.ACTION_HOVER_ENTER: + // Lift-to-type temporarily disables double-tap activation. + mWasClickable = isClickable(); + mWasLongClickable = isLongClickable(); + if (mWasLongClickable && mLongHoverContentDesc != null) { + if (mLongHoverRunnable == null) { + mLongHoverRunnable = + new Runnable() { + @Override + public void run() { + setLongHovered(true); + announceForAccessibility(mLongHoverContentDesc); + } + }; + } + postDelayed(mLongHoverRunnable, LONG_HOVER_TIMEOUT); + } + + setClickable(false); + setLongClickable(false); + break; + case MotionEvent.ACTION_HOVER_EXIT: + if (mHoverBounds.contains(event.getX(), event.getY())) { + if (mLongHovered) { + performLongClick(); + } else { + simulateClickForAccessibility(); + } + } + + cancelLongHover(); + setClickable(mWasClickable); + setLongClickable(mWasLongClickable); + break; + } + } + + return super.onHoverEvent(event); + } + + /** + * When accessibility is on, simulate press and release to preserve the semantic meaning of + * performClick(). Required for Braille support. + */ + private void simulateClickForAccessibility() { + // Checking the press state prevents double activation. + if (isPressed()) { + return; + } + + setPressed(true); + + // Stay consistent with performClick() by sending the event after + // setting the pressed state but before performing the action. + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); + + setPressed(false); + } + + private void setLongHovered(boolean enabled) { + if (mLongHovered != enabled) { + mLongHovered = enabled; + + // Switch between normal and alternate description, if available. + if (enabled) { + mBackupContentDesc = getContentDescription(); + super.setContentDescription(mLongHoverContentDesc); + } else { + super.setContentDescription(mBackupContentDesc); + } + } + } + + private void cancelLongHover() { + if (mLongHoverRunnable != null) { + removeCallbacks(mLongHoverRunnable); + } + setLongHovered(false); + } + + public interface OnPressedListener { + + void onPressed(View view, boolean pressed); + } +} diff --git a/java/com/android/dialer/dialpadview/DialpadTextView.java b/java/com/android/dialer/dialpadview/DialpadTextView.java new file mode 100644 index 000000000..5b1b7bb5d --- /dev/null +++ b/java/com/android/dialer/dialpadview/DialpadTextView.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.dialpadview; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Rect; +import android.util.AttributeSet; +import android.widget.TextView; + +/** + * This is a custom text view intended only for rendering the numerals (and star and pound) on the + * dialpad. TextView has built in top/bottom padding to help account for ascenders/descenders. + * + * <p>Since vertical space is at a premium on the dialpad, particularly if the font size is scaled + * to a larger default, for the dialpad we use this class to more precisely render characters + * according to the precise amount of space they need. + */ +public class DialpadTextView extends TextView { + + private Rect mTextBounds = new Rect(); + private String mTextStr; + + public DialpadTextView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + /** Draw the text to fit within the height/width which have been specified during measurement. */ + @Override + public void draw(Canvas canvas) { + Paint paint = getPaint(); + + // Without this, the draw does not respect the style's specified text color. + paint.setColor(getCurrentTextColor()); + + // The text bounds values are relative and can be negative,, so rather than specifying a + // standard origin such as 0, 0, we need to use negative of the left/top bounds. + // For example, the bounds may be: Left: 11, Right: 37, Top: -77, Bottom: 0 + canvas.drawText(mTextStr, -mTextBounds.left, -mTextBounds.top, paint); + } + + /** + * Calculate the pixel-accurate bounds of the text when rendered, and use that to specify the + * height and width. + */ + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + mTextStr = getText().toString(); + getPaint().getTextBounds(mTextStr, 0, mTextStr.length(), mTextBounds); + + int width = resolveSize(mTextBounds.width(), widthMeasureSpec); + int height = resolveSize(mTextBounds.height(), heightMeasureSpec); + setMeasuredDimension(width, height); + } +} diff --git a/java/com/android/dialer/dialpadview/DialpadView.java b/java/com/android/dialer/dialpadview/DialpadView.java new file mode 100644 index 000000000..4a9b500b7 --- /dev/null +++ b/java/com/android/dialer/dialpadview/DialpadView.java @@ -0,0 +1,464 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.dialer.dialpadview; + +import android.animation.AnimatorListenerAdapter; +import android.content.Context; +import android.content.res.ColorStateList; +import android.content.res.Configuration; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.RippleDrawable; +import android.os.Build; +import android.text.Spannable; +import android.text.TextUtils; +import android.text.style.TtsSpan; +import android.util.AttributeSet; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.ViewPropertyAnimator; +import android.view.accessibility.AccessibilityManager; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.LinearLayout; +import android.widget.TextView; +import com.android.dialer.animation.AnimUtils; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; + +/** View that displays a twelve-key phone dialpad. */ +public class DialpadView extends LinearLayout { + + private static final String TAG = DialpadView.class.getSimpleName(); + + private static final double DELAY_MULTIPLIER = 0.66; + private static final double DURATION_MULTIPLIER = 0.8; + // For animation. + private static final int KEY_FRAME_DURATION = 33; + /** {@code True} if the dialpad is in landscape orientation. */ + private final boolean mIsLandscape; + /** {@code True} if the dialpad is showing in a right-to-left locale. */ + private final boolean mIsRtl; + + private final int[] mButtonIds = + new int[] { + R.id.zero, + R.id.one, + R.id.two, + R.id.three, + R.id.four, + R.id.five, + R.id.six, + R.id.seven, + R.id.eight, + R.id.nine, + R.id.star, + R.id.pound + }; + private EditText mDigits; + private ImageButton mDelete; + private View mOverflowMenuButton; + private ColorStateList mRippleColor; + private ViewGroup mRateContainer; + private TextView mIldCountry; + private TextView mIldRate; + private boolean mCanDigitsBeEdited; + private int mTranslateDistance; + + public DialpadView(Context context) { + this(context, null); + } + + public DialpadView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public DialpadView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Dialpad); + mRippleColor = a.getColorStateList(R.styleable.Dialpad_dialpad_key_button_touch_tint); + a.recycle(); + + mTranslateDistance = + getResources().getDimensionPixelSize(R.dimen.dialpad_key_button_translate_y); + + mIsLandscape = + getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; + mIsRtl = + TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL; + } + + @Override + protected void onFinishInflate() { + setupKeypad(); + mDigits = (EditText) findViewById(R.id.digits); + mDelete = (ImageButton) findViewById(R.id.deleteButton); + mOverflowMenuButton = findViewById(R.id.dialpad_overflow); + mRateContainer = (ViewGroup) findViewById(R.id.rate_container); + mIldCountry = (TextView) mRateContainer.findViewById(R.id.ild_country); + mIldRate = (TextView) mRateContainer.findViewById(R.id.ild_rate); + + AccessibilityManager accessibilityManager = + (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); + if (accessibilityManager.isEnabled()) { + // The text view must be selected to send accessibility events. + mDigits.setSelected(true); + } + } + + private void setupKeypad() { + final int[] letterIds = + new int[] { + R.string.dialpad_0_letters, + R.string.dialpad_1_letters, + R.string.dialpad_2_letters, + R.string.dialpad_3_letters, + R.string.dialpad_4_letters, + R.string.dialpad_5_letters, + R.string.dialpad_6_letters, + R.string.dialpad_7_letters, + R.string.dialpad_8_letters, + R.string.dialpad_9_letters, + R.string.dialpad_star_letters, + R.string.dialpad_pound_letters + }; + + final Resources resources = getContext().getResources(); + + DialpadKeyButton dialpadKey; + TextView numberView; + TextView lettersView; + + final Locale currentLocale = resources.getConfiguration().locale; + final NumberFormat nf; + // We translate dialpad numbers only for "fa" and not any other locale + // ("ar" anybody ?). + if ("fa".equals(currentLocale.getLanguage())) { + nf = DecimalFormat.getInstance(resources.getConfiguration().locale); + } else { + nf = DecimalFormat.getInstance(Locale.ENGLISH); + } + + for (int i = 0; i < mButtonIds.length; i++) { + dialpadKey = (DialpadKeyButton) findViewById(mButtonIds[i]); + numberView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_number); + lettersView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_letters); + + final String numberString; + final CharSequence numberContentDescription; + if (mButtonIds[i] == R.id.pound) { + numberString = resources.getString(R.string.dialpad_pound_number); + numberContentDescription = numberString; + } else if (mButtonIds[i] == R.id.star) { + numberString = resources.getString(R.string.dialpad_star_number); + numberContentDescription = numberString; + } else { + numberString = nf.format(i); + // The content description is used for Talkback key presses. The number is + // separated by a "," to introduce a slight delay. Convert letters into a verbatim + // span so that they are read as letters instead of as one word. + String letters = resources.getString(letterIds[i]); + Spannable spannable = + Spannable.Factory.getInstance().newSpannable(numberString + "," + letters); + spannable.setSpan( + (new TtsSpan.VerbatimBuilder(letters)).build(), + numberString.length() + 1, + numberString.length() + 1 + letters.length(), + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + numberContentDescription = spannable; + } + + final RippleDrawable rippleBackground = + (RippleDrawable) getDrawableCompat(getContext(), R.drawable.btn_dialpad_key); + if (mRippleColor != null) { + rippleBackground.setColor(mRippleColor); + } + + numberView.setText(numberString); + numberView.setElegantTextHeight(false); + dialpadKey.setContentDescription(numberContentDescription); + dialpadKey.setBackground(rippleBackground); + + if (lettersView != null) { + lettersView.setText(resources.getString(letterIds[i])); + } + } + + final DialpadKeyButton one = (DialpadKeyButton) findViewById(R.id.one); + one.setLongHoverContentDescription(resources.getText(R.string.description_voicemail_button)); + + final DialpadKeyButton zero = (DialpadKeyButton) findViewById(R.id.zero); + zero.setLongHoverContentDescription(resources.getText(R.string.description_image_button_plus)); + } + + private Drawable getDrawableCompat(Context context, int id) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + return context.getDrawable(id); + } else { + return context.getResources().getDrawable(id); + } + } + + public void setShowVoicemailButton(boolean show) { + View view = findViewById(R.id.dialpad_key_voicemail); + if (view != null) { + view.setVisibility(show ? View.VISIBLE : View.INVISIBLE); + } + } + + /** + * Whether or not the digits above the dialer can be edited. + * + * @param canBeEdited If true, the backspace button will be shown and the digits EditText will be + * configured to allow text manipulation. + */ + public void setCanDigitsBeEdited(boolean canBeEdited) { + View deleteButton = findViewById(R.id.deleteButton); + deleteButton.setVisibility(canBeEdited ? View.VISIBLE : View.INVISIBLE); + View overflowMenuButton = findViewById(R.id.dialpad_overflow); + overflowMenuButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE); + + EditText digits = (EditText) findViewById(R.id.digits); + digits.setClickable(canBeEdited); + digits.setLongClickable(canBeEdited); + digits.setFocusableInTouchMode(canBeEdited); + digits.setCursorVisible(false); + + mCanDigitsBeEdited = canBeEdited; + } + + public void setCallRateInformation(String countryName, String displayRate) { + if (TextUtils.isEmpty(countryName) && TextUtils.isEmpty(displayRate)) { + mRateContainer.setVisibility(View.GONE); + return; + } + mRateContainer.setVisibility(View.VISIBLE); + mIldCountry.setText(countryName); + mIldRate.setText(displayRate); + } + + public boolean canDigitsBeEdited() { + return mCanDigitsBeEdited; + } + + /** + * Always returns true for onHoverEvent callbacks, to fix problems with accessibility due to the + * dialpad overlaying other fragments. + */ + @Override + public boolean onHoverEvent(MotionEvent event) { + return true; + } + + public void animateShow() { + // This is a hack; without this, the setTranslationY is delayed in being applied, and the + // numbers appear at their original position (0) momentarily before animating. + final AnimatorListenerAdapter showListener = new AnimatorListenerAdapter() {}; + + for (int i = 0; i < mButtonIds.length; i++) { + int delay = (int) (getKeyButtonAnimationDelay(mButtonIds[i]) * DELAY_MULTIPLIER); + int duration = (int) (getKeyButtonAnimationDuration(mButtonIds[i]) * DURATION_MULTIPLIER); + final DialpadKeyButton dialpadKey = (DialpadKeyButton) findViewById(mButtonIds[i]); + + ViewPropertyAnimator animator = dialpadKey.animate(); + if (mIsLandscape) { + // Landscape orientation requires translation along the X axis. + // For RTL locales, ensure we translate negative on the X axis. + dialpadKey.setTranslationX((mIsRtl ? -1 : 1) * mTranslateDistance); + animator.translationX(0); + } else { + // Portrait orientation requires translation along the Y axis. + dialpadKey.setTranslationY(mTranslateDistance); + animator.translationY(0); + } + animator + .setInterpolator(AnimUtils.EASE_OUT_EASE_IN) + .setStartDelay(delay) + .setDuration(duration) + .setListener(showListener) + .start(); + } + } + + public EditText getDigits() { + return mDigits; + } + + public ImageButton getDeleteButton() { + return mDelete; + } + + public View getOverflowMenuButton() { + return mOverflowMenuButton; + } + + /** + * Get the animation delay for the buttons, taking into account whether the dialpad is in + * landscape left-to-right, landscape right-to-left, or portrait. + * + * @param buttonId The button ID. + * @return The animation delay. + */ + private int getKeyButtonAnimationDelay(int buttonId) { + if (mIsLandscape) { + if (mIsRtl) { + if (buttonId == R.id.three) { + return KEY_FRAME_DURATION * 1; + } else if (buttonId == R.id.six) { + return KEY_FRAME_DURATION * 2; + } else if (buttonId == R.id.nine) { + return KEY_FRAME_DURATION * 3; + } else if (buttonId == R.id.pound) { + return KEY_FRAME_DURATION * 4; + } else if (buttonId == R.id.two) { + return KEY_FRAME_DURATION * 5; + } else if (buttonId == R.id.five) { + return KEY_FRAME_DURATION * 6; + } else if (buttonId == R.id.eight) { + return KEY_FRAME_DURATION * 7; + } else if (buttonId == R.id.zero) { + return KEY_FRAME_DURATION * 8; + } else if (buttonId == R.id.one) { + return KEY_FRAME_DURATION * 9; + } else if (buttonId == R.id.four) { + return KEY_FRAME_DURATION * 10; + } else if (buttonId == R.id.seven || buttonId == R.id.star) { + return KEY_FRAME_DURATION * 11; + } + } else { + if (buttonId == R.id.one) { + return KEY_FRAME_DURATION * 1; + } else if (buttonId == R.id.four) { + return KEY_FRAME_DURATION * 2; + } else if (buttonId == R.id.seven) { + return KEY_FRAME_DURATION * 3; + } else if (buttonId == R.id.star) { + return KEY_FRAME_DURATION * 4; + } else if (buttonId == R.id.two) { + return KEY_FRAME_DURATION * 5; + } else if (buttonId == R.id.five) { + return KEY_FRAME_DURATION * 6; + } else if (buttonId == R.id.eight) { + return KEY_FRAME_DURATION * 7; + } else if (buttonId == R.id.zero) { + return KEY_FRAME_DURATION * 8; + } else if (buttonId == R.id.three) { + return KEY_FRAME_DURATION * 9; + } else if (buttonId == R.id.six) { + return KEY_FRAME_DURATION * 10; + } else if (buttonId == R.id.nine || buttonId == R.id.pound) { + return KEY_FRAME_DURATION * 11; + } + } + } else { + if (buttonId == R.id.one) { + return KEY_FRAME_DURATION * 1; + } else if (buttonId == R.id.two) { + return KEY_FRAME_DURATION * 2; + } else if (buttonId == R.id.three) { + return KEY_FRAME_DURATION * 3; + } else if (buttonId == R.id.four) { + return KEY_FRAME_DURATION * 4; + } else if (buttonId == R.id.five) { + return KEY_FRAME_DURATION * 5; + } else if (buttonId == R.id.six) { + return KEY_FRAME_DURATION * 6; + } else if (buttonId == R.id.seven) { + return KEY_FRAME_DURATION * 7; + } else if (buttonId == R.id.eight) { + return KEY_FRAME_DURATION * 8; + } else if (buttonId == R.id.nine) { + return KEY_FRAME_DURATION * 9; + } else if (buttonId == R.id.star) { + return KEY_FRAME_DURATION * 10; + } else if (buttonId == R.id.zero || buttonId == R.id.pound) { + return KEY_FRAME_DURATION * 11; + } + } + + Log.wtf(TAG, "Attempted to get animation delay for invalid key button id."); + return 0; + } + + /** + * Get the button animation duration, taking into account whether the dialpad is in landscape + * left-to-right, landscape right-to-left, or portrait. + * + * @param buttonId The button ID. + * @return The animation duration. + */ + private int getKeyButtonAnimationDuration(int buttonId) { + if (mIsLandscape) { + if (mIsRtl) { + if (buttonId == R.id.one + || buttonId == R.id.four + || buttonId == R.id.seven + || buttonId == R.id.star) { + return KEY_FRAME_DURATION * 8; + } else if (buttonId == R.id.two + || buttonId == R.id.five + || buttonId == R.id.eight + || buttonId == R.id.zero) { + return KEY_FRAME_DURATION * 9; + } else if (buttonId == R.id.three + || buttonId == R.id.six + || buttonId == R.id.nine + || buttonId == R.id.pound) { + return KEY_FRAME_DURATION * 10; + } + } else { + if (buttonId == R.id.one + || buttonId == R.id.four + || buttonId == R.id.seven + || buttonId == R.id.star) { + return KEY_FRAME_DURATION * 10; + } else if (buttonId == R.id.two + || buttonId == R.id.five + || buttonId == R.id.eight + || buttonId == R.id.zero) { + return KEY_FRAME_DURATION * 9; + } else if (buttonId == R.id.three + || buttonId == R.id.six + || buttonId == R.id.nine + || buttonId == R.id.pound) { + return KEY_FRAME_DURATION * 8; + } + } + } else { + if (buttonId == R.id.one + || buttonId == R.id.two + || buttonId == R.id.three + || buttonId == R.id.four + || buttonId == R.id.five + || buttonId == R.id.six) { + return KEY_FRAME_DURATION * 10; + } else if (buttonId == R.id.seven || buttonId == R.id.eight || buttonId == R.id.nine) { + return KEY_FRAME_DURATION * 9; + } else if (buttonId == R.id.star || buttonId == R.id.zero || buttonId == R.id.pound) { + return KEY_FRAME_DURATION * 8; + } + } + + Log.wtf(TAG, "Attempted to get animation duration for invalid key button id."); + return 0; + } +} diff --git a/java/com/android/dialer/dialpadview/DigitsEditText.java b/java/com/android/dialer/dialpadview/DigitsEditText.java new file mode 100644 index 000000000..4a4b9b4e2 --- /dev/null +++ b/java/com/android/dialer/dialpadview/DigitsEditText.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.dialer.dialpadview; + +import android.content.Context; +import android.graphics.Rect; +import android.text.InputType; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.inputmethod.InputMethodManager; +import com.android.dialer.widget.ResizingTextEditText; + +/** EditText which suppresses IME show up. */ +public class DigitsEditText extends ResizingTextEditText { + + public DigitsEditText(Context context, AttributeSet attrs) { + super(context, attrs); + setInputType(getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); + setShowSoftInputOnFocus(false); + } + + @Override + protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { + super.onFocusChanged(focused, direction, previouslyFocusedRect); + final InputMethodManager imm = + ((InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE)); + if (imm != null && imm.isActive(this)) { + imm.hideSoftInputFromWindow(getApplicationWindowToken(), 0); + } + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + final boolean ret = super.onTouchEvent(event); + // Must be done after super.onTouchEvent() + final InputMethodManager imm = + ((InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE)); + if (imm != null && imm.isActive(this)) { + imm.hideSoftInputFromWindow(getApplicationWindowToken(), 0); + } + return ret; + } +} diff --git a/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_bottom.xml b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_bottom.xml new file mode 100644 index 000000000..4efa80d86 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_bottom.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="@integer/dialpad_slide_in_duration" + android:fromYDelta="100%p" + android:toYDelta="0"/> diff --git a/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_left.xml b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_left.xml new file mode 100644 index 000000000..4e5a2053c --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_left.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="@integer/dialpad_slide_in_duration" + android:fromXDelta="-100%p" + android:toXDelta="0"/> diff --git a/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_right.xml b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_right.xml new file mode 100644 index 000000000..5a6dfaa79 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_in_right.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (c) 2014, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="@integer/dialpad_slide_in_duration" + android:fromXDelta="100%p" + android:toXDelta="0"/> diff --git a/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_bottom.xml b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_bottom.xml new file mode 100644 index 000000000..01ac48247 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_bottom.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="@integer/dialpad_slide_out_duration" + android:fromYDelta="0" + android:toYDelta="100%p"/> diff --git a/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_left.xml b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_left.xml new file mode 100644 index 000000000..5ac1d290f --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_left.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="@integer/dialpad_slide_out_duration" + android:fromXDelta="0" + android:toXDelta="-100%"/> diff --git a/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_right.xml b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_right.xml new file mode 100644 index 000000000..5f5690232 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/anim/dialpad_slide_out_right.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (c) 2014, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<translate xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="@integer/dialpad_slide_out_duration" + android:fromXDelta="0" + android:toXDelta="100%"/> diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/dialer_fab.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/dialer_fab.png Binary files differnew file mode 100644 index 000000000..3380a899d --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/dialer_fab.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/fab_green.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/fab_green.png Binary files differnew file mode 100644 index 000000000..ff9753c18 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/fab_green.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/fab_ic_call.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/fab_ic_call.png Binary files differnew file mode 100644 index 000000000..7bf83fa6a --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/fab_ic_call.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_close_black_24dp.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_close_black_24dp.png Binary files differnew file mode 100644 index 000000000..1a9cd75a0 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_close_black_24dp.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialpad_delete.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialpad_delete.png Binary files differnew file mode 100644 index 000000000..e588d90e9 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialpad_delete.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialpad_voicemail.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialpad_voicemail.png Binary files differnew file mode 100644 index 000000000..4706112d6 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_dialpad_voicemail.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_overflow_menu.png b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_overflow_menu.png Binary files differnew file mode 100644 index 000000000..262e9df91 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-hdpi/ic_overflow_menu.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/dialer_fab.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/dialer_fab.png Binary files differnew file mode 100644 index 000000000..46630d430 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/dialer_fab.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/fab_green.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/fab_green.png Binary files differnew file mode 100644 index 000000000..947aac142 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/fab_green.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/fab_ic_call.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/fab_ic_call.png Binary files differnew file mode 100644 index 000000000..790f93590 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/fab_ic_call.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_close_black_24dp.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_close_black_24dp.png Binary files differnew file mode 100644 index 000000000..40a1a84e3 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_close_black_24dp.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialpad_delete.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialpad_delete.png Binary files differnew file mode 100644 index 000000000..64a52d030 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialpad_delete.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialpad_voicemail.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialpad_voicemail.png Binary files differnew file mode 100644 index 000000000..e84d8f4a8 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_dialpad_voicemail.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_overflow_menu.png b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_overflow_menu.png Binary files differnew file mode 100644 index 000000000..0e720ddbd --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-mdpi/ic_overflow_menu.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/dialer_fab.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/dialer_fab.png Binary files differnew file mode 100644 index 000000000..5dafee092 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/dialer_fab.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/fab_green.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/fab_green.png Binary files differnew file mode 100644 index 000000000..e8bab3fec --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/fab_green.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/fab_ic_call.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/fab_ic_call.png Binary files differnew file mode 100644 index 000000000..6bd53f5c5 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/fab_ic_call.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_close_black_24dp.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_close_black_24dp.png Binary files differnew file mode 100644 index 000000000..6bc437298 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_close_black_24dp.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialpad_delete.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialpad_delete.png Binary files differnew file mode 100644 index 000000000..87bc11364 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialpad_delete.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialpad_voicemail.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialpad_voicemail.png Binary files differnew file mode 100644 index 000000000..0b4e18389 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_dialpad_voicemail.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_overflow_menu.png b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_overflow_menu.png Binary files differnew file mode 100644 index 000000000..915607633 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xhdpi/ic_overflow_menu.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/dialer_fab.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/dialer_fab.png Binary files differnew file mode 100644 index 000000000..2b0dba7bc --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/dialer_fab.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/fab_green.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/fab_green.png Binary files differnew file mode 100644 index 000000000..7e4fd3e49 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/fab_green.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/fab_ic_call.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/fab_ic_call.png Binary files differnew file mode 100644 index 000000000..6866fa430 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/fab_ic_call.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_close_black_24dp.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_close_black_24dp.png Binary files differnew file mode 100644 index 000000000..51b4401ca --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_close_black_24dp.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialpad_delete.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialpad_delete.png Binary files differnew file mode 100644 index 000000000..186508a9f --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialpad_delete.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialpad_voicemail.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialpad_voicemail.png Binary files differnew file mode 100644 index 000000000..a0a7c9d28 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_dialpad_voicemail.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_overflow_menu.png b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_overflow_menu.png Binary files differnew file mode 100644 index 000000000..92526f5a6 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxhdpi/ic_overflow_menu.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/dialer_fab.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/dialer_fab.png Binary files differnew file mode 100644 index 000000000..59d9b9506 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/dialer_fab.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/fab_green.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/fab_green.png Binary files differnew file mode 100644 index 000000000..aa8849e86 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/fab_green.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/fab_ic_call.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/fab_ic_call.png Binary files differnew file mode 100644 index 000000000..7af3396b4 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/fab_ic_call.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_close_black_24dp.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_close_black_24dp.png Binary files differnew file mode 100644 index 000000000..df42feecb --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_close_black_24dp.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_dialpad_delete.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_dialpad_delete.png Binary files differnew file mode 100644 index 000000000..c974a8005 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_dialpad_delete.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_dialpad_voicemail.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_dialpad_voicemail.png Binary files differnew file mode 100644 index 000000000..c6e8be023 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_dialpad_voicemail.png diff --git a/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_overflow_menu.png b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_overflow_menu.png Binary files differnew file mode 100644 index 000000000..9028bd437 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable-xxxhdpi/ic_overflow_menu.png diff --git a/java/com/android/dialer/dialpadview/res/drawable/btn_dialpad_key.xml b/java/com/android/dialer/dialpadview/res/drawable/btn_dialpad_key.xml new file mode 100644 index 000000000..53cd7a85d --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable/btn_dialpad_key.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<ripple xmlns:android="http://schemas.android.com/apk/res/android" + android:color="?android:attr/colorControlHighlight"/>
\ No newline at end of file diff --git a/java/com/android/dialer/dialpadview/res/drawable/dialpad_scrim.xml b/java/com/android/dialer/dialpadview/res/drawable/dialpad_scrim.xml new file mode 100644 index 000000000..ee0f40ab5 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/drawable/dialpad_scrim.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <gradient + android:angle="270" + android:endColor="@android:color/darker_gray" + android:startColor="@android:color/transparent"/> +</shape> diff --git a/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key.xml b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key.xml new file mode 100644 index 000000000..941fdb2ec --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- A layout representing a single key in the dialpad --> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + style="@style/DialpadKeyButtonStyle"> + + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle" + android:layout_gravity="right|center_vertical" + android:baselineAligned="false" + android:orientation="horizontal"> + + <!-- Note in the referenced styles that we assign hard widths to these components + because we want them to line up vertically when we arrange them in an MxN grid --> + + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadKeyNumberStyle" + android:layout_marginBottom="0dp" + android:layout_marginRight="@dimen/dialpad_key_margin_right" + android:layout_gravity="right"/> + + <TextView + android:id="@+id/dialpad_key_letters" + style="@style/DialpadKeyLettersStyle" + android:layout_width="@dimen/dialpad_key_text_width" + android:layout_gravity="right|center"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_one.xml b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_one.xml new file mode 100644 index 000000000..65a2308fc --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_one.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/one" + style="@style/DialpadKeyButtonStyle"> + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle" + android:layout_gravity="right|center_vertical" + android:baselineAligned="false" + android:orientation="horizontal"> + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadKeyNumberStyle" + android:layout_marginBottom="0dp" + android:layout_marginRight="@dimen/dialpad_key_one_margin_right" + android:layout_gravity="right"/> + <FrameLayout + android:layout_width="@dimen/dialpad_key_text_width" + android:layout_height="wrap_content" + android:layout_gravity="left|center"> + <ImageView + android:id="@+id/dialpad_key_voicemail" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:scaleType="fitCenter" + android:src="@drawable/ic_dialpad_voicemail" + android:tint="@color/dialpad_voicemail_tint"/> + </FrameLayout> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_pound.xml b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_pound.xml new file mode 100644 index 000000000..98c353128 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_pound.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/pound" + style="@style/DialpadKeyButtonStyle"> + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle" + android:layout_gravity="center_vertical|right" + android:orientation="horizontal"> + <com.android.dialer.dialpadview.DialpadTextView + android:id="@id/dialpad_key_number" + style="@style/DialpadKeyPoundStyle" + android:layout_width="@dimen/dialpad_key_number_width" + android:layout_marginRight="@dimen/dialpad_key_margin_right"/> + <View + style="@style/DialpadKeyLettersStyle" + android:layout_width="@dimen/dialpad_key_text_width"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_star.xml b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_star.xml new file mode 100644 index 000000000..b91c71680 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_star.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/star" + style="@style/DialpadKeyButtonStyle"> + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle" + android:layout_gravity="center_vertical|right" + android:orientation="horizontal"> + <com.android.dialer.dialpadview.DialpadTextView + android:id="@id/dialpad_key_number" + style="@style/DialpadKeyStarStyle" + android:layout_width="@dimen/dialpad_key_number_width" + android:layout_marginRight="@dimen/dialpad_key_margin_right"/> + <View + style="@style/DialpadKeyLettersStyle" + android:layout_width="@dimen/dialpad_key_text_width"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_zero.xml b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_zero.xml new file mode 100644 index 000000000..d885ddf05 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout-land/dialpad_key_zero.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- A layout representing the zero key in the dialpad, with the plus sign shifted up because it is + smaller than a regular letter --> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/zero" + style="@style/DialpadKeyButtonStyle"> + + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle" + android:layout_gravity="right|center_vertical" + android:baselineAligned="false" + android:orientation="horizontal"> + + <!-- Note in the referenced styles that we assign hard widths to these components + because we want them to line up vertically when we arrange them in an MxN grid --> + + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadBottomKeyNumberStyle" + android:layout_marginBottom="0dp" + android:layout_marginRight="@dimen/dialpad_key_margin_right"/> + + <TextView + android:id="@+id/dialpad_key_letters" + style="@style/DialpadKeyLettersStyle" + android:layout_width="@dimen/dialpad_key_text_width"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad.xml new file mode 100644 index 000000000..5a14d14ea --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2006 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- Dialpad in the Phone app. --> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/dialpad" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipChildren="false" + android:orientation="vertical"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:orientation="horizontal"> + <Space style="@style/DialpadSpaceStyle"/> + <include layout="@layout/dialpad_key_one"/> + <include + android:id="@+id/two" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <include + android:id="@+id/three" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <Space style="@style/DialpadSpaceStyle"/> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:orientation="horizontal"> + <Space style="@style/DialpadSpaceStyle"/> + <include + android:id="@+id/four" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <include + android:id="@+id/five" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <include + android:id="@+id/six" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <Space style="@style/DialpadSpaceStyle"/> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:orientation="horizontal"> + <Space style="@style/DialpadSpaceStyle"/> + <include + android:id="@+id/seven" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <include + android:id="@+id/eight" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <include + android:id="@+id/nine" + style="@style/DialpadKeyButtonStyle" + layout="@layout/dialpad_key"/> + <Space style="@style/DialpadSpaceStyle"/> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:orientation="horizontal"> + <Space style="@style/DialpadSpaceStyle"/> + <include layout="@layout/dialpad_key_star"/> + <include layout="@layout/dialpad_key_zero"/> + <include layout="@layout/dialpad_key_pound"/> + <Space style="@style/DialpadSpaceStyle"/> + </LinearLayout> + <Space + android:layout_width="match_parent" + android:layout_height="?attr/dialpad_end_key_spacing"/> +</LinearLayout> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_key.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_key.xml new file mode 100644 index 000000000..77e4fc53a --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_key.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- A layout representing a single key in the dialpad --> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + style="@style/DialpadKeyButtonStyle"> + + <LinearLayout style="@style/DialpadKeyInternalLayoutStyle"> + + <!-- Note in the referenced styles that we assign hard widths to these components + because we want them to line up vertically when we arrange them in an MxN grid --> + + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadKeyNumberStyle"/> + + <TextView + android:id="@+id/dialpad_key_letters" + style="@style/DialpadKeyLettersStyle"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_key_one.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_one.xml new file mode 100644 index 000000000..36f62c85d --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_one.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2006 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/one" + style="@style/DialpadKeyButtonStyle"> + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle"> + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadKeyNumberStyle"/> + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + <ImageView + android:id="@+id/dialpad_key_voicemail" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:paddingTop="@dimen/dialpad_voicemail_icon_padding_top" + android:scaleType="fitCenter" + android:src="@drawable/ic_dialpad_voicemail" + android:tint="?attr/dialpad_voicemail_tint"/> + <!-- Place empty text view so vertical height is same as other dialpad keys. --> + <TextView style="@style/DialpadKeyLettersStyle"/> + </RelativeLayout> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_key_pound.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_pound.xml new file mode 100644 index 000000000..d37a6aa78 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_pound.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2006 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/pound" + style="@style/DialpadKeyButtonStyle"> + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle"> + <com.android.dialer.dialpadview.DialpadTextView + android:id="@id/dialpad_key_number" + style="@style/DialpadKeyPoundStyle"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_key_star.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_star.xml new file mode 100644 index 000000000..d288475d0 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_star.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2006 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/star" + style="@style/DialpadKeyButtonStyle"> + <LinearLayout + style="@style/DialpadKeyInternalLayoutStyle"> + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadKeyStarStyle"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_key_zero.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_zero.xml new file mode 100644 index 000000000..943ae48dd --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_key_zero.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- A layout representing the zero key in the dialpad, with the plus sign shifted up because it is + smaller than a regular letter --> +<com.android.dialer.dialpadview.DialpadKeyButton + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/zero" + style="@style/DialpadKeyButtonStyle"> + + <LinearLayout style="@style/DialpadKeyInternalLayoutStyle"> + + <!-- Note in the referenced styles that we assign hard widths to these components + because we want them to line up vertically when we arrange them in an MxN grid --> + + <com.android.dialer.dialpadview.DialpadTextView + android:id="@+id/dialpad_key_number" + style="@style/DialpadBottomKeyNumberStyle"/> + + <TextView + android:id="@+id/dialpad_key_letters" + style="@style/DialpadKeyLettersStyle"/> + </LinearLayout> +</com.android.dialer.dialpadview.DialpadKeyButton> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_view.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_view.xml new file mode 100644 index 000000000..47112fbb1 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_view.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:theme="?attr/dialpad_style"> + <include layout="@layout/dialpad_view_unthemed"/> +</FrameLayout> diff --git a/java/com/android/dialer/dialpadview/res/layout/dialpad_view_unthemed.xml b/java/com/android/dialer/dialpadview/res/layout/dialpad_view_unthemed.xml new file mode 100644 index 000000000..4b08c6de7 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/layout/dialpad_view_unthemed.xml @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<view xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/dialpad_view" + class="com.android.dialer.dialpadview.DialpadView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="bottom" + android:background="?attr/dialpad_background" + android:clickable="true" + android:layoutDirection="ltr" + android:orientation="vertical"> + + <!-- Text field where call rate is displayed for ILD calls. --> + <LinearLayout + android:id="@+id/rate_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:visibility="gone"> + + <LinearLayout + android:id="@+id/ild_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/ild_margin_height" + android:layout_marginBottom="@dimen/ild_margin_height" + android:layout_gravity="center_horizontal" + android:orientation="horizontal"> + + <TextView + android:id="@+id/ild_country" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> + + <TextView + android:id="@+id/ild_rate" + android:textStyle="bold" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="4dp"/> + + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#e3e3e3"/> + + </LinearLayout> + + <!-- Text field and possibly soft menu button above the keypad where + the digits are displayed. --> + <LinearLayout + android:id="@+id/digits_container" + android:layout_width="match_parent" + android:layout_height="?attr/dialpad_digits_adjustable_height" + android:orientation="horizontal"> + + <ImageButton + android:id="@+id/dialpad_back" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_margin="@dimen/dialpad_overflow_margin" + android:paddingLeft="@dimen/dialpad_digits_menu_left_padding" + android:paddingRight="@dimen/dialpad_digits_menu_right_padding" + android:background="@drawable/btn_dialpad_key" + android:contentDescription="@string/description_dialpad_back" + android:gravity="center" + android:src="@drawable/ic_close_black_24dp" + android:tint="?attr/dialpad_icon_tint" + android:tintMode="src_in" + android:visibility="gone"/> + + <ImageButton + android:id="@+id/dialpad_overflow" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_margin="@dimen/dialpad_overflow_margin" + android:paddingLeft="@dimen/dialpad_digits_menu_left_padding" + android:paddingRight="@dimen/dialpad_digits_menu_right_padding" + android:background="@drawable/btn_dialpad_key" + android:contentDescription="@string/description_dialpad_overflow" + android:gravity="center" + android:src="@drawable/ic_overflow_menu" + android:tint="?attr/dialpad_icon_tint" + android:tintMode="src_in" + android:visibility="gone"/> + + <view xmlns:ex="http://schemas.android.com/apk/res-auto" + android:id="@+id/digits" + class="com.android.dialer.dialpadview.DigitsEditText" + android:textStyle="normal" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@android:color/transparent" + android:cursorVisible="false" + android:focusableInTouchMode="true" + android:fontFamily="sans-serif" + android:freezesText="true" + android:gravity="center" + android:maxLines="1" + android:scrollHorizontally="true" + android:singleLine="true" + android:textColor="?attr/dialpad_text_color" + android:textCursorDrawable="@null" + android:textSize="?attr/dialpad_digits_adjustable_text_size" + ex:resizing_text_min_size="@dimen/dialpad_digits_text_min_size"/> + + <ImageButton + android:id="@+id/deleteButton" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingLeft="@dimen/dialpad_digits_padding" + android:paddingRight="@dimen/dialpad_digits_padding" + android:background="@drawable/btn_dialpad_key" + android:contentDescription="@string/description_delete_button" + android:src="@drawable/ic_dialpad_delete" + android:state_enabled="false" + android:tint="?attr/dialpad_icon_tint" + android:tintMode="src_in"/> + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#e3e3e3"/> + + <Space + android:layout_width="match_parent" + android:layout_height="@dimen/dialpad_space_above_keys"/> + + <include layout="@layout/dialpad"/> + + <Space + android:layout_width="match_parent" + android:layout_height="@dimen/dialpad_space_below_keys"/> + +</view> diff --git a/java/com/android/dialer/dialpadview/res/values-land/dimens.xml b/java/com/android/dialer/dialpadview/res/values-land/dimens.xml new file mode 100644 index 000000000..617134ad4 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values-land/dimens.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<resources> + <dimen name="dialpad_key_margin_right">5dp</dimen> + <!-- Right margins for specific keys to align them correctly --> + <dimen name="dialpad_key_one_margin_right">3dp</dimen> + <dimen name="dialpad_key_text_width">35dp</dimen> + <dimen name="dialpad_key_number_width">20sp</dimen> + <dimen name="dialpad_symbol_margin_bottom">0dp</dimen> + + <!-- The bottom space of the dialpad to account for the dial button --> + <dimen name="dialpad_bottom_space_height">65dp</dimen> +</resources> diff --git a/java/com/android/dialer/dialpadview/res/values-land/styles.xml b/java/com/android/dialer/dialpadview/res/values-land/styles.xml new file mode 100644 index 000000000..f98372509 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values-land/styles.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<resources> + + <style name="DialpadKeyNumberStyle"> + <item name="android:textColor">?attr/dialpad_text_color_primary</item> + <item name="android:textSize">?attr/dialpad_key_numbers_size</item> + <item name="android:fontFamily">sans-serif-light</item> + <item name="android:layout_width">@dimen/dialpad_key_number_width</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_marginBottom">?attr/dialpad_key_number_margin_bottom</item> + </style> + + <style name="DialpadKeyLettersStyle"> + <item name="android:textColor">?attr/dialpad_text_color_secondary</item> + <item name="android:textSize">@dimen/dialpad_key_letters_size</item> + <item name="android:fontFamily">sans-serif-regular</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:gravity">left</item> + </style> +</resources> diff --git a/java/com/android/dialer/dialpadview/res/values/animation_constants.xml b/java/com/android/dialer/dialpadview/res/values/animation_constants.xml new file mode 100644 index 000000000..edd19d755 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values/animation_constants.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2014 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + <integer name="dialpad_slide_in_duration">400</integer> + <integer name="dialpad_slide_out_duration">400</integer> +</resources> diff --git a/java/com/android/dialer/dialpadview/res/values/attrs.xml b/java/com/android/dialer/dialpadview/res/values/attrs.xml new file mode 100644 index 000000000..273879f3e --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values/attrs.xml @@ -0,0 +1,39 @@ +<!-- + ~ Copyright (C) 2012 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<resources> + + <attr format="reference" name="dialpad_style"/> + <attr format="dimension" name="dialpad_end_key_spacing"/> + + <declare-styleable name="Dialpad"> + <attr format="color" name="dialpad_key_button_touch_tint"/> + <attr format="dimension" name="dialpad_digits_adjustable_text_size"/> + <attr format="dimension" name="dialpad_digits_adjustable_height"/> + <attr format="dimension" name="dialpad_key_numbers_size"/> + <attr format="dimension" name="dialpad_key_number_margin_bottom"/> + <attr format="dimension" name="dialpad_zero_key_number_margin_bottom"/> + </declare-styleable> + + <declare-styleable name="Theme.Dialpad"> + <attr format="color" name="dialpad_text_color"/> + <attr format="color" name="dialpad_text_color_primary"/> + <attr format="color" name="dialpad_text_color_secondary"/> + <attr format="color" name="dialpad_icon_tint"/> + <attr format="color" name="dialpad_voicemail_tint"/> + <attr format="color" name="dialpad_background"/> + </declare-styleable> +</resources> diff --git a/java/com/android/dialer/dialpadview/res/values/colors.xml b/java/com/android/dialer/dialpadview/res/values/colors.xml new file mode 100644 index 000000000..d27468db7 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values/colors.xml @@ -0,0 +1,27 @@ +<!-- + ~ Copyright (C) 2012 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<resources> + <!-- Colors for the dialpad --> + <color name="background_dialpad">#fcfcfc</color> + <color name="background_dialpad_pressed">#ececec</color> + <color name="dialpad_primary_text_color">@color/dialer_theme_color</color> + <color name="dialpad_secondary_text_color">#737373</color> + <color name="dialpad_digits_text_color">#333</color> + <color name="dialpad_separator_line_color">#dadada</color> + <color name="dialpad_icon_tint">#89000000</color> + <color name="dialpad_voicemail_tint">#919191</color> +</resources> diff --git a/java/com/android/dialer/dialpadview/res/values/dimens.xml b/java/com/android/dialer/dialpadview/res/values/dimens.xml new file mode 100644 index 000000000..210c81697 --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values/dimens.xml @@ -0,0 +1,48 @@ +<!-- + ~ Copyright (C) 2012 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<resources> + <!-- Text dimensions for dialpad keys --> + <dimen name="dialpad_key_numbers_default_size">36sp</dimen> + <dimen name="dialpad_key_letters_size">12sp</dimen> + <dimen name="dialpad_key_pound_size">23sp</dimen> + <dimen name="dialpad_key_star_size">36sp</dimen> + <dimen name="dialpad_key_height">64dp</dimen> + <dimen name="dialpad_key_number_default_margin_bottom">3dp</dimen> + <!-- Zero key should have less space between self and text because "+" is smaller --> + <dimen name="dialpad_zero_key_number_default_margin_bottom">1dp</dimen> + <dimen name="dialpad_symbol_margin_bottom">13dp</dimen> + <dimen name="dialpad_key_plus_size">18sp</dimen> + <dimen name="dialpad_horizontal_padding">5dp</dimen> + <dimen name="dialpad_digits_text_size">34sp</dimen> + <dimen name="dialpad_digits_text_min_size">24sp</dimen> + <dimen name="dialpad_digits_height">60dp</dimen> + <dimen name="dialpad_digits_padding">16dp</dimen> + <dimen name="dialpad_digits_menu_left_padding">8dp</dimen> + <dimen name="dialpad_digits_menu_right_padding">10dp</dimen> + <dimen name="dialpad_center_margin">3dp</dimen> + <dimen name="dialpad_button_margin">2dp</dimen> + <dimen name="dialpad_voicemail_icon_padding_top">2dp</dimen> + <dimen name="dialpad_key_button_translate_y">100dp</dimen> + <dimen name="dialpad_overflow_margin">8dp</dimen> + <dimen name="dialpad_space_above_keys">14dp</dimen> + <dimen name="dialpad_space_below_keys">8dp</dimen> + <!-- The bottom space of the dialpad to account for the dial button --> + <dimen name="dialpad_bottom_space_height">80dp</dimen> + + <!-- Top/Bottom padding around the ILD rate display box. --> + <dimen name="ild_margin_height">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 new file mode 100644 index 000000000..920e6e25c --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values/strings.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2012 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + <string name="dialpad_star_number" translatable="false">*</string> + <string name="dialpad_pound_number" translatable="false">#</string> + + <string name="dialpad_0_letters" translatable="false">+</string> + <string name="dialpad_1_letters" translatable="false"></string> + <string name="dialpad_2_letters" translatable="false">ABC</string> + <string name="dialpad_3_letters" translatable="false">DEF</string> + <string name="dialpad_4_letters" translatable="false">GHI</string> + <string name="dialpad_5_letters" translatable="false">JKL</string> + <string name="dialpad_6_letters" translatable="false">MNO</string> + <string name="dialpad_7_letters" translatable="false">PQRS</string> + <string name="dialpad_8_letters" translatable="false">TUV</string> + <string name="dialpad_9_letters" translatable="false">WXYZ</string> + <string name="dialpad_star_letters" translatable="false"></string> + <string name="dialpad_pound_letters" translatable="false"></string> + + <!-- String describing the back button in the dialpad. --> + <string name="description_dialpad_back">Navigate back</string> + + <!-- String describing the overflow menu button in the dialpad. --> + <string name="description_dialpad_overflow">More options</string> + + <!-- String describing the Delete/Backspace ImageButton. + Used by AccessibilityService to announce the purpose of the button. + --> + <string name="description_delete_button">backspace</string> + + <!-- String describing the button used to add a plus (+) symbol to the dialpad --> + <string name="description_image_button_plus">plus</string> + + <!-- String describing the Voicemail ImageButton. + Used by AccessibilityService to announce the purpose of the button. + --> + <string name="description_voicemail_button">voicemail</string> + +</resources> diff --git a/java/com/android/dialer/dialpadview/res/values/styles.xml b/java/com/android/dialer/dialpadview/res/values/styles.xml new file mode 100644 index 000000000..2fa2c3f2e --- /dev/null +++ b/java/com/android/dialer/dialpadview/res/values/styles.xml @@ -0,0 +1,118 @@ +<!-- + ~ Copyright (C) 2012 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + +<resources> + + <style name="DialpadSpaceStyle"> + <item name="android:layout_width">0dp</item> + <item name="android:layout_height">match_parent</item> + <item name="android:layout_weight">3</item> + </style> + + <style name="DialpadKeyNumberStyle"> + <item name="android:textColor">?attr/dialpad_text_color_primary</item> + <item name="android:textSize">?attr/dialpad_key_numbers_size</item> + <item name="android:fontFamily">sans-serif-light</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_marginBottom">?attr/dialpad_key_number_margin_bottom</item> + <item name="android:gravity">center</item> + </style> + + <style name="DialpadBottomKeyNumberStyle" parent="DialpadKeyNumberStyle"> + <item name="android:layout_marginBottom">?attr/dialpad_zero_key_number_margin_bottom</item> + </style> + + <style name="DialpadKeyStarStyle"> + <item name="android:textColor">?attr/dialpad_text_color_secondary</item> + <item name="android:textSize">@dimen/dialpad_key_star_size</item> + <item name="android:fontFamily">sans-serif-light</item> + <item name="android:alpha">0.8</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_marginBottom">@dimen/dialpad_symbol_margin_bottom</item> + <item name="android:gravity">center</item> + </style> + + <style name="DialpadKeyPoundStyle"> + <item name="android:textColor">?attr/dialpad_text_color_secondary</item> + <item name="android:textSize">@dimen/dialpad_key_pound_size</item> + <item name="android:fontFamily">sans-serif-light</item> + <item name="android:alpha">0.8</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_marginBottom">@dimen/dialpad_symbol_margin_bottom</item> + <item name="android:gravity">center</item> + </style> + + <style name="DialpadKeyLettersStyle"> + <item name="android:textColor">?attr/dialpad_text_color_secondary</item> + <item name="android:textSize">@dimen/dialpad_key_letters_size</item> + <item name="android:fontFamily">sans-serif-regular</item> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:gravity">center_horizontal</item> + </style> + + <style name="DialpadKeyButtonStyle"> + <item name="android:soundEffectsEnabled">false</item> + <item name="android:clickable">true</item> + <item name="android:layout_width">0dp</item> + <item name="android:layout_height">match_parent</item> + <item name="android:layout_weight">13</item> + <item name="android:minHeight">@dimen/dialpad_key_height</item> + <item name="android:background">@drawable/btn_dialpad_key</item> + <item name="android:focusable">true</item> + </style> + + <style name="DialpadKeyInternalLayoutStyle"> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_gravity">center</item> + <item name="android:gravity">center</item> + <item name="android:orientation">vertical</item> + </style> + + <style name="Dialpad"> + <item name="dialpad_digits_adjustable_height">@dimen/dialpad_digits_height</item> + <item name="dialpad_digits_adjustable_text_size">@dimen/dialpad_digits_text_size</item> + <item name="dialpad_key_numbers_size">@dimen/dialpad_key_numbers_default_size</item> + <item name="dialpad_key_number_margin_bottom">@dimen/dialpad_key_number_default_margin_bottom + </item> + <item name="dialpad_zero_key_number_margin_bottom"> + @dimen/dialpad_zero_key_number_default_margin_bottom + </item> + <item name="dialpad_end_key_spacing">@dimen/dialpad_bottom_space_height</item> + </style> + + <style name="Dialpad.Light"> + <item name="dialpad_text_color">@color/dialpad_digits_text_color</item> + <item name="dialpad_text_color_primary">@color/dialpad_primary_text_color</item> + <item name="dialpad_text_color_secondary">@color/dialpad_secondary_text_color</item> + <item name="dialpad_icon_tint">@color/dialpad_icon_tint</item> + <item name="dialpad_voicemail_tint">@color/dialpad_voicemail_tint</item> + <item name="dialpad_background">@color/background_dialpad</item> + </style> + + <style name="Dialpad.Dark"> + <item name="dialpad_text_color">@android:color/white</item> + <item name="dialpad_text_color_primary">@android:color/white</item> + <item name="dialpad_text_color_secondary">#ffd4d6d7</item> + <item name="dialpad_icon_tint">@android:color/white</item> + <item name="dialpad_voicemail_tint">?attr/dialpad_text_color_secondary</item> + <item name="dialpad_background">#00000000</item> + </style> +</resources> |