summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/widget
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-06-03 14:03:09 -0700
committerAndrew Lee <anwlee@google.com>2014-06-03 14:41:52 -0700
commit05b6267428450f190d04af187a206cc495da8995 (patch)
treea2992806445d72fe3959d6f2af45e1965eb855d4 /src/com/android/dialer/widget
parent763d0c2afd034b4c2939199da7eba491548acdff (diff)
downloadpackages_apps_Dialer-05b6267428450f190d04af187a206cc495da8995.tar.gz
packages_apps_Dialer-05b6267428450f190d04af187a206cc495da8995.tar.bz2
packages_apps_Dialer-05b6267428450f190d04af187a206cc495da8995.zip
DO NOT MERGE. Styling search to match redlines.
- This conflicts with some of Sai's changes, so will manually cherrypick this CL back to master.. - Shift arrow/close icons. - Use 20sp font in expanded search (causes baseline to shift down). - Update action bar movement to use dialpad's interpolators and durations. - Smoothed out animations. Icons in the view being faded out are now instantaneously set to GONE. The margin animator when going from collapsed to expanded starts at 0.8f now, so that the searchbox does not shrink momentarily when switched to the 9-patch, because of the shadow. - Fix clipping because of 9-patch; refactored logic for updating the position and padding from the Activity into SearchFragment. This was motivated in part because we want a padding at the top of this list for the first item, but when the dialpad is shown we do not want that padding. Bug: 15343931 Change-Id: I7c3a96dd295c58c6955e6bd3e9d8cda151de4c3f
Diffstat (limited to 'src/com/android/dialer/widget')
-rw-r--r--src/com/android/dialer/widget/SearchEditTextLayout.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/com/android/dialer/widget/SearchEditTextLayout.java b/src/com/android/dialer/widget/SearchEditTextLayout.java
index dbb2b22de..d229aa402 100644
--- a/src/com/android/dialer/widget/SearchEditTextLayout.java
+++ b/src/com/android/dialer/widget/SearchEditTextLayout.java
@@ -19,6 +19,7 @@ package com.android.dialer.widget;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.content.Context;
+import android.graphics.Color;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
@@ -30,6 +31,7 @@ import com.android.contacts.common.animation.AnimUtils;
import com.android.dialer.R;
public class SearchEditTextLayout extends FrameLayout {
+ private static final float EXPAND_MARGIN_FRACTION_START = 0.8f;
private static final int ANIMATION_DURATION = 200;
private OnKeyListener mPreImeKeyListener;
@@ -47,6 +49,11 @@ public class SearchEditTextLayout extends FrameLayout {
private View mCollapsed;
private View mExpanded;
private EditText mSearchView;
+ private View mCollapsedSearchBox;
+ private View mVoiceSearchButtonView;
+ private View mOverflowButtonView;
+ private View mBackButtonView;
+ private View mClearButtonView;
private ValueAnimator mAnimator;
@@ -85,6 +92,12 @@ public class SearchEditTextLayout extends FrameLayout {
mExpanded = findViewById(R.id.search_box_expanded);
mSearchView = (EditText) mExpanded.findViewById(R.id.search_view);
+ mCollapsedSearchBox = findViewById(R.id.search_box_start_search);
+ mVoiceSearchButtonView = findViewById(R.id.voice_search_button);
+ mOverflowButtonView = findViewById(R.id.dialtacts_options_menu_button);
+ mBackButtonView = findViewById(R.id.search_back_button);
+ mClearButtonView = findViewById(R.id.search_close_button);
+
mSearchView.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
@@ -149,9 +162,16 @@ public class SearchEditTextLayout extends FrameLayout {
}
}
public void expand(boolean animate, boolean requestFocus) {
+ mCollapsedSearchBox.setVisibility(View.GONE);
+ mVoiceSearchButtonView.setVisibility(View.GONE);
+ mOverflowButtonView.setVisibility(View.GONE);
+ mBackButtonView.setVisibility(View.VISIBLE);
+ mClearButtonView.setVisibility(View.VISIBLE);
+
if (animate) {
AnimUtils.crossFadeViews(mExpanded, mCollapsed, ANIMATION_DURATION);
- mAnimator = ValueAnimator.ofFloat(1f, 0f);
+ mAnimator = ValueAnimator.ofFloat(EXPAND_MARGIN_FRACTION_START, 0f);
+ setMargins(EXPAND_MARGIN_FRACTION_START);
prepareAnimator(true);
} else {
mExpanded.setVisibility(View.VISIBLE);
@@ -169,6 +189,12 @@ public class SearchEditTextLayout extends FrameLayout {
}
public void collapse(boolean animate) {
+ mCollapsedSearchBox.setVisibility(View.VISIBLE);
+ mVoiceSearchButtonView.setVisibility(View.VISIBLE);
+ mOverflowButtonView.setVisibility(View.VISIBLE);
+ mBackButtonView.setVisibility(View.GONE);
+ mClearButtonView.setVisibility(View.GONE);
+
if (animate) {
AnimUtils.crossFadeViews(mCollapsed, mExpanded, ANIMATION_DURATION);
mAnimator = ValueAnimator.ofFloat(0f, 1f);