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

BP Revamp (Cleanup and Part-2) #395

Merged
merged 6 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.listenbrainz.android.model
data class Playable(
val type: PlayableType,
val id: Long,
val songs: List<Song> = emptyList(),
var songs: List<Song> = emptyList(),
var currentSongIndex : Int,
var seekTo: Long = 0L
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import coil.compose.AsyncImage
import org.listenbrainz.android.R

@Composable
fun BrainzPlayerActivityCards(icon: String, errorIcon : Int, title: String, artist : String,modifier : Modifier = Modifier) {
fun BrainzPlayerActivityCards(icon: String, errorIcon : Int, title: String, subtitle : String,modifier : Modifier = Modifier) {
Box(
modifier = modifier
.padding(4.dp)
Expand Down Expand Up @@ -74,7 +74,7 @@ fun BrainzPlayerActivityCards(icon: String, errorIcon : Int, title: String, arti
.padding(start = 15.dp)
) {
Text(
text = artist,
text = subtitle,
fontSize = 17.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Left,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.listenbrainz.android.ui.components

import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable


@Composable
fun BrainzPlayerDropDownMenu(
expanded : Boolean ,
onDismiss : () -> Unit = {},
onAddToNewPlaylist : () -> Unit = {},
onAddToExistingPlaylist : () -> Unit = {},
onPlayNext : () -> Unit = {},
onAddToQueue : () -> Unit = {},
){
DropdownMenu(expanded = expanded, onDismissRequest = onDismiss) {
DropdownMenuItem(onClick = {
onAddToNewPlaylist()
onDismiss()
}, text = {Text(text = "Add to new playlist")})
DropdownMenuItem(onClick = {
onAddToExistingPlaylist()
onDismiss()
}, text = {Text(text = "Add to existing playlist")})
DropdownMenuItem(onClick = {
onPlayNext()
onDismiss()
}, text = {Text(text = "Play next")})
DropdownMenuItem(onClick = {
onAddToQueue()
onDismiss()
}, text = {Text(text = "Add to queue")})
}

}
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
package org.listenbrainz.android.ui.components

import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.annotation.DrawableRes
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Divider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.FilterQuality
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil.request.ImageRequest
Expand Down Expand Up @@ -82,9 +72,8 @@ fun BrainzPlayerListenCard(
Box(modifier = Modifier
.fillMaxWidth(0.275f)
.align(Alignment.CenterEnd)){
DropdownButton (modifier = Modifier.align(Alignment.Center)) {

}
DropdownButton (modifier = Modifier.align(Alignment.Center), onDropdownIconClick = onDropdownIconClick)
if(dropDownState) dropDown()
PlayButton (modifier = Modifier.align(Alignment.CenterEnd)) {
onPlayIconClick()
}
Expand Down