mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-11-04 10:13:59 +00:00
feat(player-options): enhance options menu with localized strings and icons
This commit is contained in:
parent
1e6aee142b
commit
df3dd2ad88
@ -187,5 +187,9 @@
|
||||
<string name="settings_jam_broker_test_ok">Connected in %1$d ms</string>
|
||||
<string name="settings_jam_broker_test_fail">Failed: %1$s</string>
|
||||
<string name="settings_jam_broker_placeholder_note">Placeholder broker — configure your own to self-host</string>
|
||||
|
||||
<string name="player_go_to_album">Go to album</string>
|
||||
<string name="player_sleep_timer">Sleep timer</string>
|
||||
<string name="player_track_details">Track details</string>
|
||||
</resources>
|
||||
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Kingkor Roy Tirtho and Spotube Contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package dev.krtirtho.spotube
|
||||
|
||||
class Greeting {
|
||||
private val platform = getPlatform()
|
||||
|
||||
fun greet(): String {
|
||||
return "Hello, ${platform.name}!"
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,9 @@ import dev.krtirtho.spotube.modules.saved_tracks.SAVED_TRACKS_COLLECTION_ID
|
||||
import dev.krtirtho.spotube.modules.saved_tracks.SavedTracksViewModel
|
||||
import dev.krtirtho.spotube.resources.iconsax.Iconsax
|
||||
import dev.krtirtho.spotube.resources.iconsax.Iconsax3DotsMore
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxCd
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxDirectboxReceive
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxInformation
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxMusic
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxMusicFilter
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxNext
|
||||
@ -96,12 +98,18 @@ import dev.krtirtho.spotube.resources.iconsax.IconsaxShuffle
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxVolumeCross
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxVolumeHigh
|
||||
import dev.krtirtho.spotube.resources.iconsax.IconsaxVolumeLow
|
||||
import dev.krtirtho.spotube.resources.iconsax.InconsaxClock
|
||||
import dev.krtirtho.spotube.resources.iconsax.SwapHorizontal2
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.launch
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
import org.koin.compose.koinInject
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
import org.koin.core.parameter.parametersOf
|
||||
import spotube.composeapp.generated.resources.Res
|
||||
import spotube.composeapp.generated.resources.player_go_to_album
|
||||
import spotube.composeapp.generated.resources.player_sleep_timer
|
||||
import spotube.composeapp.generated.resources.player_track_details
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
|
||||
@ -405,7 +413,13 @@ fun AppLargePlayer(
|
||||
onDismissRequest = playerOptionsViewModel::dismissMoreOptionsMenu,
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = { Text("Go to album") },
|
||||
text = { Text(stringResource(Res.string.player_go_to_album)) },
|
||||
leadingIcon = {
|
||||
Icon(
|
||||
imageVector = Iconsax.IconsaxCd,
|
||||
contentDescription = null,
|
||||
)
|
||||
},
|
||||
enabled = currentTrack?.album?.id != null,
|
||||
onClick = {
|
||||
playerOptionsViewModel.dismissMoreOptionsMenu()
|
||||
@ -415,14 +429,26 @@ fun AppLargePlayer(
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Sleep timer") },
|
||||
text = { Text(stringResource(Res.string.player_sleep_timer)) },
|
||||
leadingIcon = {
|
||||
Icon(
|
||||
imageVector = Iconsax.InconsaxClock,
|
||||
contentDescription = null,
|
||||
)
|
||||
},
|
||||
onClick = {
|
||||
playerOptionsViewModel.dismissMoreOptionsMenu()
|
||||
playerOptionsViewModel.showSleepTimerDialog()
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Track details") },
|
||||
text = { Text(stringResource(Res.string.player_track_details)) },
|
||||
leadingIcon = {
|
||||
Icon(
|
||||
imageVector = Iconsax.IconsaxInformation,
|
||||
contentDescription = null,
|
||||
)
|
||||
},
|
||||
enabled = currentTrack != null,
|
||||
onClick = {
|
||||
playerOptionsViewModel.dismissMoreOptionsMenu()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user