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

Verified Commit 01323bad authored by Saalim Quadri's avatar Saalim Quadri
Browse files

feat: Ensure blur is re-calculated everytime

parent 46590672
Loading
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -76,9 +76,17 @@ class BlurWallpaperProvider(val context: Context) : SafeCloseable {

    private var lastOffset = 0.5f

    private val displayInfoChangeListener =
        DisplayController.DisplayInfoChangeListener { _, _, flags ->
            if ((flags and DisplayController.CHANGE_ROTATION) != 0) {
                orientationChanged()
            }
        }

    init {
        isEnabled = getEnabledStatus()
        updateAsync()
        DisplayController.INSTANCE.get(context).addChangeListener(displayInfoChangeListener)
    }

    private fun getEnabledStatus() = mWallpaperManager.wallpaperInfo == null
@@ -311,5 +319,9 @@ class BlurWallpaperProvider(val context: Context) : SafeCloseable {
        var isEnabled: Boolean = false
    }

    override fun close() {}
    override fun close() {
        DisplayController.INSTANCE.executeIfCreated {
            it.removeChangeListener(displayInfoChangeListener)
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -1392,6 +1392,10 @@ public class Launcher extends StatefulActivity<LauncherState>
        mAppMonitor.onLauncherPreResume();
        super.onResume();

        if (getDeviceProfile().isPhone) {
            BlurWallpaperProvider.Companion.getInstance(this).orientationChanged();
        }

        if (mDeferOverlayCallbacks) {
            scheduleDeferredCheck();
        } else {
+6 −1
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.statemanager.StatefulContainer;
import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.ScreenOnTracker;
import com.android.launcher3.util.ScreenOnTracker.ScreenOnListener;
import com.android.launcher3.util.Themes;
@@ -169,8 +171,11 @@ public class SysUiScrim implements View.OnAttachStateChangeListener {
     */
    public void onInsetsChanged(Rect insets) {
        DeviceProfile dp = mContainer.getDeviceProfile();
        NavigationMode navMode = DisplayController.getNavigationMode(mContainer.getContext());
        mDrawTopScrim = insets.top > 0;
        mDrawBottomScrim = !dp.isVerticalBarLayout() && !dp.isGestureMode && !dp.isTaskbarPresent;
        mDrawBottomScrim = !dp.isVerticalBarLayout()
                && !navMode.hasGestures
                && !dp.isTaskbarPresent;
    }

    @Override