https://github.com/leoando/rendereffectsample
RenderEffect sample (Android 12 +)
https://github.com/leoando/rendereffectsample
android android12 android12-support
Last synced: 19 days ago
JSON representation
RenderEffect sample (Android 12 +)
- Host: GitHub
- URL: https://github.com/leoando/rendereffectsample
- Owner: LeoAndo
- Created: 2021-05-22T11:39:06.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-05T07:31:36.000Z (almost 5 years ago)
- Last Synced: 2025-03-05T20:56:38.658Z (about 1 year ago)
- Topics: android, android12, android12-support
- Language: Kotlin
- Homepage:
- Size: 143 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RenderEffectSample
RenderEffect sample (Android 12 +)
[日本語版README](https://github.com/LeoAndo/RenderEffectSample/blob/main/readme/README_JP.md)
# Overview
Since Android 12, the view blur function has been added to the Android API, so it is the API verification app.
# API
[RenderEffect](https://developer.android.com/reference/android/graphics/RenderEffect)
[View#setRenderEffect](https://developer.android.com/reference/android/view/View#setRenderEffect(android.graphics.RenderEffect))
[setBackgroundBlurRadius](https://developer.android.com/reference/android/view/Window#setBackgroundBlurRadius(int))
`setBackgroundBlurRadius` is used for Window content.
**Note that the following Exception will occur if `0.0` is specified for the arguments radiusX and radiusY of`View#setRenderEffect`.**
```
java.lang.IllegalArgumentException: nativePtr is null
```
# View blur functions
- Using the `setRenderEffect(android.graphics.RenderEffect)` API, you can set the blur in any view.
- [link](https://youtu.be/D2cU_itNDAI?t=848)
- You can also blur what is behind the Window content
- [link](https://youtu.be/D2cU_itNDAI?t=871)
# capture

# refs
[android-12-developer-preview-2](https://android-developers.googleblog.com/2021/03/android-12-developer-preview-2.html)