androidx / constraintlayout

ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way
Apache License 2.0
1.06k stars 177 forks source link

In Android8.1 (27), the round setting is too large, and the ImageFilterView cannot be displayed #814

Closed john990 closed 1 year ago

john990 commented 1 year ago

I want to create an ImageView with a circular background, implemented using ImageFilterView, which is displayed normally on 27+ systems, but cannot be displayed in Android 8.1.

Constraintlayout version:

androidx.constraintlayout:constraintlayout:2.1.4

Layout xml code:

<androidx.constraintlayout.utils.widget.ImageFilterView
        android:id="@+id/gallery_button"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_marginStart="20dp"
        android:clickable="true"
        android:background="@color/black_30"
        android:foreground="?attr/selectableItemBackground"
        android:src="@drawable/ic_round_photo_library_24"
        app:round="1000dp"
        android:padding="13dp"
        app:tint="@color/white"/>

Android10 screenshot(work fine): Snipaste_2023-05-12_10-43-47

Android8.1 screenshot: Snipaste_2023-05-12_10-45-07

Tip: Click events can be responded to.

jafu888 commented 1 year ago

app:round="1000dp" might be a problem I would recommend app:roundPercent="1"

In general it should work back to Android 5.x (Lollipop) Try to first put a simple white view in its place. To make sure some other change is not obscuring the widget. For example it could be the way the camera is being implemented .

john990 commented 1 year ago

app:round="1000dp" might be a problem I would recommend app:roundPercent="1"

In general it should work back to Android 5.x (Lollipop) Try to first put a simple white view in its place. To make sure some other change is not obscuring the widget. For example it could be the way the camera is being implemented .

app:roundPercent="1" works great! thank you so much!