Created
August 17, 2020 13:08
-
-
Save Rokata9/a15913a33abd56f3cf69ff33cf088104 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 com.example.secondtry | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.preferredSize | |
import androidx.compose.foundation.shape.CircleShape | |
import androidx.compose.material.Card | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.layout.ContentScale | |
import androidx.compose.ui.res.imageResource | |
import androidx.compose.ui.unit.dp | |
@Composable | |
fun RoundedImage() { | |
Card(modifier = Modifier.preferredSize(42.dp), | |
shape = CircleShape, | |
elevation = 2.dp) | |
{ | |
Image(imageResource(id = R.drawable.no_avatar), | |
contentScale = ContentScale.Crop, | |
modifier = Modifier.fillMaxSize()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment