-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for circle shape blur #45
Comments
Same issue as me but connected PR didn't work for me In my project, I am using Fresco and I don't have much time, so I solved it by changing to |
Hello. It's a good day to code I used OutlineProvider and everything is happy now. Attach some of the code created for databinding. @BindingAdapter("roundOutlineRadius")
fun View.setRoundOutlineRadiusBinding(roundOutlineRadius: Float) {
outlineProvider = object : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline?) {
outline?.setRoundRect(0, 0, view.width, view.height, roundOutlineRadius)
}
}
clipToOutline = true
}
@BindingAdapter("roundAsCircle")
fun View.setRoundAsCircleBinding(isCircle: Boolean) {
if (isCircle) {
outlineProvider = object : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline?) {
val rect = Rect(0, 0, view.width, view.height)
outline?.setRoundRect(rect, rect.width() / 2f)
}
}
clipToOutline = true
}
} <com.github.mmin18.widget.RealtimeBlurView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_margin="30dp"
app:realtimeBlurRadius="5dp"
app:realtimeOverlayColor="#4fff"
app:roundAsCircle="@{true}"
app:layout_constraintStart_toStartOf="@id/image"
app:layout_constraintTop_toTopOf="@id/image" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
It would be nice to also support blurring in a shape of circle, not only squares or rectangles.
The text was updated successfully, but these errors were encountered: