Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and improve song bottom sheet #1198

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/src/main/java/com/zionhuang/music/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ import com.zionhuang.music.constants.*
import com.zionhuang.music.db.MusicDatabase
import com.zionhuang.music.db.entities.SearchHistory
import com.zionhuang.music.extensions.*
import com.zionhuang.music.models.toMediaMetadata
import com.zionhuang.music.playback.DownloadUtil
import com.zionhuang.music.playback.MusicService
import com.zionhuang.music.playback.MusicService.MusicBinder
import com.zionhuang.music.playback.PlayerConnection
import com.zionhuang.music.ui.component.*
import com.zionhuang.music.ui.component.shimmer.ShimmerTheme
import com.zionhuang.music.ui.menu.YouTubeSongMenu
import com.zionhuang.music.ui.menu.LibrarySongMenu
import com.zionhuang.music.ui.player.BottomSheetPlayer
import com.zionhuang.music.ui.screens.*
import com.zionhuang.music.ui.screens.artist.ArtistItemsScreen
Expand Down Expand Up @@ -775,8 +776,8 @@ class MainActivity : ComponentActivity() {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
YouTubeSongMenu(
song = song,
LibrarySongMenu(
mediaMetadata = song.toMediaMetadata(),
navController = navController,
onDismiss = { sharedSong = null }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.zionhuang.music.ui.component
import androidx.activity.compose.BackHandler
import androidx.compose.animation.*
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.*
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -80,6 +81,8 @@ fun BottomSheetMenu(
.padding(top = 48.dp)
.clip(ShapeDefaults.Large.top())
.background(background)
// We need this elseway tapping elements other then the button grid closes the sheet
.clickable(enabled = false) { }
) {
state.content(this)
}
Expand Down
Loading