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

Commit 3322357b authored by Selim Cinek's avatar Selim Cinek
Browse files

Added fake shadows in order to have the shadow nicely fade in

Bug: 26743157
Change-Id: I21c51aa3175276f7edeed4b6df6b8730909b6051
parent 28540199
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    android:focusable="true"
    android:clickable="true"
    >

    <com.android.systemui.statusbar.NotificationBackgroundView android:id="@+id/backgroundNormal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
@@ -65,4 +66,9 @@
            />
    </com.android.keyguard.AlphaOptimizedLinearLayout>

    <com.android.systemui.statusbar.notification.FakeShadowView
        android:id="@+id/fake_shadow"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.systemui.statusbar.NotificationOverflowContainer>
+5 −0
Original line number Diff line number Diff line
@@ -76,4 +76,9 @@
        android:layout_height="wrap_content"
        />

    <com.android.systemui.statusbar.notification.FakeShadowView
        android:id="@+id/fake_shadow"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.systemui.statusbar.ExpandableNotificationRow>
+11 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.view.animation.PathInterpolator;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.classifier.FalsingManager;
import com.android.systemui.statusbar.notification.FakeShadowView;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;

/**
@@ -155,6 +156,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
    };
    private float mShadowAlpha = 1.0f;
    private FakeShadowView mFakeShadow;

    public ActivatableNotificationView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -180,6 +182,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    protected void onFinishInflate() {
        super.onFinishInflate();
        mBackgroundNormal = (NotificationBackgroundView) findViewById(R.id.backgroundNormal);
        mFakeShadow = (FakeShadowView) findViewById(R.id.fake_shadow);
        mBackgroundDimmed = (NotificationBackgroundView) findViewById(R.id.backgroundDimmed);
        mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg);
        mBackgroundDimmed.setCustomBackground(R.drawable.notification_material_bg_dim);
@@ -852,6 +855,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
    }

    @Override
    public void setFakeShadowIntensity(float shadowIntensity, float outlineAlpha, int shadowYEnd,
            int outlineTranslation) {
        mFakeShadow.setFakeShadowTranslationZ(shadowIntensity * (getTranslationZ()
                + FakeShadowView.SHADOW_SIBLING_TRESHOLD), outlineAlpha, shadowYEnd,
                outlineTranslation);
    }

    public interface OnActivatedListener {
        void onActivated(ActivatableNotificationView view);
        void onActivationReset(ActivatableNotificationView view);
+10 −0
Original line number Diff line number Diff line
@@ -70,6 +70,11 @@ public abstract class ExpandableOutlineView extends ExpandableView {
        }
    }

    @Override
    public float getOutlineAlpha() {
        return mOutlineAlpha;
    }

    protected void setOutlineRect(RectF rect) {
        if (rect != null) {
            setOutlineRect(rect.left, rect.top, rect.right, rect.bottom);
@@ -80,6 +85,11 @@ public abstract class ExpandableOutlineView extends ExpandableView {
        }
    }

    @Override
    public int getOutlineTranslation() {
        return mCustomOutline ? mOutlineRect.left : 0;
    }

    protected void setOutlineRect(float left, float top, float right, float bottom) {
        setOutlineRect(true, left, top, right, bottom);
    }
+12 −0
Original line number Diff line number Diff line
@@ -399,6 +399,18 @@ public abstract class ExpandableView extends FrameLayout {
        return false;
    }

    public void setFakeShadowIntensity(float shadowIntensity, float outlineAlpha, int shadowYEnd,
            int outlineTranslation) {
    }

    public float getOutlineAlpha() {
        return 0.0f;
    }

    public int getOutlineTranslation() {
        return 0;
    }

    /**
     * A listener notifying when {@link #getActualHeight} changes.
     */
Loading