-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add blurEnabled on HazeChildScope property (#408)
This allows developers on platforms where it is technically possible to blur, but Haze defaults not to due to known issues. Fixes #77
- Loading branch information
1 parent
28b67eb
commit 6a793fc
Showing
23 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+883 KB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled[28]_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+883 KB
.../screenshots/android/HazeScreenshotTest.creditCard_blurEnabled[28]_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+883 KB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled[28]_enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.53 MB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled[32]_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+883 KB
.../screenshots/android/HazeScreenshotTest.creditCard_blurEnabled[32]_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.53 MB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled[32]_enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.54 MB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+883 KB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.54 MB
haze/screenshots/android/HazeScreenshotTest.creditCard_blurEnabled_enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+959 KB
haze/screenshots/desktop/HazeScreenshotTest.creditCard_blurEnabled_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+559 KB
haze/screenshots/desktop/HazeScreenshotTest.creditCard_blurEnabled_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+959 KB
haze/screenshots/desktop/HazeScreenshotTest.creditCard_blurEnabled_enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
haze/src/androidMain/kotlin/dev/chrisbanes/haze/HazeNode.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2024, Christopher Banes and the Haze project contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package dev.chrisbanes.haze | ||
|
||
import android.os.Build | ||
|
||
/** | ||
* By default we only enable blurring on SDK Level 32 and above, at the moment. You can override | ||
* this via [HazeChildScope.blurEnabled] if required. | ||
* | ||
* See https://github.com/chrisbanes/haze/issues/77 for more details. | ||
*/ | ||
internal actual fun isBlurEnabledByDefault(): Boolean = Build.VERSION.SDK_INT >= 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
haze/src/skikoMain/kotlin/dev/chrisbanes/haze/HazeNode.skiko.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2024, Christopher Banes and the Haze project contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package dev.chrisbanes.haze | ||
|
||
/** | ||
* Skiko always has blurring support (that we know of). | ||
*/ | ||
internal actual fun isBlurEnabledByDefault(): Boolean = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters