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

Commit ac508816 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Dedup onClickListener for clearing silent notifs"

parents beca193c be3c0ef4
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ class NotificationSectionsManager @Inject internal constructor(

    private lateinit var parent: NotificationStackScrollLayout
    private var initialized = false
    private var onClearSilentNotifsClickListener: View.OnClickListener? = null

    @VisibleForTesting
    val silentHeaderView: SectionHeaderView?
@@ -441,11 +440,6 @@ class NotificationSectionsManager @Inject internal constructor(
        }
    }

    /** Listener for when the "clear all" button is clicked on the gentle notification header. */
    fun setOnClearSilentNotifsClickListener(listener: View.OnClickListener) {
        onClearSilentNotifsClickListener = listener
    }

    fun setHeaderForegroundColor(@ColorInt color: Int) {
        peopleHeaderView?.setForegroundColor(color)
        silentHeaderView?.setForegroundColor(color)
+0 −6
Original line number Diff line number Diff line
@@ -518,12 +518,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mSectionsManager = notificationSectionsManager;

        mSectionsManager.initialize(this, LayoutInflater.from(context));
        mSectionsManager.setOnClearSilentNotifsClickListener(v -> {
            // Leave the shade open if there will be other notifs left over to clear
            final boolean closeShade =
                    !mController.hasActiveClearableNotifications(ROWS_HIGH_PRIORITY);
            clearNotifications(ROWS_GENTLE, closeShade);
        });
        mSections = mSectionsManager.createSectionsForBuckets();

        mAmbientState = new AmbientState(context, mSectionsManager);