From 6f56cab12929f0e459600e67c175c90cfd9b31e6 Mon Sep 17 00:00:00 2001 From: vfsfitvnm Date: Wed, 28 Sep 2022 16:59:07 +0200 Subject: [PATCH] Create SecondaryTextButton composable --- .../components/themed/SecondaryTextButton.kt | 34 +++++++++++++++++++ .../vimusic/ui/screens/album/AlbumOverview.kt | 25 +++++--------- .../builtinplaylist/LocalPlaylistSongList.kt | 25 ++++---------- .../ui/screens/home/HomePlaylistList.kt | 17 +++------- .../localplaylist/LocalPlaylistSongList.kt | 30 ++++++---------- .../ui/screens/playlist/PlaylistSongList.kt | 27 ++++++--------- .../ui/screens/search/LocalSongSearch.kt | 19 +++-------- .../vimusic/ui/screens/search/OnlineSearch.kt | 28 ++++----------- 8 files changed, 85 insertions(+), 120 deletions(-) create mode 100644 app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/themed/SecondaryTextButton.kt diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/themed/SecondaryTextButton.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/themed/SecondaryTextButton.kt new file mode 100644 index 0000000..2ac9aef --- /dev/null +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/themed/SecondaryTextButton.kt @@ -0,0 +1,34 @@ +package it.vfsfitvnm.vimusic.ui.components.themed + +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.BasicText +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.unit.dp +import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance +import it.vfsfitvnm.vimusic.utils.medium + +@Composable +fun SecondaryTextButton( + text: String, + onClick: () -> Unit, + modifier: Modifier = Modifier, + isEnabled: Boolean = true +) { + val (colorPalette, typography) = LocalAppearance.current + + BasicText( + text = text, + style = typography.xxs.medium, + modifier = modifier + .clip(RoundedCornerShape(16.dp)) + .clickable(enabled = isEnabled, onClick = onClick) + .background(colorPalette.background2) + .padding(all = 8.dp) + .padding(horizontal = 8.dp) + ) +} diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/album/AlbumOverview.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/album/AlbumOverview.kt index 237359b..bb04e88 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/album/AlbumOverview.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/album/AlbumOverview.kt @@ -20,7 +20,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicText import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -49,6 +48,7 @@ import it.vfsfitvnm.vimusic.ui.components.themed.Header import it.vfsfitvnm.vimusic.ui.components.themed.HeaderPlaceholder import it.vfsfitvnm.vimusic.ui.components.themed.NonQueuedMediaItemMenu import it.vfsfitvnm.vimusic.ui.components.themed.PrimaryButton +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.components.themed.TextPlaceholder import it.vfsfitvnm.vimusic.ui.styling.Dimensions import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance @@ -147,22 +147,13 @@ fun AlbumOverview( ) { Column { Header(title = album.title ?: "Unknown") { - if (songs.isNotEmpty()) { - BasicText( - text = "Enqueue", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable { - binder?.player?.enqueue( - songs.map(DetailedSong::asMediaItem) - ) - } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) - ) - } + SecondaryTextButton( + text = "Enqueue", + isEnabled = songs.isNotEmpty(), + onClick = { + binder?.player?.enqueue(songs.map(DetailedSong::asMediaItem)) + } + ) Spacer( modifier = Modifier diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/builtinplaylist/LocalPlaylistSongList.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/builtinplaylist/LocalPlaylistSongList.kt index fa1f7dc..50c9802 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/builtinplaylist/LocalPlaylistSongList.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/builtinplaylist/LocalPlaylistSongList.kt @@ -2,20 +2,14 @@ package it.vfsfitvnm.vimusic.ui.screens.builtinplaylist import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.foundation.text.BasicText import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.unit.dp import it.vfsfitvnm.vimusic.Database import it.vfsfitvnm.vimusic.LocalPlayerAwarePaddingValues import it.vfsfitvnm.vimusic.LocalPlayerServiceBinder @@ -27,6 +21,7 @@ import it.vfsfitvnm.vimusic.ui.components.themed.Header import it.vfsfitvnm.vimusic.ui.components.themed.InFavoritesMediaItemMenu import it.vfsfitvnm.vimusic.ui.components.themed.InHistoryMediaItemMenu import it.vfsfitvnm.vimusic.ui.components.themed.PrimaryButton +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.styling.Dimensions import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance import it.vfsfitvnm.vimusic.ui.styling.px @@ -35,7 +30,6 @@ import it.vfsfitvnm.vimusic.utils.asMediaItem import it.vfsfitvnm.vimusic.utils.enqueue import it.vfsfitvnm.vimusic.utils.forcePlayAtIndex import it.vfsfitvnm.vimusic.utils.forcePlayFromBeginning -import it.vfsfitvnm.vimusic.utils.medium import it.vfsfitvnm.vimusic.utils.produceSaveableState import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.flowOn @@ -44,7 +38,7 @@ import kotlinx.coroutines.flow.map @ExperimentalAnimationApi @Composable fun BuiltInPlaylistSongList(builtInPlaylist: BuiltInPlaylist) { - val (colorPalette, typography) = LocalAppearance.current + val (colorPalette) = LocalAppearance.current val binder = LocalPlayerServiceBinder.current val songs by produceSaveableState( @@ -87,17 +81,12 @@ fun BuiltInPlaylistSongList(builtInPlaylist: BuiltInPlaylist) { BuiltInPlaylist.Offline -> "Offline" } ) { - BasicText( + SecondaryTextButton( text = "Enqueue", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable(enabled = songs.isNotEmpty()) { - binder?.player?.enqueue(songs.map(DetailedSong::asMediaItem)) - } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) + isEnabled = songs.isNotEmpty(), + onClick = { + binder?.player?.enqueue(songs.map(DetailedSong::asMediaItem)) + } ) Spacer( diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/home/HomePlaylistList.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/home/HomePlaylistList.kt index 7d49b05..4fcdd18 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/home/HomePlaylistList.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/home/HomePlaylistList.kt @@ -19,8 +19,6 @@ import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.GridItemSpan import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.items -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.foundation.text.BasicText import androidx.compose.material.ripple.rememberRipple import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -30,7 +28,6 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.res.painterResource @@ -45,12 +42,12 @@ import it.vfsfitvnm.vimusic.models.Playlist import it.vfsfitvnm.vimusic.query import it.vfsfitvnm.vimusic.savers.PlaylistPreviewListSaver import it.vfsfitvnm.vimusic.ui.components.themed.Header +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.components.themed.TextFieldDialog import it.vfsfitvnm.vimusic.ui.styling.Dimensions import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance import it.vfsfitvnm.vimusic.ui.views.BuiltInPlaylistItem import it.vfsfitvnm.vimusic.ui.views.PlaylistPreviewItem -import it.vfsfitvnm.vimusic.utils.medium import it.vfsfitvnm.vimusic.utils.playlistSortByKey import it.vfsfitvnm.vimusic.utils.playlistSortOrderKey import it.vfsfitvnm.vimusic.utils.produceSaveableState @@ -64,7 +61,7 @@ fun HomePlaylistList( onBuiltInPlaylistClicked: (BuiltInPlaylist) -> Unit, onPlaylistClicked: (Playlist) -> Unit, ) { - val (colorPalette, typography) = LocalAppearance.current + val (colorPalette) = LocalAppearance.current var isCreatingANewPlaylist by rememberSaveable { mutableStateOf(false) @@ -137,15 +134,9 @@ fun HomePlaylistList( ) } - BasicText( + SecondaryTextButton( text = "New playlist", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable { isCreatingANewPlaylist = true } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) + onClick = { isCreatingANewPlaylist = true } ) Spacer( diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/localplaylist/LocalPlaylistSongList.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/localplaylist/LocalPlaylistSongList.kt index 7b12acc..9153fc5 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/localplaylist/LocalPlaylistSongList.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/localplaylist/LocalPlaylistSongList.kt @@ -12,15 +12,12 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.foundation.text.BasicText import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp @@ -42,6 +39,7 @@ import it.vfsfitvnm.vimusic.ui.components.themed.ConfirmationDialog import it.vfsfitvnm.vimusic.ui.components.themed.Header import it.vfsfitvnm.vimusic.ui.components.themed.InPlaylistMediaItemMenu import it.vfsfitvnm.vimusic.ui.components.themed.PrimaryButton +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.components.themed.TextFieldDialog import it.vfsfitvnm.vimusic.ui.styling.Dimensions import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance @@ -51,7 +49,6 @@ import it.vfsfitvnm.vimusic.utils.asMediaItem import it.vfsfitvnm.vimusic.utils.enqueue import it.vfsfitvnm.vimusic.utils.forcePlayAtIndex import it.vfsfitvnm.vimusic.utils.forcePlayFromBeginning -import it.vfsfitvnm.vimusic.utils.medium import it.vfsfitvnm.vimusic.utils.produceSaveableState import it.vfsfitvnm.youtubemusic.YouTube import kotlinx.coroutines.Dispatchers @@ -66,7 +63,7 @@ fun LocalPlaylistSongList( playlistId: Long, onDelete: () -> Unit, ) { - val (colorPalette, typography) = LocalAppearance.current + val (colorPalette) = LocalAppearance.current val binder = LocalPlayerServiceBinder.current val playlistWithSongs by produceSaveableState( @@ -141,21 +138,16 @@ fun LocalPlaylistSongList( contentType = 0 ) { Header(title = playlistWithSongs?.playlist?.name ?: "Unknown") { - BasicText( + SecondaryTextButton( text = "Enqueue", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable(enabled = playlistWithSongs?.songs?.isNotEmpty() == true) { - playlistWithSongs?.songs - ?.map(DetailedSong::asMediaItem) - ?.let { mediaItems -> - binder?.player?.enqueue(mediaItems) - } - } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) + isEnabled = playlistWithSongs?.songs?.isNotEmpty() == true, + onClick = { + playlistWithSongs?.songs + ?.map(DetailedSong::asMediaItem) + ?.let { mediaItems -> + binder?.player?.enqueue(mediaItems) + } + } ) Spacer( diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/playlist/PlaylistSongList.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/playlist/PlaylistSongList.kt index fd69b95..719ebd8 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/playlist/PlaylistSongList.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/playlist/PlaylistSongList.kt @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicText import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -47,6 +46,7 @@ import it.vfsfitvnm.vimusic.ui.components.themed.Header import it.vfsfitvnm.vimusic.ui.components.themed.HeaderPlaceholder import it.vfsfitvnm.vimusic.ui.components.themed.NonQueuedMediaItemMenu import it.vfsfitvnm.vimusic.ui.components.themed.PrimaryButton +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.components.themed.TextPlaceholder import it.vfsfitvnm.vimusic.ui.styling.Dimensions import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance @@ -119,22 +119,15 @@ fun PlaylistSongList( ) { Column { Header(title = playlist.title ?: "Unknown") { - if (playlist.songs?.isNotEmpty() == true) { - BasicText( - text = "Enqueue", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable { - playlist.songs?.map(YouTube.Item.Song::asMediaItem)?.let { mediaItems -> - binder?.player?.enqueue(mediaItems) - } - } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) - ) - } + SecondaryTextButton( + text = "Enqueue", + isEnabled = playlist.songs?.isNotEmpty() == true, + onClick = { + playlist.songs?.map(YouTube.Item.Song::asMediaItem)?.let { mediaItems -> + binder?.player?.enqueue(mediaItems) + } + } + ) Spacer( modifier = Modifier diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/LocalSongSearch.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/LocalSongSearch.kt index 7fc4180..a52fdeb 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/LocalSongSearch.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/LocalSongSearch.kt @@ -5,14 +5,10 @@ import androidx.compose.animation.core.tween import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.ExperimentalFoundationApi -import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicText import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.KeyboardOptions @@ -20,12 +16,10 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.dp import it.vfsfitvnm.vimusic.Database import it.vfsfitvnm.vimusic.LocalPlayerAwarePaddingValues import it.vfsfitvnm.vimusic.LocalPlayerServiceBinder @@ -33,6 +27,7 @@ import it.vfsfitvnm.vimusic.models.DetailedSong import it.vfsfitvnm.vimusic.savers.DetailedSongListSaver import it.vfsfitvnm.vimusic.ui.components.themed.Header import it.vfsfitvnm.vimusic.ui.components.themed.InHistoryMediaItemMenu +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.styling.Dimensions import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance import it.vfsfitvnm.vimusic.ui.styling.px @@ -114,15 +109,9 @@ fun LocalSongSearch( }, actionsContent = { if (textFieldValue.text.isNotEmpty()) { - BasicText( - text = "Clear", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable { onTextFieldValueChanged(TextFieldValue()) } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) + SecondaryTextButton( + text = "Clear", + onClick = { onTextFieldValueChanged(TextFieldValue()) } ) } } diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/OnlineSearch.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/OnlineSearch.kt index 0e51d18..df587a4 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/OnlineSearch.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/search/OnlineSearch.kt @@ -3,7 +3,6 @@ package it.vfsfitvnm.vimusic.ui.screens.search import androidx.compose.animation.core.tween import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut -import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box @@ -15,7 +14,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicText import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.KeyboardActions @@ -27,7 +25,6 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.paint import androidx.compose.ui.draw.rotate import androidx.compose.ui.focus.FocusRequester @@ -49,6 +46,7 @@ import it.vfsfitvnm.vimusic.query import it.vfsfitvnm.vimusic.savers.SearchQueryListSaver import it.vfsfitvnm.vimusic.savers.StringListResultSaver import it.vfsfitvnm.vimusic.ui.components.themed.Header +import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance import it.vfsfitvnm.vimusic.utils.align import it.vfsfitvnm.vimusic.utils.center @@ -164,15 +162,9 @@ fun OnlineSearch( if (playlistId != null) { val isAlbum = playlistId.startsWith("OLAK5uy_") - BasicText( - text = "View ${if (isAlbum) "album" else "playlist"}", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable { onViewPlaylist(textFieldValue.text) } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) + SecondaryTextButton( + text = "View ${if (isAlbum) "album" else "playlist"}", + onClick = { onViewPlaylist(textFieldValue.text) } ) } @@ -182,15 +174,9 @@ fun OnlineSearch( ) if (textFieldValue.text.isNotEmpty()) { - BasicText( - text = "Clear", - style = typography.xxs.medium, - modifier = Modifier - .clip(RoundedCornerShape(16.dp)) - .clickable { onTextFieldValueChanged(TextFieldValue()) } - .background(colorPalette.background2) - .padding(all = 8.dp) - .padding(horizontal = 8.dp) + SecondaryTextButton( + text = "Clear", + onClick = { onTextFieldValueChanged(TextFieldValue()) } ) } }