Skip to content

Instantly share code, notes, and snippets.

@hsmnzaydn
Created June 18, 2022 21:56
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 hsmnzaydn/d3b18a609627c65a709b595f016dc141 to your computer and use it in GitHub Desktop.
Save hsmnzaydn/d3b18a609627c65a709b595f016dc141 to your computer and use it in GitHub Desktop.
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@ExperimentalMaterial3Api
@Composable
fun ItemView() {
Card(
modifier = Modifier.padding(8.dp),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface,
),
shape = MaterialTheme.shapes.large,
) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
Text(
text = "Title",
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface
)
Column(modifier = Modifier.padding(16.dp)) {
Text(
text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface
)
}
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun PreviewItemView() {
ItemView()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment