diff options
author | Yorke Lee <yorkelee@google.com> | 2014-04-25 23:59:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-25 23:59:08 +0000 |
commit | 9d1ed1745b95f4ad5b75fe872683e044c41b40c8 (patch) | |
tree | 40e9dc9f77bf337c189d8ba3d42713d64413ad38 | |
parent | c150c723eae0c4d2c05d570604db3c79fe7ef913 (diff) | |
parent | f42a1790c5bbf2be1ed71858897d72898e414235 (diff) |
Merge "Apply padding to fragment view rather than ListView"
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 4 | ||||
-rw-r--r-- | src/com/android/dialer/list/SearchFragment.java | 17 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 1b4002cd1..2e0225a37 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -596,7 +596,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O fragment = mRegularSearchFragment; } if (fragment != null && fragment.isVisible()) { - fragment.getListView().animate().translationY(-mActionBarHeight) + fragment.getView().animate().translationY(-mActionBarHeight) .setInterpolator(hideActionBarInterpolator).setDuration(ANIMATION_DURATION); } @@ -622,7 +622,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O fragment = mRegularSearchFragment; } if (fragment != null && fragment.isVisible()) { - fragment.getListView().animate().translationY(0) + fragment.getView().animate().translationY(0) .setInterpolator(showActionBarInterpolator).setDuration(ANIMATION_DURATION); } diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java index c4fac695a..f1cd5aacd 100644 --- a/src/com/android/dialer/list/SearchFragment.java +++ b/src/com/android/dialer/list/SearchFragment.java @@ -18,6 +18,7 @@ package com.android.dialer.list; import android.app.Activity; import android.content.Intent; import android.text.TextUtils; +import android.view.View; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.ListView; @@ -67,13 +68,15 @@ public class SearchFragment extends PhoneNumberPickerFragment { } mActionBarHeight = ((DialtactsActivity) getActivity()).getActionBarHeight(); - final ListView listView = getListView(); - listView.setPaddingRelative( - listView.getPaddingStart(), + + final View parentView = getView(); + parentView.setPaddingRelative( + parentView.getPaddingStart(), mActionBarHeight, - listView.getPaddingEnd(), - listView.getPaddingBottom()); - listView.setClipToPadding(false); + parentView.getPaddingEnd(), + parentView.getPaddingBottom()); + + final ListView listView = getListView(); listView.setOnScrollListener(new OnScrollListener() { @Override @@ -88,7 +91,7 @@ public class SearchFragment extends PhoneNumberPickerFragment { }); if (!getActivity().getActionBar().isShowing()) { - listView.setTranslationY(-mActionBarHeight); + parentView.setTranslationY(-mActionBarHeight); } } |