summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-04-25 16:56:42 -0700
committerYorke Lee <yorkelee@google.com>2014-04-25 16:56:42 -0700
commitf42a1790c5bbf2be1ed71858897d72898e414235 (patch)
tree98bbaa06dfba1f5d96613e2f8befeb37569fc6fa
parentcc4660d463daa11b969fd9b8bdd308ae3416c67a (diff)
Apply padding to fragment view rather than ListView
This fixes the problem of pinned headers being hidden by the actionbar. Change-Id: Ieeeee69ab596f2c0cc167dcc70c3928a5fef782d
-rw-r--r--src/com/android/dialer/DialtactsActivity.java4
-rw-r--r--src/com/android/dialer/list/SearchFragment.java17
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);
}
}