Created
March 17, 2021 13:31
-
-
Save ricknout/8d772d58ca57bf13483c6769bc12a426 to your computer and use it in GitHub Desktop.
MDC-Android ShapeableImageView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In res/values/shape.xml --> | |
<style name="ShapeAppearanceOverlay.App.Image" parent=""> | |
<item name="cornerSize">0dp</item> | |
<item name="cornerSizeTopLeft">50%</item> | |
</style> | |
<!-- In layout --> | |
<com.google.android.material.imageview.ShapeableImageView | |
android:layout_width="match_parent" | |
android:layout_height="192dp" | |
android:scaleType="centerCrop" | |
app:srcCompat="@drawable/image" | |
android:contentDescription="@string/content_description" | |
app:shapeAppearance="?attr/shapeAppearanceMediumComponent" | |
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.Image" | |
app:strokeColor="?attr/colorPrimary" | |
app:strokeWidth="2dp" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment