DO NOT MERGE. Styling search to match redlines.
- Cherrypicking changes back to master. Mostly, this involved
transferring changes dealing with padding and the translation values.
- 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
Conflicts:
res/layout/search_edittext.xml
res/values/dimens.xml
src/com/android/dialer/DialtactsActivity.java
src/com/android/dialer/list/SearchFragment.java
Change-Id: I8519e7e2ef5c75c0f170ff61ed22f44f95e07f74
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index f2f49c1..4ea9651 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -142,8 +142,6 @@
private static final int ACTIVITY_REQUEST_CODE_VOICE_SEARCH = 1;
- private static final int ANIMATION_DURATION = 250;
-
private RelativeLayout parentLayout;
/**
@@ -232,8 +230,6 @@
*/
private View mRemoveViewContainer;
- final Interpolator hideActionBarInterpolator = new AccelerateInterpolator(1.5f);
- final Interpolator showActionBarInterpolator = new DecelerateInterpolator(1.5f);
private String mSearchQuery;
private DialerDatabaseHelper mDialerDatabaseHelper;
@@ -689,8 +685,6 @@
}
private void updateSearchFragmentPosition() {
- int startTranslationValue = mIsDialpadShown ? mActionBarHeight : 0;
- int endTranslationValue = mIsDialpadShown ? 0 : mActionBarHeight;
SearchFragment fragment = null;
if (mSmartDialSearchFragment != null && mSmartDialSearchFragment.isVisible()) {
fragment = mSmartDialSearchFragment;
@@ -698,11 +692,7 @@
fragment = mRegularSearchFragment;
}
if (fragment != null && fragment.isVisible()) {
- fragment.getListView().setTranslationY(startTranslationValue);
- fragment.getListView().animate().translationY(endTranslationValue)
- .setInterpolator(hideActionBarInterpolator)
- .setDuration(ANIMATION_DURATION)
- .start();
+ fragment.updatePosition(true /* animate */);
}
}
@@ -1176,6 +1166,10 @@
return mActionBarController.isActionBarShowing();
}
+ public boolean isDialpadShown() {
+ return mIsDialpadShown;
+ }
+
@Override
public int getActionBarHideOffset() {
return getActionBar().getHideOffset();