0

Im trying to blur the recyclerview and show a cardview above of the blur effect just like how instagram is doing

enter image description here

Edit :- Tried This for blurring the recyclerview , after using https://github.com/mmin18/RealtimeBlurView , but not sure if i have implemented it correctly or not

  <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler_view_meme"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layerType="hardware" />
    <com.github.mmin18.widget.RealtimeBlurView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:realtimeBlurRadius="20dp"
        app:realtimeOverlayColor="#8000"/>

    <com.google.android.material.card.MaterialCardView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:backgroundTint="@color/darkGray"
        app:cardCornerRadius="30dp">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="30dp"
            android:orientation="vertical">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center|top"
                android:text="Unlock !"
                android:textColor="@color/white"
                android:textSize="30sp" />

            <View

                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/cardview_dark_background"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="10dp"
                android:text="Unlock post video by watching an Ad"
                android:textColor="@color/white"
                android:textSize="20sp" />

            <com.google.android.material.button.MaterialButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="10dp"
                android:backgroundTint="@color/white"
                android:text="Watch Ad"
                android:textColor="@color/black"
                app:cornerRadius="20dp"/>
        </LinearLayout>


    </com.google.android.material.card.MaterialCardView>
Vasant Raval
  • 257
  • 1
  • 12
  • 31
  • You should keep one background Imageview and for that imageview you should apply this (https://stackoverflow.com/questions/31641973) – Rujul Gandhi Aug 02 '23 at 05:43
  • its not like that , i dont have a fixed content so adding a static image will not work for me , which also dosent shows the content hints behnd – Vasant Raval Aug 02 '23 at 05:52
  • i recently just view a SO question where he was using a libarary to blur a view itself but i dont remember , im trying to find it in my history – Vasant Raval Aug 02 '23 at 05:53
  • i found it , https://stackoverflow.com/a/51734181/12438238, but i dont know how will this work on recyclerview – Vasant Raval Aug 02 '23 at 05:54
  • What is the issue ? Explain issue or error logs or something. – Rujul Gandhi Aug 02 '23 at 05:56
  • let me try this https://stackoverflow.com/a/51734181/12438238 first , i will let u know in some time – Vasant Raval Aug 02 '23 at 05:57
  • @RujulGandhi Can u tell me if this is a correct implementation ?, View the edited Section – Vasant Raval Aug 02 '23 at 06:12
  • Put some code then only people will understand.. – Rujul Gandhi Aug 03 '23 at 09:35
  • i had added the already which was shown in the github page , but didnt know if it was implemented correctly or not – Vasant Raval Aug 03 '23 at 10:12
  • now i just added a imageview as a background and got blur grey image , its working but not like instagram one , but im okay with it , and u are saying about the code – Vasant Raval Aug 03 '23 at 10:12
  • It's okay if your issue is resolved. but just telling you please keep your question neat and clean with code and needed information or else people won't understand the problem. – Rujul Gandhi Aug 04 '23 at 05:45

0 Answers0