简体   繁体   中英

How to create a music player card in jetpack compose

I want to create a card at the bottom of the screen displaying the current track playing like this example,,,,

在此处输入图像描述

I want to display the Track Currently Playing...and on click expand to cover the screen.

I am currently displaying the tracks to the screen like this,,,

 @Composable
 fun MainScreenScaffold(viewModel: TrackListViewModel){
   val context = LocalContext.current

    Scaffold(topBar = { LushTopBar(context = context) }
    ){
    MainScreenMusicList(viewModel.musicList)
   }
   }

            @Composable
            fun MainScreenMusicList(musicList: List<Track>){
            LazyColumn(modifier = Modifier.fillMaxHeight(0.90f)){
            item {
                musicList.forEach {
                track ->
                        TrackCard(
                            title = track.track_title,
                            Artist = track.track_artist,
                            album = track.track_album,
                            length = track.track_length,
                            isSelected = false,
                        )
                    } }
                    } }

I have no idea of how to make it in pure compose...any help is really appreciated

You can use a bottom sheet to achieve this.

Component documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM