Skip to content
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

BlurView does not work properly with round shapes #140

Closed
Seyf25 opened this issue Mar 26, 2021 · 2 comments
Closed

BlurView does not work properly with round shapes #140

Seyf25 opened this issue Mar 26, 2021 · 2 comments
Labels

Comments

@Seyf25
Copy link

Seyf25 commented Mar 26, 2021

Please include:

  1. Library version: 1.6.6
  2. Device and OS version: Pixel 3A/Android 9 (Emulator)

I use normal in the hierarchy. The codes are as you show them. I even tried what is said in #37 and #85 but it didn't work.

XML:

<eightbitlab.com.blurview.BlurView
            android:id="@+id/blurViewKaza"
            android:layout_width="@dimen/_80sdp"
            android:layout_height="@dimen/_80sdp"
            android:background="@color/transparent"
            app:blurOverlayColor="@color/transparent"
            app:layout_constraintEnd_toStartOf="@+id/blurViewZikir"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toEndOf="@+id/blurViewNamaz"
            app:layout_constraintTop_toTopOf="@+id/blurViewNamaz">

            <androidx.cardview.widget.CardView
                android:id="@+id/cardKazaTakibi"
                android:layout_width="@dimen/_80sdp"
                android:layout_height="@dimen/_80sdp"
                app:cardBackgroundColor="@color/transparent"
                app:cardCornerRadius="@dimen/_15sdp">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <ImageView
                        android:id="@+id/imgAnaEkranKaza"
                        android:layout_width="@dimen/_47sdp"
                        android:layout_height="@dimen/_47sdp"
                        android:background="@drawable/ic_modern_kaza_btn"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintHorizontal_bias="0.5"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/txtModernKazaTakipMain"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="@dimen/_1sdp"
                        android:gravity="center"
                        android:text="@string/anaekran_kazatakibi"
                        android:textColor="@color/modern_siyah"
                        android:textSize="@dimen/_12sdp"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintHorizontal_bias="0.5"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/imgAnaEkranKaza" />
                </androidx.constraintlayout.widget.ConstraintLayout>

            </androidx.cardview.widget.CardView>
        </eightbitlab.com.blurview.BlurView>

Java Code:

blurViewKaza.setupWith( rootView )
                    .setFrameClearDrawable( windowBackground )
                    .setBlurAlgorithm( new RenderScriptBlur( this ) )
                    .setBlurRadius( radius )
                    .setBlurAutoUpdate( true )
                    .setHasFixedTransformationMatrix( true );
blurViewKaza.setOutlineProvider( ViewOutlineProvider.BACKGROUND );
blurViewKaza.setClipToOutline( true );


Full Image: https://pasteboard.co/JUnqiNq.png
Detail image: https://pasteboard.co/JUnqIq9.png
Thanks in advance.

@Dimezis
Copy link
Owner

Dimezis commented Mar 26, 2021

You don't have a rounded drawable applied to the BlurView.
It behaves like any normal View would, you just have a wrong setup.
Remove the CardView and apply rounded corners and elevation to the BlurView directly

@Seyf25
Copy link
Author

Seyf25 commented Mar 26, 2021

You don't have a rounded drawable applied to the BlurView.
It behaves like any normal View would, you just have a wrong setup.
Remove the CardView and apply rounded corners and elevation to the BlurView directly

Thanks a lot when you did as you said, I missed it :)

@Dimezis Dimezis closed this as completed Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants