diff options
author | Clark Scheff <clark@cyngn.com> | 2014-07-25 15:49:49 -0700 |
---|---|---|
committer | d34d <clark@cyngn.com> | 2014-07-25 18:46:23 -0700 |
commit | 96f44b87e3f781084da142575a9ae1229a92825f (patch) | |
tree | 5e110be30d7166c37b2302c87f2e78008980dd08 /src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java | |
parent | 8e1b6f5bfd501b150379c163cc1b118a1cbfd4e8 (diff) | |
download | packages_apps_ThemeChooser-96f44b87e3f781084da142575a9ae1229a92825f.zip packages_apps_ThemeChooser-96f44b87e3f781084da142575a9ae1229a92825f.tar.gz packages_apps_ThemeChooser-96f44b87e3f781084da142575a9ae1229a92825f.tar.bz2 |
Add boolean parameter to specify if label should be visible.
The additional cards don't animate the label in so they need
it to be visible from within the expand() method. The cards that
are visible in the preview, that animate into cards need the label
to not be visible since it will be faded in.
Change-Id: I89a572a481d2d753118225c102dac0f7e99739ba
Diffstat (limited to 'src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java')
-rw-r--r-- | src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java b/src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java index 8154229..5e24c95 100644 --- a/src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java +++ b/src/org/cyanogenmod/theme/chooserv2/ComponentCardView.java @@ -59,7 +59,7 @@ public class ComponentCardView extends LinearLayout { (int) r.getDimension(R.dimen.card_padding_bottom) + getPaddingBottom(); } - public void expand() { + public void expand(boolean showLabel) { TransitionDrawable bg = null; if (getBackground() instanceof TransitionDrawable) { bg = (TransitionDrawable) getBackground(); @@ -72,7 +72,7 @@ public class ComponentCardView extends LinearLayout { setPadding(mExpandPadLeft, mExpandPadTop, mExpandPadRight, mExpandPadBottom); if (mLabel != null) { - mLabel.setAlpha(1f); + mLabel.setAlpha(showLabel ? 1f : 0f); mLabel.setVisibility(View.VISIBLE); } } @@ -82,7 +82,8 @@ public class ComponentCardView extends LinearLayout { TransitionDrawable background = (TransitionDrawable) getBackground(); if (mLabel != null) { mLabel.setVisibility(View.VISIBLE); - mLabel.animate().alpha(1f).setDuration(CARD_FADE_DURATION); + mLabel.setAlpha(0f); + mLabel.animate().alpha(1f).setDuration(CARD_FADE_DURATION).start(); } background.startTransition(CARD_FADE_DURATION); } |