Juky-App / SquircleView

SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.
Other
105 stars 5 forks source link

set padding for ImageView not works #19

Closed mhkarami closed 1 year ago

mhkarami commented 2 years ago

squircleimageview padding not works and size of image view content does not change

          <app.juky.squircleview.views.SquircleImageView
            android:id="@+id/imgback"
            android:layout_width="48dp"
            android:layout_height="48dp"
            app:squircle_background_color="@color/btn_back_gradient_end"
            app:squircle_background_image="@drawable/ic_arrow_left"
            app:squircle_border_width="0dp"
            android:layout_margin="16dp"
            android:padding="8dp"
            android:src="@drawable/ic_arrow_left" // tested this
            app:srcCompat="@drawable/ic_arrow_left" // tested this
            android:scaleType="centerInside" // tested this
            />
Nielssg commented 2 years ago

If you would like to specify any scaleType (the library currently always centers the image) or padding, you might be better of using a ShapeableImageView in combination with a shape appearance. Please check the readme on how to do that. You can set the src of a SquircleImageView by using the app:squircle_background_image property rather than android:src