Skip to content

Instantly share code, notes, and snippets.

View Besong's full-sized avatar
💭
I may be slow to respond.

Besong-Anong Ernest Egbenchong II Besong

💭
I may be slow to respond.
View GitHub Profile
@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
GoogleFontsIntoM3Theme { // GoogleFontsIntoM3Theme is my project's theme
Greeting("World")
}
}
Text(
text = "Hello, $name!",
modifier = modifier,
style = MaterialTheme.typography.displayLarge
)
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Column(modifier = modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally) {
Text(
text = "Hello, $name!",
modifier = modifier
)
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
),
displayLarge = TextStyle(
displayLarge = TextStyle(
fontFamily = FontFamily(Font(R.font.montserrat_semibold)),
fontWeight = FontWeight.SemiBold,
lineHeight = 23.sp,
fontSize = 30.sp,
letterSpacing = 2.sp
)
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
)
/* Other default text styles to override
@Composable
fun Movie(movie: Movie, modifier: Modifier = Modifier) {
Row(
modifier.padding(horizontal = 5.dp, vertical = 10.dp)
) {
Text(
text = movie.name,
modifier = modifier
@Composable
fun Movies(modifier: Modifier = Modifier) {
val movies = mutableListOf(
Movie("Atlas", 2024),
Movie("Road House", 1989),
Movie("The Mummy", 1999),
Movie("Anna", 2019),
Movie("Mad Max: Fury Road", 2015),
Movie("Hidden Figures", 2016),
@Composable
fun MovieGenres(modifier: Modifier = Modifier) {
val genres = listOf(
"Action",
"History",
"Documentary",
"Sci-Fi",
"Thriller",
"Biography",
@Composable
fun MovieGenres(modifier: Modifier = Modifier) {
val genres = listOf(
"Action",
"History",
"Documentary",
"Sci-Fi",
"Thriller",
"Biography",