Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f729eb52 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix Folder text animation bugs." into ub-launcher3-dorval-polish

parents bbe504d2 1d9cc324
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -791,6 +791,7 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC
        if (mFolderIcon != null) {
            mFolderIcon.setVisibility(View.VISIBLE);
            if (FeatureFlags.LAUNCHER3_NEW_FOLDER_ANIMATION) {
                mFolderIcon.mFolderName.setTextVisibility(true);
                mFolderIcon.setBackgroundVisible(true);
                mFolderIcon.mBackground.fadeInBackgroundShadow();
            }
+9 −5
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@ package com.android.launcher3.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Region;
import android.support.v4.graphics.ColorUtils;
import android.util.AttributeSet;

import com.android.launcher3.BubbleTextView;
@@ -45,18 +47,20 @@ public class DoubleShadowBubbleTextView extends BubbleTextView {
        mShadowInfo = new ShadowInfo(context, attrs, defStyle);
        setShadowLayer(mShadowInfo.ambientShadowBlur, 0, 0, mShadowInfo.ambientShadowColor);
    }

    @Override
    public void onDraw(Canvas canvas) {
        // If text is transparent, don't draw any shadow
        if ((getCurrentTextColor() >> 24) == 0) {
        int alpha = Color.alpha(getCurrentTextColor());
        if (alpha == 0) {
            getPaint().clearShadowLayer();
            super.onDraw(canvas);
            return;
        }

        // We enhance the shadow by drawing the shadow twice
        getPaint().setShadowLayer(
                mShadowInfo.ambientShadowBlur, 0, 0, mShadowInfo.ambientShadowColor);
        getPaint().setShadowLayer(mShadowInfo.ambientShadowBlur, 0, 0,
                ColorUtils.setAlphaComponent(mShadowInfo.ambientShadowColor, alpha));

        drawWithoutBadge(canvas);
        canvas.save(Canvas.CLIP_SAVE_FLAG);
@@ -64,8 +68,8 @@ public class DoubleShadowBubbleTextView extends BubbleTextView {
                getScrollX() + getWidth(),
                getScrollY() + getHeight(), Region.Op.INTERSECT);

        getPaint().setShadowLayer(mShadowInfo.keyShadowBlur, 0.0f,
                mShadowInfo.keyShadowOffset, mShadowInfo.keyShadowColor);
        getPaint().setShadowLayer(mShadowInfo.keyShadowBlur, 0.0f, mShadowInfo.keyShadowOffset,
                ColorUtils.setAlphaComponent(mShadowInfo.keyShadowColor, alpha));
        drawWithoutBadge(canvas);
        canvas.restore();