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

Commit b051354d authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Re-add dividers when expanding notifications.

* This makes the divider consistent, given Ic181bc8b23ae62c8212fee19fd7c6434eb94cd61
* Fixes some small color/alpha changing bugs that occurred when the expansion finished and the background and dividers disappear.
* If we want to disable the dividers, we can do so quickly by setting `notification_children_container_divider_height` to 0

Bug: 191187506
Test: expand and collapse groups a bunch.
Change-Id: I773ef25ec7e0121603412aff3418843a7aa4d7aa
parent e7fc7576
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -21,8 +21,8 @@
    It's fine to override this color since at that point the shade was dark. -->
    It's fine to override this color since at that point the shade was dark. -->
    <color name="notification_legacy_background_color">@color/GM2_grey_900</color>
    <color name="notification_legacy_background_color">@color/GM2_grey_900</color>


    <!-- The color of the dividing line between grouped notifications while . -->
    <!-- The color of the dividing line between grouped notifications. -->
    <color name="notification_divider_color">#212121</color>
    <color name="notification_divider_color">@*android:color/background_device_default_dark</color>


    <!-- The color of the gear shown behind a notification -->
    <!-- The color of the gear shown behind a notification -->
    <color name="notification_gear_color">@color/GM2_grey_500</color>
    <color name="notification_gear_color">@color/GM2_grey_500</color>
+1 −1
Original line number Original line Diff line number Diff line
@@ -93,7 +93,7 @@
    <color name="notification_material_background_dark_color">#ff333333</color>
    <color name="notification_material_background_dark_color">#ff333333</color>


    <!-- The color of the dividing line between grouped notifications. -->
    <!-- The color of the dividing line between grouped notifications. -->
    <color name="notification_divider_color">#FF616161</color>
    <color name="notification_divider_color">@*android:color/background_device_default_light</color>


    <!-- The color of the ripples on the untinted notifications -->
    <!-- The color of the ripples on the untinted notifications -->
    <color name="notification_ripple_untinted_color">#28000000</color>
    <color name="notification_ripple_untinted_color">#28000000</color>
+1 −1
Original line number Original line Diff line number Diff line
@@ -685,7 +685,7 @@
    <dimen name="notification_shadow_radius">0dp</dimen>
    <dimen name="notification_shadow_radius">0dp</dimen>


    <!-- The alpha of the dividing line between child notifications of a notification group. -->
    <!-- The alpha of the dividing line between child notifications of a notification group. -->
    <item name="notification_divider_alpha" format="float" type="dimen">0.5</item>
    <item name="notification_divider_alpha" format="float" type="dimen">1</item>


    <!-- The height of the divider between the individual notifications in a notification
    <!-- The height of the divider between the individual notifications in a notification
         group. -->
         group. -->
+3 −3
Original line number Original line Diff line number Diff line
@@ -725,7 +725,7 @@ public class NotificationChildrenContainer extends ViewGroup {
            tmpState.yTranslation = viewState.yTranslation - mDividerHeight;
            tmpState.yTranslation = viewState.yTranslation - mDividerHeight;
            float alpha = mChildrenExpanded && viewState.alpha != 0 ? mDividerAlpha : 0;
            float alpha = mChildrenExpanded && viewState.alpha != 0 ? mDividerAlpha : 0;
            if (mUserLocked && !showingAsLowPriority() && viewState.alpha != 0) {
            if (mUserLocked && !showingAsLowPriority() && viewState.alpha != 0) {
                alpha = NotificationUtils.interpolate(0, 0.5f,
                alpha = NotificationUtils.interpolate(0, mDividerAlpha,
                        Math.min(viewState.alpha, expandFraction));
                        Math.min(viewState.alpha, expandFraction));
            }
            }
            tmpState.hidden = !dividersVisible;
            tmpState.hidden = !dividersVisible;
@@ -802,9 +802,9 @@ public class NotificationChildrenContainer extends ViewGroup {
            View divider = mDividers.get(i);
            View divider = mDividers.get(i);
            tmpState.initFrom(divider);
            tmpState.initFrom(divider);
            tmpState.yTranslation = viewState.yTranslation - mDividerHeight;
            tmpState.yTranslation = viewState.yTranslation - mDividerHeight;
            float alpha = mChildrenExpanded && viewState.alpha != 0 ? 0.5f : 0;
            float alpha = mChildrenExpanded && viewState.alpha != 0 ? mDividerAlpha : 0;
            if (mUserLocked && !showingAsLowPriority() && viewState.alpha != 0) {
            if (mUserLocked && !showingAsLowPriority() && viewState.alpha != 0) {
                alpha = NotificationUtils.interpolate(0, 0.5f,
                alpha = NotificationUtils.interpolate(0, mDividerAlpha,
                        Math.min(viewState.alpha, expandFraction));
                        Math.min(viewState.alpha, expandFraction));
            }
            }
            tmpState.hidden = !dividersVisible;
            tmpState.hidden = !dividersVisible;