am 8c258ac5: Generalize the device IMEI display for IMEI/MEID and multi-SIM.
* commit '8c258ac5eee9d1e0c3f8a4d895dda84a2c9ac71a':
Generalize the device IMEI display for IMEI/MEID and multi-SIM.
diff --git a/res/drawable/action_button_background.xml b/res/drawable/action_button_background.xml
deleted file mode 100644
index ea7434f..0000000
--- a/res/drawable/action_button_background.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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">
- <!-- Transparent background constrains the touch feedback ripple to the button, but also allows
- touch feedback ripples in the parent to show under the button. -->
- <item>
- <shape android:shape="rectangle" >
- <solid android:color="@android:color/transparent" />
- </shape>
- </item>
-</ripple>
diff --git a/res/layout/call_log_list_item_actions.xml b/res/layout/call_log_list_item_actions.xml
index ac83f4a..1280089 100644
--- a/res/layout/call_log_list_item_actions.xml
+++ b/res/layout/call_log_list_item_actions.xml
@@ -30,7 +30,7 @@
>
<TextView
android:id="@+id/call_back_action"
- android:background="@drawable/action_button_background"
+ android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -46,7 +46,7 @@
android:singleLine="true"/>
<TextView
android:id="@+id/video_call_action"
- android:background="@drawable/action_button_background"
+ android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -62,7 +62,7 @@
android:singleLine="true"/>
<TextView
android:id="@+id/voicemail_action"
- android:background="@drawable/action_button_background"
+ android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -78,7 +78,7 @@
android:singleLine="true"/>
<TextView
android:id="@+id/details_action"
- android:background="@drawable/action_button_background"
+ android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -94,7 +94,7 @@
android:singleLine="true"/>
<TextView
android:id="@+id/report_action"
- android:background="@drawable/action_button_background"
+ android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent"
diff --git a/res/layout/call_log_list_item_extra.xml b/res/layout/call_log_list_item_extra.xml
index 4335979..87b932b 100644
--- a/res/layout/call_log_list_item_extra.xml
+++ b/res/layout/call_log_list_item_extra.xml
@@ -53,6 +53,7 @@
<ImageView android:id="@+id/dismiss_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:padding="@dimen/icon_padding"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/call_log_icon_margin"
android:src="@drawable/ic_close_dk"
diff --git a/res/layout/tile_interactions_teaser_view.xml b/res/layout/tile_interactions_teaser_view.xml
deleted file mode 100644
index 8204cb1..0000000
--- a/res/layout/tile_interactions_teaser_view.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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
- -->
-<com.android.dialer.list.TileInteractionTeaserView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/background_dialer_list_items"
- android:paddingBottom="@dimen/favorites_row_bottom_padding"
- android:paddingTop="@dimen/favorites_row_top_padding">
-
- <LinearLayout
- android:id="@+id/swipeable_content"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal" >
-
- <ImageView
- android:id="@+id/arrow"
- android:layout_width="48dp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="12dp"
- android:duplicateParentState="true"
- android:src="@drawable/ic_arrow"
- android:visibility="invisible" />
-
- <TextView
- android:id="@+id/text"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_marginBottom="12dp"
- android:layout_marginTop="12dp"
- android:layout_weight="1"
- android:duplicateParentState="true"
- android:fontFamily="sans-serif-light"
- android:text="@string/contact_tooltip"
- android:textColor="@color/undo_dialogue_text_color"
- android:textSize="16sp" />
-
- <View
- android:id="@+id/dismiss_separator"
- android:layout_width="1dip"
- android:layout_height="match_parent"
- android:background="@color/undo_dialogue_text_color"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp"
- android:layout_marginStart="16dp"/>
-
- <ImageButton
- android:id="@+id/dismiss_button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:background="?android:attr/selectableItemBackground"
- android:clickable="true"
- android:scaleType="center"
- android:src="@drawable/ic_cancel_holo_light"
- style="@style/DismissButtonStyle"
- android:contentDescription="@string/description_dismiss"/>
-
- </LinearLayout>
-
-</com.android.dialer.list.TileInteractionTeaserView>
diff --git a/res/values/animation_constants.xml b/res/values/animation_constants.xml
index 7863060..b8b2a59 100644
--- a/res/values/animation_constants.xml
+++ b/res/values/animation_constants.xml
@@ -35,7 +35,7 @@
<integer name="call_log_actions_fade_start">150</integer>
<!-- Duration of the fade in of the call log actions. -->
- <integer name="call_log_actions_fade_in_duration">200</integer>
+ <integer name="call_log_actions_fade_in_duration">50</integer>
<!-- Duration of the fade out of the call log actions. -->
<integer name="call_log_actions_fade_out_duration">20</integer>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 383a8fa..7096148 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -131,6 +131,10 @@
<dimen name="call_log_day_group_padding_top">15dp</dimen>
<dimen name="call_log_day_group_padding_bottom">9dp</dimen>
+ <!-- Padding for icons to increase their touch target. Icons are typically 24 dps in size
+ so this extra padding makes the entire touch target 40dp -->
+ <dimen name="icon_padding">8dp</dimen>
+
<!-- Length of dialpad's shadows in dialer. -->
<dimen name="shadow_length">10dp</dimen>
diff --git a/src/com/android/dialer/list/SpeedDialFragment.java b/src/com/android/dialer/list/SpeedDialFragment.java
index c02c3d7..c12acb0 100644
--- a/src/com/android/dialer/list/SpeedDialFragment.java
+++ b/src/com/android/dialer/list/SpeedDialFragment.java
@@ -150,8 +150,6 @@
private View mContactTileFrame;
- private TileInteractionTeaserView mTileInteractionTeaserView;
-
private final HashMap<Long, Integer> mItemIdTopMap = new HashMap<Long, Integer>();
private final HashMap<Long, Integer> mItemIdLeftMap = new HashMap<Long, Integer>();
@@ -217,9 +215,6 @@
mContactTileFrame = mParentView.findViewById(R.id.contact_tile_frame);
- mTileInteractionTeaserView = (TileInteractionTeaserView) inflater.inflate(
- R.layout.tile_interactions_teaser_view, mListView, false);
-
final LayoutAnimationController controller = new LayoutAnimationController(
AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in));
controller.setDelay(0);
diff --git a/src/com/android/dialer/list/TileInteractionTeaserView.java b/src/com/android/dialer/list/TileInteractionTeaserView.java
deleted file mode 100644
index fd5ed34..0000000
--- a/src/com/android/dialer/list/TileInteractionTeaserView.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package com.android.dialer.list;
-
-import android.animation.Animator;
-
-import android.animation.ValueAnimator;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.View;
-import android.view.animation.DecelerateInterpolator;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.android.dialer.DialtactsActivity;
-import com.android.dialer.R;
-
-/**
- * A teaser to introduce people to the contact photo check boxes
- */
-public class TileInteractionTeaserView extends FrameLayout {
- private static int sShrinkAnimationDuration;
-
- private static final String KEY_TILE_INTERACTION_TEASER_SHOWN =
- "key_tile_interaction_teaser_shown";
-
- private boolean mNeedLayout;
- private int mTextTop;
- private int mAnimatedHeight = -1;
-
- private ShortcutCardsAdapter mAdapter;
-
- public TileInteractionTeaserView(final Context context) {
- this(context, null);
- }
-
- public TileInteractionTeaserView(final Context context, final AttributeSet attrs) {
- super(context, attrs);
- final Resources resources = context.getResources();
-
- mNeedLayout = true;
- sShrinkAnimationDuration = resources.getInteger(R.integer.escape_animation_duration);
- }
-
- @Override
- protected void onFinishInflate() {
- findViewById(R.id.dismiss_button).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- startDestroyAnimation();
- }
- });
- }
-
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- super.onLayout(changed, left, top, right, bottom);
-
- final TextView text = (TextView) findViewById(R.id.text);
- final ImageView arrow = (ImageView) findViewById(R.id.arrow);
-
- // We post to avoid calling layout within layout
- arrow.post(new Runnable() {
- @Override
- public void run() {
-
- // The text top is changed when we move the arrow, so we need to
- // do multiple passes
- int textTop = text.getTop();
- if (mNeedLayout || textTop != mTextTop) {
- mNeedLayout = false;
- mTextTop = textTop;
-
- final int lineHeight = text.getLineHeight();
- final LinearLayout.LayoutParams arrowParams = (LinearLayout.LayoutParams) arrow
- .getLayoutParams();
- arrowParams.topMargin = mTextTop + lineHeight / 2;
- arrow.setLayoutParams(arrowParams);
- }
- arrow.setVisibility(View.VISIBLE);
- }
- });
- }
-
- public boolean getShouldDisplayInList() {
- final SharedPreferences prefs = getContext().getSharedPreferences(
- DialtactsActivity.SHARED_PREFS_NAME, Context.MODE_PRIVATE);
- return prefs.getBoolean(KEY_TILE_INTERACTION_TEASER_SHOWN, true);
- }
-
- public void setAdapter(ShortcutCardsAdapter adapter) {
- mAdapter = adapter;
- }
-
- private void startDestroyAnimation() {
- final int start = getHeight();
- final int end = 0;
- mAnimatedHeight = start;
- Log.v("Interaction", "Start from" + start);
-
- ValueAnimator heightAnimator = ValueAnimator.ofInt(start, end);
- heightAnimator.setDuration(sShrinkAnimationDuration);
- heightAnimator.setInterpolator(new DecelerateInterpolator(2.0f));
- heightAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
- public void onAnimationUpdate(ValueAnimator animation) {
- mAnimatedHeight = (Integer) animation.getAnimatedValue();
- requestLayout();
- }
- });
- heightAnimator.addListener(new Animator.AnimatorListener() {
- @Override
- public void onAnimationStart(Animator animator) {
- }
-
- @Override
- public void onAnimationEnd(Animator animator) {
- setVisibility(GONE);
- setDismissed();
- if (mAdapter != null) {
- mAdapter.notifyDataSetChanged();
- }
- }
-
- @Override
- public void onAnimationCancel(Animator animator) {
- }
-
- @Override
- public void onAnimationRepeat(Animator animator) {
- }
- });
-
- heightAnimator.start();
- }
-
- private void setDismissed() {
- final SharedPreferences prefs = getContext().getSharedPreferences(
- DialtactsActivity.SHARED_PREFS_NAME, Context.MODE_PRIVATE);
- prefs.edit().putBoolean(KEY_TILE_INTERACTION_TEASER_SHOWN, false).apply();
- }
-
- @Override
- protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
- if (mAnimatedHeight == -1) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- } else {
- setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), mAnimatedHeight);
- }
- }
-}
diff --git a/src/com/android/dialer/widget/SearchEditTextLayout.java b/src/com/android/dialer/widget/SearchEditTextLayout.java
index 919f65c..f22a3be 100644
--- a/src/com/android/dialer/widget/SearchEditTextLayout.java
+++ b/src/com/android/dialer/widget/SearchEditTextLayout.java
@@ -101,6 +101,17 @@
mExpandedSearchBox = findViewById(R.id.search_box_expanded);
mClearButtonView = findViewById(R.id.search_close_button);
+ // Convert a long click into a click to expand the search box, and then long click on the
+ // search view. This accelerates the long-press scenario for copy/paste.
+ mCollapsedSearchBox.setOnLongClickListener(new OnLongClickListener() {
+ @Override
+ public boolean onLongClick(View view) {
+ mCollapsedSearchBox.performClick();
+ mSearchView.performLongClick();
+ return false;
+ }
+ });
+
mSearchView.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {