当前位置:网站首页>Constraintlayout officially provides rounded imagefilterview

Constraintlayout officially provides rounded imagefilterview

2022-07-05 10:11:00 A bird carved in the desert

Round corners ImageFilterView,ImageFilterButton

In my impression, this should be the first official round corner function view Is that right , In addition to the fillet function ,ImageFilterView,ImageFilterButton There are a bunch of other functions .

  • Round corners app:round, Value 0-50dp, Default 0, It's a square , Set up 50 It's a circular picture , exceed 50 Nothing else , Or a circular picture .
  • Fillet scale app:roundPercent, Value 0-1 Between , Default 0 It's a square ,1 It's a circular picture , ditto , exceed 1 according to 1 Handle , Or a circular picture .
  • Cross plot app:altSrc, Need to follow app:crossfade The common use ,app:crossfade Value 0-1, Default 0 It is completely transparent for the cross graph , Don't show . Value 1 The cross plot completely shows , cover src On .
    app:overlay, Official interpretation : Definition alt The image is faded in at the top of the original image , Or cross fade in . The default value is true. Set to... For translucent objects false. I haven't tried the effect .
  • Color temperature app:warmt,float type , The default value is 1, Less than 1 It's a cool color , Greater than 1 It's a warm color .
  • brightness app:brightness,float type , Default 1, The higher the value, the higher the brightness .
  • saturation app:brightness,float type , Default 1, Value 0 In grayscale style , Greater than 1 The values of are all supersaturated , The color is very gorgeous , It's a little hot eyes .
  • Contrast app:contrast,float type , Default 1, Value 0 It is equivalent to the picture turning black , Greater than 1 All in high contrast .
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
    android:orientation="vertical">

    <androidx.constraintlayout.utils.widget.ImageFilterView
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:layout_gravity="center_horizontal"
        android:src="@drawable/ic_launcher_background"
        app:roundPercent="1" />
</LinearLayout>

Use effect :

原网站

版权声明
本文为[A bird carved in the desert]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050941163607.html