|
|
@ -19,7 +19,6 @@ import org.jetbrains.compose.demo.widgets.platform.Res |
|
|
|
import org.jetbrains.compose.demo.widgets.platform.imageResource |
|
|
|
import org.jetbrains.compose.demo.widgets.platform.imageResource |
|
|
|
import org.jetbrains.compose.demo.widgets.platform.vectorResource |
|
|
|
import org.jetbrains.compose.demo.widgets.platform.vectorResource |
|
|
|
import org.jetbrains.compose.demo.widgets.theme.twitterColor |
|
|
|
import org.jetbrains.compose.demo.widgets.theme.twitterColor |
|
|
|
import org.jetbrains.compose.demo.widgets.theme.typography |
|
|
|
|
|
|
|
import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText |
|
|
|
import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText |
|
|
|
import org.jetbrains.compose.demo.widgets.ui.utils.TitleText |
|
|
|
import org.jetbrains.compose.demo.widgets.ui.utils.TitleText |
|
|
|
|
|
|
|
|
|
|
@ -39,7 +38,7 @@ private fun TopAppBarsDemo() { |
|
|
|
elevation = 8.dp, |
|
|
|
elevation = 8.dp, |
|
|
|
navigationIcon = { |
|
|
|
navigationIcon = { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
Icon(Icons.Default.ArrowBack) |
|
|
|
Icon(Icons.Default.ArrowBack, contentDescription = "ArrowBack") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
@ -53,12 +52,12 @@ private fun TopAppBarsDemo() { |
|
|
|
elevation = 8.dp, |
|
|
|
elevation = 8.dp, |
|
|
|
navigationIcon = { |
|
|
|
navigationIcon = { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
Icon(vectorResource(Res.drawable.ic_instagram)) |
|
|
|
Icon(vectorResource(Res.drawable.ic_instagram), contentDescription = "Instagram") |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
actions = { |
|
|
|
actions = { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
Icon(vectorResource(Res.drawable.ic_send)) |
|
|
|
Icon(vectorResource(Res.drawable.ic_send), contentDescription = "Send") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
@ -69,6 +68,7 @@ private fun TopAppBarsDemo() { |
|
|
|
title = { |
|
|
|
title = { |
|
|
|
Icon( |
|
|
|
Icon( |
|
|
|
vectorResource(Res.drawable.ic_twitter), |
|
|
|
vectorResource(Res.drawable.ic_twitter), |
|
|
|
|
|
|
|
contentDescription = "Twitter", |
|
|
|
tint = twitterColor, |
|
|
|
tint = twitterColor, |
|
|
|
modifier = Modifier.fillMaxWidth() |
|
|
|
modifier = Modifier.fillMaxWidth() |
|
|
|
) |
|
|
|
) |
|
|
@ -79,6 +79,7 @@ private fun TopAppBarsDemo() { |
|
|
|
navigationIcon = { |
|
|
|
navigationIcon = { |
|
|
|
Image( |
|
|
|
Image( |
|
|
|
imageResource(Res.drawable.p6), |
|
|
|
imageResource(Res.drawable.p6), |
|
|
|
|
|
|
|
contentDescription = "", |
|
|
|
modifier = Modifier.padding(vertical = 4.dp, horizontal = 8.dp) |
|
|
|
modifier = Modifier.padding(vertical = 4.dp, horizontal = 8.dp) |
|
|
|
.preferredSize(32.dp).clip(CircleShape) |
|
|
|
.preferredSize(32.dp).clip(CircleShape) |
|
|
|
) |
|
|
|
) |
|
|
@ -86,6 +87,7 @@ private fun TopAppBarsDemo() { |
|
|
|
actions = { |
|
|
|
actions = { |
|
|
|
Icon( |
|
|
|
Icon( |
|
|
|
Icons.Default.StarBorder, |
|
|
|
Icons.Default.StarBorder, |
|
|
|
|
|
|
|
contentDescription = "", |
|
|
|
modifier = Modifier.padding(horizontal = 8.dp) |
|
|
|
modifier = Modifier.padding(horizontal = 8.dp) |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
@ -102,7 +104,7 @@ private fun BottomAppBarDemo() { |
|
|
|
cutoutShape = CircleShape |
|
|
|
cutoutShape = CircleShape |
|
|
|
) { |
|
|
|
) { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
IconButton(onClick = {}) { |
|
|
|
Icon(Icons.Default.MoreHoriz) |
|
|
|
Icon(Icons.Default.MoreHoriz, contentDescription = "") |
|
|
|
} |
|
|
|
} |
|
|
|
TitleText(title = "Bottom App Bar") |
|
|
|
TitleText(title = "Bottom App Bar") |
|
|
|
} |
|
|
|
} |
|
|
@ -115,19 +117,19 @@ private fun NavigationBarDemo() { |
|
|
|
val navItemState = remember { mutableStateOf(NavType.HOME) } |
|
|
|
val navItemState = remember { mutableStateOf(NavType.HOME) } |
|
|
|
BottomNavigation(backgroundColor = MaterialTheme.colors.surface) { |
|
|
|
BottomNavigation(backgroundColor = MaterialTheme.colors.surface) { |
|
|
|
BottomNavigationItem( |
|
|
|
BottomNavigationItem( |
|
|
|
icon = { Icon(Icons.Outlined.Home) }, |
|
|
|
icon = { Icon(Icons.Outlined.Home, contentDescription = "Home") }, |
|
|
|
selected = navItemState.value == NavType.HOME, |
|
|
|
selected = navItemState.value == NavType.HOME, |
|
|
|
onClick = { navItemState.value = NavType.HOME }, |
|
|
|
onClick = { navItemState.value = NavType.HOME }, |
|
|
|
label = { Text(text = Res.string.spotify_nav_home) }, |
|
|
|
label = { Text(text = Res.string.spotify_nav_home) }, |
|
|
|
) |
|
|
|
) |
|
|
|
BottomNavigationItem( |
|
|
|
BottomNavigationItem( |
|
|
|
icon = { Icon(Icons.Outlined.Search) }, |
|
|
|
icon = { Icon(Icons.Outlined.Search, contentDescription = "Search") }, |
|
|
|
selected = navItemState.value == NavType.SEARCH, |
|
|
|
selected = navItemState.value == NavType.SEARCH, |
|
|
|
onClick = { navItemState.value = NavType.SEARCH }, |
|
|
|
onClick = { navItemState.value = NavType.SEARCH }, |
|
|
|
label = { Text(text = Res.string.spotify_nav_search) } |
|
|
|
label = { Text(text = Res.string.spotify_nav_search) } |
|
|
|
) |
|
|
|
) |
|
|
|
BottomNavigationItem( |
|
|
|
BottomNavigationItem( |
|
|
|
icon = { Icon(Icons.Outlined.LibraryMusic) }, |
|
|
|
icon = { Icon(Icons.Outlined.LibraryMusic, contentDescription = "LibraryMusic") }, |
|
|
|
selected = navItemState.value == NavType.LIBRARY, |
|
|
|
selected = navItemState.value == NavType.LIBRARY, |
|
|
|
onClick = { navItemState.value = NavType.LIBRARY }, |
|
|
|
onClick = { navItemState.value = NavType.LIBRARY }, |
|
|
|
label = { Text(text = Res.string.spotify_nav_library) } |
|
|
|
label = { Text(text = Res.string.spotify_nav_library) } |
|
|
@ -138,17 +140,17 @@ private fun NavigationBarDemo() { |
|
|
|
|
|
|
|
|
|
|
|
BottomNavigation { |
|
|
|
BottomNavigation { |
|
|
|
BottomNavigationItem( |
|
|
|
BottomNavigationItem( |
|
|
|
icon = { Icon(Icons.Outlined.ReadMore) }, |
|
|
|
icon = { Icon(Icons.Outlined.ReadMore, contentDescription = "ReadMore") }, |
|
|
|
selected = navItemState.value == NavType.HOME, |
|
|
|
selected = navItemState.value == NavType.HOME, |
|
|
|
onClick = { navItemState.value = NavType.HOME }, |
|
|
|
onClick = { navItemState.value = NavType.HOME }, |
|
|
|
) |
|
|
|
) |
|
|
|
BottomNavigationItem( |
|
|
|
BottomNavigationItem( |
|
|
|
icon = { Icon(Icons.Outlined.Search) }, |
|
|
|
icon = { Icon(Icons.Outlined.Search, contentDescription = "Search") }, |
|
|
|
selected = navItemState.value == NavType.SEARCH, |
|
|
|
selected = navItemState.value == NavType.SEARCH, |
|
|
|
onClick = { navItemState.value = NavType.SEARCH }, |
|
|
|
onClick = { navItemState.value = NavType.SEARCH }, |
|
|
|
) |
|
|
|
) |
|
|
|
BottomNavigationItem( |
|
|
|
BottomNavigationItem( |
|
|
|
icon = { Icon(Icons.Outlined.CleanHands) }, |
|
|
|
icon = { Icon(Icons.Outlined.CleanHands, contentDescription = "CleanHands") }, |
|
|
|
selected = navItemState.value == NavType.LIBRARY, |
|
|
|
selected = navItemState.value == NavType.LIBRARY, |
|
|
|
onClick = { navItemState.value = NavType.LIBRARY }, |
|
|
|
onClick = { navItemState.value = NavType.LIBRARY }, |
|
|
|
) |
|
|
|
) |
|
|
|