summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-10-16 11:46:41 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-10-17 12:42:08 -0700
commitaeb1643ec61af93453c862e84b158d3b0ebcb1c7 (patch)
treeb57dcdc0892a153cb83333a2dab55547e7d87665 /src/com/android/launcher3/CellLayout.java
parent1797af41d162413dc98c33fab8ba19f96b63874b (diff)
downloadpackages_apps_Trebuchet-aeb1643ec61af93453c862e84b158d3b0ebcb1c7.tar.gz
packages_apps_Trebuchet-aeb1643ec61af93453c862e84b158d3b0ebcb1c7.tar.bz2
packages_apps_Trebuchet-aeb1643ec61af93453c862e84b158d3b0ebcb1c7.zip
Launcher state management cleanup
> Removing Widgets and related states > Fixing different durations being used when opening/closing all-apps > Removing some unnecessary object allocations when changing state without animation > Differentiating widget bootm sheel and full sheet in logs Bug: 67678570 Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index d6c8575d6..3643971a4 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -104,8 +104,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
private final ArrayList<PreviewBackground> mFolderBackgrounds = new ArrayList<>();
final PreviewBackground mFolderLeaveBehind = new PreviewBackground();
- private float mBackgroundAlpha;
-
private static final int[] BACKGROUND_STATE_ACTIVE = new int[] { android.R.attr.state_active };
private static final int[] BACKGROUND_STATE_DEFAULT = new int[0];
private final Drawable mBackground;
@@ -221,7 +219,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
mBackground = res.getDrawable(R.drawable.bg_celllayout);
mBackground.setCallback(this);
- mBackground.setAlpha((int) (mBackgroundAlpha * 255));
+ mBackground.setAlpha(0);
mReorderPreviewAnimationMagnitude = (REORDER_PREVIEW_MAGNITUDE * grid.iconSizePx);
@@ -440,7 +438,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
// When we're small, we are either drawn normally or in the "accepts drops" state (during
// a drag). However, we also drag the mini hover background *over* one of those two
// backgrounds
- if (mBackgroundAlpha > 0.0f) {
+ if (mBackground.getAlpha() > 0) {
mBackground.draw(canvas);
}
@@ -847,15 +845,8 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
return getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - (mCountX * mCellWidth);
}
- public float getBackgroundAlpha() {
- return mBackgroundAlpha;
- }
-
- public void setBackgroundAlpha(float alpha) {
- if (mBackgroundAlpha != alpha) {
- mBackgroundAlpha = alpha;
- mBackground.setAlpha((int) (mBackgroundAlpha * 255));
- }
+ public Drawable getScrimBackground() {
+ return mBackground;
}
@Override