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

Commit f1f0c23a authored by Florence Yang's avatar Florence Yang Committed by Automerger Merge Worker
Browse files

Merge "Fix LS Smartspace Text Color" into udc-qpr-dev am: 1b70ba55 am: 9161d81f

parents e0dfa786 9161d81f
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -202,8 +202,6 @@ constructor(


    fun calculateScreenLocation(sampledView: View): RectF? {
    fun calculateScreenLocation(sampledView: View): RectF? {


        if (!sampledView.isLaidOut) return null

        val screenLocation = tmpScreenLocation
        val screenLocation = tmpScreenLocation
        /**
        /**
         * The method getLocationOnScreen is used to obtain the view coordinates relative to its
         * The method getLocationOnScreen is used to obtain the view coordinates relative to its
@@ -219,6 +217,10 @@ constructor(
        samplingBounds.right = left + sampledView.width
        samplingBounds.right = left + sampledView.width
        samplingBounds.bottom = top + sampledView.height
        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)
        return RectF(samplingBounds)
    }
    }


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


            updateTextColorFromWallpaper()
            updateTextColorFromWallpaper()
            statusBarStateListener.onDozeAmountChanged(0f, statusBarStateController.dozeAmount)
            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) {
        override fun onViewDetachedFromWindow(v: View) {
@@ -171,23 +184,6 @@ constructor(


        val filteredTargets = targets.filter(::filterSmartspaceTarget)
        val filteredTargets = targets.filter(::filterSmartspaceTarget)
        plugin?.onTargetsAvailable(filteredTargets)
        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 {
    private val userTrackerCallback = object : UserTracker.Callback {