Fix window corner radius override

This commit is contained in:
Suphon Thanakornpakapong
2021-10-10 11:54:32 +07:00
parent 01563bce7d
commit 95016d0ec1
2 changed files with 13 additions and 0 deletions

View File

@@ -269,12 +269,18 @@ public class QuickStepContract {
return mode == NAV_BAR_MODE_3BUTTON;
}
public static boolean sHasCustomCornerRadius = false;
public static float sCustomCornerRadius = 0f;
/**
* Corner radius that should be used on windows in order to cover the display.
* These values are expressed in pixels because they should not respect display or font
* scaling, this means that we don't have to reload them on config changes.
*/
public static float getWindowCornerRadius(Resources resources) {
if (sHasCustomCornerRadius) {
return sCustomCornerRadius;
}
return ScreenDecorationsUtils.getWindowCornerRadius(resources);
}

View File

@@ -44,6 +44,7 @@ import com.android.launcher3.uioverrides.QuickstepLauncher
import com.android.launcher3.uioverrides.states.OverviewState
import com.android.launcher3.util.Themes
import com.android.systemui.plugins.shared.LauncherOverlayManager
import com.android.systemui.shared.system.QuickStepContract
import kotlinx.coroutines.launch
import kotlin.math.roundToInt
@@ -98,6 +99,12 @@ class LawnchairLauncher : QuickstepLauncher(), LifecycleOwner,
}
})
}
prefs.overrideWindowCornerRadius.subscribeValues(this) {
QuickStepContract.sHasCustomCornerRadius = it
}
prefs.windowCornerRadius.subscribeValues(this) {
QuickStepContract.sCustomCornerRadius = it.toFloat()
}
}
override fun setupViews() {