summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-10 01:36:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-10 01:36:10 +0000
commit22ca2fee71881e7935997e61fee05c40d2f47436 (patch)
treea82364a2d699c9d4cffdab1067a7466ae6a3a004 /src
parentdc778c1a6fe5548f82dabfbf5945cc53437815e3 (diff)
parenta2bdac8d96eaed2dacea274c55036ca9c1a77b4d (diff)
Merge "Fix the lack of gray background behind swiped contacts" into klp-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteRegularRowView.java2
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteTileView.java24
-rw-r--r--src/com/android/dialer/list/PhoneFavoritesTileAdapter.java10
-rw-r--r--src/com/android/dialer/list/SwipeableListView.java3
4 files changed, 15 insertions, 24 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java b/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java
index 11dc00a90..374f733ec 100644
--- a/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteRegularRowView.java
@@ -57,6 +57,8 @@ public class PhoneFavoriteRegularRowView extends PhoneFavoriteTileView {
rowPaddingBottom = resources.getDimensionPixelSize(
R.dimen.favorites_row_bottom_padding);
+ favoriteContactCard.setBackgroundResource(R.drawable.bottom_border_background);
+
favoriteContactCard.setPaddingRelative(rowPaddingStart, rowPaddingTop, rowPaddingEnd,
rowPaddingBottom);
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java
index 8887a2c47..43dbad347 100644
--- a/src/com/android/dialer/list/PhoneFavoriteTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java
@@ -131,20 +131,10 @@ public abstract class PhoneFavoriteTileView extends ContactTileView {
public void displayRemovalDialog() {
mRemovalDialogue.setVisibility(VISIBLE);
mRemovalDialogue.setAlpha(0f);
- final int animationLength = ANIMATION_LENGTH;
- final AnimatorSet animSet = new AnimatorSet();
final ObjectAnimator fadeIn = ObjectAnimator.ofFloat(mRemovalDialogue, "alpha",
- 1.f).setDuration(animationLength);
-
- if (mParentRow.getItemViewType() == ViewTypes.FREQUENT) {
- final ObjectAnimator backgroundFadeIn = ObjectAnimator.ofInt(
- mParentRow.getBackground(), "alpha", 0).setDuration(animationLength);
- animSet.playTogether(fadeIn, backgroundFadeIn);
- } else {
- animSet.playTogether(fadeIn);
- }
+ 1.f).setDuration(ANIMATION_LENGTH);
- animSet.addListener(new AnimatorListenerAdapter() {
+ fadeIn.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
mParentRow.setHasTransientState(true);
@@ -155,8 +145,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView {
mParentRow.setHasTransientState(false);
}
});
-
- animSet.start();
+ fadeIn.start();
}
/**
@@ -172,10 +161,11 @@ public abstract class PhoneFavoriteTileView extends ContactTileView {
setDuration(ANIMATION_LENGTH);
final ObjectAnimator moveBack = ObjectAnimator.ofFloat(mFavoriteContactCard, "translationX",
0.f).setDuration(ANIMATION_LENGTH);
- final ObjectAnimator backgroundFadeOut = ObjectAnimator.ofInt(mParentRow.getBackground(),
- "alpha", 255).setDuration(ANIMATION_LENGTH);
+
final AnimatorSet animSet = new AnimatorSet();
- animSet.playTogether(fadeIn, moveBack, backgroundFadeOut);
+
+ animSet.playTogether(fadeIn, moveBack);
+
animSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
index 8eba964b2..91acc6fe0 100644
--- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
+++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
@@ -688,6 +688,8 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
R.dimen.favorites_row_start_padding);
mRowPaddingEnd = resources.getDimensionPixelSize(
R.dimen.favorites_row_end_padding);
+
+ setBackgroundResource(R.drawable.bottom_border_background);
} else {
// For row views, padding is set on the view itself.
mRowPaddingTop = 0;
@@ -696,8 +698,6 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
mRowPaddingEnd = 0;
}
- setBackgroundResource(R.drawable.bottom_border_background);
-
setPaddingRelative(mRowPaddingStart, mRowPaddingTop, mRowPaddingEnd,
mRowPaddingBottom);
@@ -743,7 +743,6 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
}
}
setPressed(false);
- getBackground().setAlpha(255);
}
private void addTileFromEntry(ContactEntry entry, int childIndex, boolean isLastRow) {
@@ -960,11 +959,12 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
public void onBeginDrag(View v) {
removePendingContactEntry();
final int index = indexOfChild(v);
- // Move tile to front so that any overlap will be hidden behind its siblings
+
+ /*
if (index > 0) {
detachViewFromParent(index);
attachViewToParent(v, 0, v.getLayoutParams());
- }
+ }*/
// We do this so the underlying ScrollView knows that it won't get
// the chance to intercept events anymore
diff --git a/src/com/android/dialer/list/SwipeableListView.java b/src/com/android/dialer/list/SwipeableListView.java
index 8f50f4cd4..449628da7 100644
--- a/src/com/android/dialer/list/SwipeableListView.java
+++ b/src/com/android/dialer/list/SwipeableListView.java
@@ -152,13 +152,12 @@ public class SwipeableListView extends ListView implements SwipeHelperCallback {
@Override
public void onDragCancelled(View v) {
- v.setHasTransientState(false);
}
@Override
public void onBeginDrag(View v) {
final View tileRow = (View) v.getParent();
- tileRow.setHasTransientState(true);
+
// We do this so the underlying ScrollView knows that it won't get
// the chance to intercept events anymore
requestDisallowInterceptTouchEvent(true);