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

Commit 1b70ba55 authored by Florence Yang's avatar Florence Yang Committed by Android (Google) Code Review
Browse files

Merge "Fix LS Smartspace Text Color" into udc-qpr-dev

parents ab8d6382 076f2c6d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -202,8 +202,6 @@ constructor(

    fun calculateScreenLocation(sampledView: View): RectF? {

        if (!sampledView.isLaidOut) return null

        val screenLocation = tmpScreenLocation
        /**
         * The method getLocationOnScreen is used to obtain the view coordinates relative to its
@@ -219,6 +217,10 @@ constructor(
        samplingBounds.right = left + sampledView.width
        samplingBounds.bottom = top + sampledView.height

        // ensure never go out of bounds
        if (samplingBounds.right > displaySize.x) samplingBounds.right = displaySize.x
        if (samplingBounds.bottom > displaySize.y) samplingBounds.bottom = displaySize.y

        return RectF(samplingBounds)
    }

+13 −17
Original line number Diff line number Diff line
@@ -137,6 +137,19 @@ constructor(

            updateTextColorFromWallpaper()
            statusBarStateListener.onDozeAmountChanged(0f, statusBarStateController.dozeAmount)

            if (regionSamplingEnabled && (!regionSamplers.containsKey(v))) {
                var regionSampler = RegionSampler(
                        v as View,
                        uiExecutor,
                        bgExecutor,
                        regionSamplingEnabled,
                        isLockscreen = true,
                ) { updateTextColorFromRegionSampler() }
                initializeTextColors(regionSampler)
                regionSamplers[v] = regionSampler
                regionSampler.startRegionSampler()
            }
        }

        override fun onViewDetachedFromWindow(v: View) {
@@ -171,23 +184,6 @@ constructor(

        val filteredTargets = targets.filter(::filterSmartspaceTarget)
        plugin?.onTargetsAvailable(filteredTargets)
        if (!isRegionSamplersCreated) {
            for (v in smartspaceViews) {
                if (regionSamplingEnabled) {
                    var regionSampler = RegionSampler(
                        v as View,
                        uiExecutor,
                        bgExecutor,
                        regionSamplingEnabled,
                        isLockscreen = true,
                    ) { updateTextColorFromRegionSampler() }
                    initializeTextColors(regionSampler)
                    regionSamplers[v] = regionSampler
                    regionSampler.startRegionSampler()
                }
            }
            isRegionSamplersCreated = true
        }
    }

    private val userTrackerCallback = object : UserTracker.Callback {