-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NP gradient, LPM info, begin #122
Fix incorrect NP gradient placement on overscroll Fix LPM info button not appearing in some cases Begin fixing #122 (WIP)
- Loading branch information
1 parent
2b236ee
commit 6decdef
Showing
31 changed files
with
416 additions
and
414 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
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
44 changes: 44 additions & 0 deletions
44
...n/com/toasterofbread/spmp/ui/component/longpressmenu/artist/ArtistLongPressMenuActions.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,44 @@ | ||
package com.toasterofbread.spmp.ui.component.longpressmenu.artist | ||
|
||
import LocalPlayerState | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Person | ||
import androidx.compose.material.icons.filled.PlayArrow | ||
import androidx.compose.runtime.Composable | ||
import com.toasterofbread.spmp.model.mediaitem.MediaItem | ||
import com.toasterofbread.spmp.model.mediaitem.artist.Artist | ||
import com.toasterofbread.spmp.resources.getString | ||
import com.toasterofbread.spmp.ui.component.longpressmenu.LongPressMenuActionProvider | ||
|
||
@Composable | ||
fun LongPressMenuActionProvider.ArtistLongPressMenuActions(artist: MediaItem) { | ||
require(artist is Artist) | ||
val player = LocalPlayerState.current | ||
|
||
ActionButton( | ||
Icons.Default.PlayArrow, | ||
getString("lpm_action_play"), | ||
onClick = { | ||
player.playMediaItem(artist) | ||
}, | ||
onLongClick = { | ||
player.playMediaItem(artist, shuffle = true) | ||
} | ||
) | ||
|
||
ActiveQueueIndexAction( | ||
{ distance -> | ||
getString(if (distance == 1) "lpm_action_play_after_1_song" else "lpm_action_play_after_x_songs").replace("\$x", distance.toString()) | ||
}, | ||
onClick = { active_queue_index -> | ||
player.playMediaItem(artist, at_index = active_queue_index + 1) | ||
}, | ||
onLongClick = { active_queue_index -> | ||
player.playMediaItem(artist, at_index = active_queue_index + 1, shuffle = true) | ||
} | ||
) | ||
|
||
ActionButton(Icons.Default.Person, getString("lpm_action_open_artist"), onClick = { | ||
player.openMediaItem(artist,) | ||
}) | ||
} |
45 changes: 45 additions & 0 deletions
45
...tlin/com/toasterofbread/spmp/ui/component/longpressmenu/artist/ArtistLongPressMenuInfo.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,45 @@ | ||
package com.toasterofbread.spmp.ui.component.longpressmenu.artist | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.ColumnScope | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.PlayArrow | ||
import androidx.compose.material.icons.filled.SubdirectoryArrowRight | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.toasterofbread.spmp.model.mediaitem.artist.Artist | ||
import com.toasterofbread.spmp.resources.getString | ||
import com.toasterofbread.utils.composable.WidthShrinkText | ||
|
||
@Composable | ||
fun ColumnScope.ArtistLongPressMenuInfo(artist: Artist, getAccentColour: () -> Color) { | ||
@Composable | ||
fun Item(icon: ImageVector, text: String, modifier: Modifier = Modifier) { | ||
Row( | ||
modifier, | ||
horizontalArrangement = Arrangement.spacedBy(20.dp), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Icon(icon, null, tint = getAccentColour()) | ||
WidthShrinkText(text, fontSize = 15.sp) | ||
} | ||
} | ||
|
||
Item(Icons.Default.PlayArrow, getString("lpm_action_radio")) | ||
Item(Icons.Default.SubdirectoryArrowRight, getString("lpm_action_radio_after_x_songs")) | ||
|
||
Spacer( | ||
Modifier | ||
.fillMaxHeight() | ||
.weight(1f) | ||
) | ||
} |
Oops, something went wrong.