-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GroovinExpandableBox] Update Music Sample
- Add BottomBar : Hiding when MusicPlayer is animated on fullscren mode
- Loading branch information
1 parent
958c9c5
commit 132f868
Showing
8 changed files
with
165 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
sampleapp/src/main/java/io/groovin/expandablebox/sampleapp/music/MusicBottomBar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package io.groovin.expandablebox.sampleapp.music | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.RowScope | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.AccountCircle | ||
import androidx.compose.material.icons.filled.Favorite | ||
import androidx.compose.material.icons.filled.PlayArrow | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.unit.dp | ||
|
||
|
||
@Composable | ||
fun MusicBottomBar( | ||
modifier: Modifier = Modifier, | ||
onMenuClick: ((Int) -> Unit)? = null | ||
) { | ||
Row( | ||
modifier = modifier | ||
) { | ||
MusicBottomBarItem(imageVector = Icons.Default.PlayArrow) { | ||
onMenuClick?.invoke(0) | ||
} | ||
MusicBottomBarItem(imageVector = Icons.Default.Favorite) { | ||
onMenuClick?.invoke(1) | ||
} | ||
MusicBottomBarItem(imageVector = Icons.Default.AccountCircle) { | ||
onMenuClick?.invoke(2) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
private fun RowScope.MusicBottomBarItem( | ||
imageVector: ImageVector, | ||
onClick: () -> Unit | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.weight(1f) | ||
.fillMaxHeight() | ||
.clickable { | ||
onClick() | ||
}, | ||
verticalArrangement = Arrangement.Center | ||
) { | ||
Image( | ||
modifier = Modifier | ||
.size(24.dp) | ||
.align(Alignment.CenterHorizontally), | ||
imageVector = imageVector, | ||
contentDescription = null | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.