Skip to content

Ripple in views near BlurView doesnt render (at least in Android 13) #185

Open
@hugomc92

Description

@hugomc92

Please include:

  1. Library version

2.0.2

  1. Device and OS version

OnePlus 6 Android 13 CherishOS (https://forum.xda-developers.com/t/rom-official-13-0-cherish-os-aosp-oneplus-6-6t-v4-0-4-sept-2022.4485817/)

  1. Detailed steps to reproduce the issue -

If you set a BlurView, every view with ripple near it doesnt show ripple.

Even when activities and aplication is hardware accelerated, at the moment the blurview is shown the ripple near it stop to work.

  1. XML layout and code for BlurView setup
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/rootLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:fitsSystemWindows="false">
    
    <eightbitlab.com.blurview.BlurView
        android:id="@+id/titleBlurView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="8dp"
        app:blurOverlayColor="@color/colorOverlay"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:clickable="false">
        
        <TextView
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:text="@string/my_packs"
            android:textSize="18sp"
            android:textStyle="bold"
            android:textColor="@color/colorPrimary"
            android:padding="16dp"
            android:layout_marginTop="24dp"/>
    </eightbitlab.com.blurview.BlurView>
    
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/boughtPacksList"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:nestedScrollingEnabled="false"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        android:paddingTop="78dp"
        android:paddingBottom="56dp"
        android:clipToPadding="false"
        android:layoutAnimation="@anim/layout_animation_fall_down"/>
</FrameLayout>

The ripple in the recycler items are set with

<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:focusable="true"
    android:foreground="?attr/selectableItemBackgroundBorderless">

   ... 

</androidx.constraintlayout.widget.ConstraintLayout>

I setup the blur as this

BlurUtils.setupBlur(titleBlurView, boughtPacksList, activity)

fun setupBlur(blurView: BlurView?, rootLayout: ViewGroup?, activity: Activity?, blurRadius: Float = 25f) {
  if(blurView != null) {
    blurView.setBlurEnabled(false)
    blurView.setBlurEnabled(true)
    
    val blurAlgorithm: BlurAlgorithm = if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) RenderEffectBlur() else RenderScriptBlur(blurView.context)
    
    rootLayout?.let {
    blurView.setupWith(rootLayout, blurAlgorithm)
      ?.setFrameClearDrawable(activity?.window?.decorView?.background)
      ?.setBlurRadius(blurRadius)
      ?.setBlurAutoUpdate(true)
    }
  }
}
  1. Stacktrace in case of a crash

Not a crash really but this log is showed.

The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions