Skip to content

Instantly share code, notes, and snippets.

@erfanegtfi
Created June 19, 2020 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erfanegtfi/24e97a0e430d41b7a91252b775095fc8 to your computer and use it in GitHub Desktop.
Save erfanegtfi/24e97a0e430d41b7a91252b775095fc8 to your computer and use it in GitHub Desktop.
float radius = context.getResources().getDimension(R.dimen.border_radius_hug);
shapeAppearanceModel = new ShapeAppearanceModel()
.toBuilder()
.setAllCorners(CornerFamily.ROUNDED,radius)
.build();
imageView.setShapeAppearanceModel(shapeAppearanceModel)
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/thumb"
android:layout_width="80dp"
android:layout_height="60dp"
app:shapeAppearanceOverlay="@style/circleImageView"
/>
<style name="circleImageView" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">10%</item>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment