For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
The Material Components Library introduced with the 1.2.0-alpha03
the new ShapeableImageView
.
In your layout you can use:
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image_view"
app:srcCompat="@drawable/..." />
Then in your code apply the ShapeAppearanceModel
to define your custom corners:
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
package des.c5inco.cardswipecompose | |
import androidx.compose.animation.core.Animatable | |
import androidx.compose.animation.core.CubicBezierEasing | |
import androidx.compose.animation.core.LinearOutSlowInEasing | |
import androidx.compose.animation.core.animateDpAsState | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.animation.core.calculateTargetValue | |
import androidx.compose.animation.core.keyframes | |
import androidx.compose.animation.splineBasedDecay |