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

Commit 277a8aa4 authored by Selim Cinek's avatar Selim Cinek
Browse files

Replacing alpha with shadowAlpha

Change-Id: I1fc75e395321d77fb959dd3e8ce520bd8378cfeb
parent cacc6041
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@
    <dimen name="top_stack_slow_down_length">12dp</dimen>

    <!-- Z distance between notifications if they are in the stack -->
    <dimen name="z_distance_between_notifications">1dp</dimen>
    <dimen name="z_distance_between_notifications">0.5dp</dimen>

    <!-- The height of the divider between the individual notifications. -->
    <dimen name="notification_divider_height">0.5dp</dimen>
+3 −0
Original line number Diff line number Diff line
@@ -21,16 +21,19 @@
    <item type="id" name="alpha_animator_tag"/>
    <item type="id" name="top_inset_animator_tag"/>
    <item type="id" name="height_animator_tag"/>
    <item type="id" name="shadow_alpha_animator_tag"/>
    <item type="id" name="translation_y_animator_end_value_tag"/>
    <item type="id" name="translation_z_animator_end_value_tag"/>
    <item type="id" name="alpha_animator_end_value_tag"/>
    <item type="id" name="top_inset_animator_end_value_tag"/>
    <item type="id" name="height_animator_end_value_tag"/>
    <item type="id" name="shadow_alpha_animator_end_value_tag"/>
    <item type="id" name="translation_y_animator_start_value_tag"/>
    <item type="id" name="translation_z_animator_start_value_tag"/>
    <item type="id" name="alpha_animator_start_value_tag"/>
    <item type="id" name="top_inset_animator_start_value_tag"/>
    <item type="id" name="height_animator_start_value_tag"/>
    <item type="id" name="shadow_alpha_animator_start_value_tag"/>
    <item type="id" name="doze_saved_filter_tag"/>
    <item type="id" name="qs_icon_tag"/>
    <item type="id" name="scrim"/>
+15 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
            updateOutlineAlpha();
        }
    };
    private float mShadowAlpha = 1.0f;

    public ActivatableNotificationView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -415,6 +416,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
        float alpha = NotificationStackScrollLayout.BACKGROUND_ALPHA_DIMMED;
        alpha = (alpha + (1.0f - alpha) * mNormalBackgroundVisibilityAmount);
        alpha *= mShadowAlpha;
        if (mFadeInFromDarkAnimator != null) {
            alpha *= mFadeInFromDarkAnimator.getAnimatedFraction();
        }
@@ -829,6 +831,19 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        return getBgColor() == otherView.getBgColor();
    }

    @Override
    public float getShadowAlpha() {
        return mShadowAlpha;
    }

    @Override
    public void setShadowAlpha(float shadowAlpha) {
        if (shadowAlpha != mShadowAlpha) {
            mShadowAlpha = shadowAlpha;
            updateOutlineAlpha();
        }
    }

    public interface OnActivatedListener {
        void onActivated(ActivatableNotificationView view);
        void onActivationReset(ActivatableNotificationView view);
+7 −0
Original line number Diff line number Diff line
@@ -388,6 +388,13 @@ public abstract class ExpandableView extends FrameLayout {
        return super.hasOverlappingRendering() && getActualHeight() <= getHeight();
    }

    public float getShadowAlpha() {
        return 0.0f;
    }

    public void setShadowAlpha(float shadowAlpha) {
    }

    /**
     * A listener notifying when {@link #getActualHeight} changes.
     */
+8 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ public class AnimationFilter {
    boolean animateDimmed;
    boolean animateDark;
    boolean animateHideSensitive;
    public boolean animateShadowAlpha;
    boolean hasDelays;
    boolean hasGoToFullShadeEvent;
    boolean hasDarkEvent;
@@ -81,6 +82,11 @@ public class AnimationFilter {
        return this;
    }

    public AnimationFilter animateShadowAlpha() {
        animateShadowAlpha = true;
        return this;
    }

    /**
     * Combines multiple filters into {@code this} filter, using or as the operand .
     *
@@ -117,6 +123,7 @@ public class AnimationFilter {
        animateDimmed |= filter.animateDimmed;
        animateDark |= filter.animateDark;
        animateHideSensitive |= filter.animateHideSensitive;
        animateShadowAlpha |= filter.animateShadowAlpha;
        hasDelays |= filter.hasDelays;
    }

@@ -125,6 +132,7 @@ public class AnimationFilter {
        animateY = false;
        animateZ = false;
        animateHeight = false;
        animateShadowAlpha = false;
        animateTopInset = false;
        animateDimmed = false;
        animateDark = false;
Loading