summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Lin <danny@kdrag0n.dev>2021-05-05 16:34:21 -0700
committeralk3pInjection <webmaster@raspii.tech>2021-09-27 21:17:05 +0800
commit2e2c7d8adb2d44171594a93a6efd591fdb0014ef (patch)
treef7f84cf432a366b61242556b5f1c071331942de0
parent50c09a10239bb096c4d9ba36df653a29bf365163 (diff)
DepthController: Change blur radius to dimension resource
This allows us to define the blur radius in device-independent pixels instead of physical pixels, which is necessary to fix discrepancies in apparent blur strength across devices with different pixel densities. Change-Id: Ib45aeb023304aa6a70986be565f64ab38bbd1a9c
-rw-r--r--quickstep/recents_ui_overrides/res/values/config.xml4
-rw-r--r--quickstep/src/com/android/launcher3/statehandlers/DepthController.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/quickstep/recents_ui_overrides/res/values/config.xml b/quickstep/recents_ui_overrides/res/values/config.xml
index 82c5e0b5a..426037822 100644
--- a/quickstep/recents_ui_overrides/res/values/config.xml
+++ b/quickstep/recents_ui_overrides/res/values/config.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<resources>
- <integer name="max_depth_blur_radius">175</integer>
-</resources> \ No newline at end of file
+ <dimen name="max_depth_blur_radius">50dp</dimen>
+</resources>
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
index 9de8ae950..4ef3124b1 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
@@ -100,7 +100,7 @@ public class DepthController implements StateHandler<LauncherState>,
/**
* Blur radius when completely zoomed out, in pixels.
*/
- private int mMaxBlurRadius;
+ private float mMaxBlurRadius;
private WallpaperManagerCompat mWallpaperManager;
private SurfaceControlCompat mSurface;
/**
@@ -120,7 +120,7 @@ public class DepthController implements StateHandler<LauncherState>,
private void ensureDependencies() {
if (mWallpaperManager == null) {
- mMaxBlurRadius = mLauncher.getResources().getInteger(R.integer.max_depth_blur_radius);
+ mMaxBlurRadius = mLauncher.getResources().getDimension(R.dimen.max_depth_blur_radius);
mWallpaperManager = new WallpaperManagerCompat(mLauncher);
}
if (mLauncher.getRootView() != null && mOnAttachListener == null) {