Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b2396d20a | ||
|
|
15b7c7effc | ||
|
|
23f577ee89 | ||
|
|
f4a855e98e | ||
|
|
27e11db27f | ||
|
|
5a4752d32d | ||
|
|
42e77433bf | ||
|
|
33423fbbc0 | ||
|
|
36c56ecf35 | ||
|
|
511635a5c8 | ||
|
|
fe77813e53 | ||
|
|
13acbc6d6a | ||
|
|
46a3f94057 | ||
|
|
cca6d5e19c |
@@ -9,6 +9,12 @@
|
|||||||
Listen to Lithuania's favorite stations in one tap.
|
Listen to Lithuania's favorite stations in one tap.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> **Fogwave is coming to Google Play!** The app is now in closed testing there ahead of the public release. Ideas, wishes and suggestions for improvement are very welcome — send them wherever is easiest for you: an issue on [Gitea](https://git.skysparkle.cc/kalarina/Fogwave/issues) or [GitHub](https://github.com/kalarina-bit/Fogwave/issues), or an email to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> **Looking for designers!** Fogwave is looking for volunteer designers to help with icons, logos, animations, cover art (store graphics) and UI design. This is unpaid help for an open-source project. If you're interested, write to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/kalarina-bit/Fogwave/releases/latest"><img src="https://img.shields.io/github/v/release/kalarina-bit/Fogwave?style=for-the-badge&label=release&labelColor=1b1b1b&color=2e7d32" alt="Latest release"></a>
|
<a href="https://github.com/kalarina-bit/Fogwave/releases/latest"><img src="https://img.shields.io/github/v/release/kalarina-bit/Fogwave?style=for-the-badge&label=release&labelColor=1b1b1b&color=2e7d32" alt="Latest release"></a>
|
||||||
</p>
|
</p>
|
||||||
@@ -31,13 +37,14 @@
|
|||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
- 📻 **10 Lithuanian stations** — ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1, Gold FM and more
|
- 📻 **14 stations from Lithuania and Latvia** — ZIP FM, Power Hit Radio, Rock FM, LRT Radijas, Žinių radijas, Latvijas Radio 1 & 2 and more
|
||||||
- 🎧 **Background playback** with lock-screen, notification, headphone and Bluetooth controls
|
- 🎧 **Background playback** with lock-screen, notification, headphone and Bluetooth controls
|
||||||
- 🚗 **Android Auto** support
|
- 🚗 **Android Auto** support
|
||||||
- 🔄 **Auto-reconnect** when the stream drops or the network comes back
|
- 🔄 **Auto-reconnect** when the stream drops or the network comes back
|
||||||
- 🎚️ **Equalizer** with presets, loudness boost and dynamics processing
|
- 🎚️ **Equalizer** with presets, loudness boost and dynamics processing
|
||||||
- ❤️ **Favorites, recently played and similar stations** matched by genre
|
- ❤️ **Favorites, recently played and similar stations** matched by genre
|
||||||
- 🗂️ **Four layouts** — list, table, tiles or icons, with adjustable size
|
- 🔍 **Search** to find a station in a tap
|
||||||
|
- 🎵 **Song titles** for stations that broadcast them
|
||||||
- 🌙 **Dark theme**
|
- 🌙 **Dark theme**
|
||||||
- 🌍 **Six languages** — English, Russian, German, Japanese, Lithuanian and Chinese
|
- 🌍 **Six languages** — English, Russian, German, Japanese, Lithuanian and Chinese
|
||||||
- 🔓 **No ads, no tracking, no accounts**
|
- 🔓 **No ads, no tracking, no accounts**
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ android {
|
|||||||
applicationId = "cc.skysparkle.fogwave"
|
applicationId = "cc.skysparkle.fogwave"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 13
|
versionCode = 17
|
||||||
versionName = "1.0.13"
|
versionName = "1.0.17"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -85,6 +85,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation(libs.coil.compose)
|
implementation(libs.coil.compose)
|
||||||
implementation(libs.androidx.media3.exoplayer)
|
implementation(libs.androidx.media3.exoplayer)
|
||||||
|
implementation(libs.androidx.media3.exoplayer.hls)
|
||||||
implementation(libs.androidx.media3.common)
|
implementation(libs.androidx.media3.common)
|
||||||
implementation(libs.androidx.media3.session)
|
implementation(libs.androidx.media3.session)
|
||||||
implementation(libs.kotlinx.coroutines.android)
|
implementation(libs.kotlinx.coroutines.android)
|
||||||
|
|||||||
@@ -24,21 +24,9 @@ enum class Genre(@param:StringRes val labelRes: Int) {
|
|||||||
OLDIES(R.string.genre_oldies),
|
OLDIES(R.string.genre_oldies),
|
||||||
ROCK(R.string.genre_rock),
|
ROCK(R.string.genre_rock),
|
||||||
EASY_LISTENING(R.string.genre_easy_listening),
|
EASY_LISTENING(R.string.genre_easy_listening),
|
||||||
LITHUANIAN(R.string.genre_lithuanian)
|
LITHUANIAN(R.string.genre_lithuanian),
|
||||||
}
|
NEWS_TALK(R.string.genre_news_talk),
|
||||||
|
LATVIAN(R.string.genre_latvian)
|
||||||
enum class ViewMode {
|
|
||||||
ICONS,
|
|
||||||
TILES,
|
|
||||||
LIST,
|
|
||||||
DETAILS
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class IconSizeStep(val sizeDp: Int) {
|
|
||||||
S(64),
|
|
||||||
M(96),
|
|
||||||
L(132),
|
|
||||||
XL(176)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class AppTab(@param:StringRes val titleRes: Int) {
|
enum class AppTab(@param:StringRes val titleRes: Int) {
|
||||||
@@ -52,3 +40,4 @@ enum class ExtraPlayerTab(@param:StringRes val titleRes: Int) {
|
|||||||
SIMILAR(R.string.extra_tab_similar),
|
SIMILAR(R.string.extra_tab_similar),
|
||||||
INFO(R.string.extra_tab_info)
|
INFO(R.string.extra_tab_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import android.content.Context
|
|||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import cc.skysparkle.fogwave.R
|
import cc.skysparkle.fogwave.R
|
||||||
import cc.skysparkle.fogwave.data.model.Genre
|
import cc.skysparkle.fogwave.data.model.Genre
|
||||||
import cc.skysparkle.fogwave.data.model.IconSizeStep
|
|
||||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
import cc.skysparkle.fogwave.data.model.ViewMode
|
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
@@ -110,6 +108,43 @@ class RadioRepository(context: Context) {
|
|||||||
genres = listOf(Genre.HITS, Genre.LITHUANIAN),
|
genres = listOf(Genre.HITS, Genre.LITHUANIAN),
|
||||||
bitrate = "MP3 128 kbps",
|
bitrate = "MP3 128 kbps",
|
||||||
lightBackdrop = true
|
lightBackdrop = true
|
||||||
|
),
|
||||||
|
RadioStation(
|
||||||
|
id = "lrt",
|
||||||
|
name = "LRT Radijas",
|
||||||
|
descriptionRes = R.string.station_desc_lrt,
|
||||||
|
streamUrl = "https://lrt-cast.lrt.lt/lrt_radijas",
|
||||||
|
iconResId = R.drawable.ic_station_lrt,
|
||||||
|
genres = listOf(Genre.NEWS_TALK, Genre.LITHUANIAN),
|
||||||
|
bitrate = "MP3",
|
||||||
|
lightBackdrop = true
|
||||||
|
),
|
||||||
|
RadioStation(
|
||||||
|
id = "ziniu",
|
||||||
|
name = "Žinių radijas",
|
||||||
|
descriptionRes = R.string.station_desc_ziniu,
|
||||||
|
streamUrl = "https://netradio.ziniur.lt/ziniur.mp3?n=975355",
|
||||||
|
iconResId = R.drawable.ic_station_ziniu,
|
||||||
|
genres = listOf(Genre.NEWS_TALK),
|
||||||
|
bitrate = "MP3"
|
||||||
|
),
|
||||||
|
RadioStation(
|
||||||
|
id = "lr1",
|
||||||
|
name = "Latvijas Radio 1",
|
||||||
|
descriptionRes = R.string.station_desc_lr1,
|
||||||
|
streamUrl = "https://muste.latvijasradio.lv/shoutcast/mp4:lr1a.stream/playlist.m3u8",
|
||||||
|
iconResId = R.drawable.ic_station_lr1,
|
||||||
|
genres = listOf(Genre.NEWS_TALK),
|
||||||
|
bitrate = "HLS"
|
||||||
|
),
|
||||||
|
RadioStation(
|
||||||
|
id = "lr2",
|
||||||
|
name = "Latvijas Radio 2",
|
||||||
|
descriptionRes = R.string.station_desc_lr2,
|
||||||
|
streamUrl = "https://muste.latvijasradio.lv/shoutcast/mp4:lr2a.stream/playlist.m3u8",
|
||||||
|
iconResId = R.drawable.ic_station_lr2,
|
||||||
|
genres = listOf(Genre.LATVIAN, Genre.POP),
|
||||||
|
bitrate = "HLS"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -121,12 +156,6 @@ class RadioRepository(context: Context) {
|
|||||||
private val _recentsFlow = MutableStateFlow<List<String>>(loadRecents())
|
private val _recentsFlow = MutableStateFlow<List<String>>(loadRecents())
|
||||||
val recentsFlow: StateFlow<List<String>> = _recentsFlow.asStateFlow()
|
val recentsFlow: StateFlow<List<String>> = _recentsFlow.asStateFlow()
|
||||||
|
|
||||||
private val _viewModeFlow = MutableStateFlow(loadViewMode())
|
|
||||||
val viewModeFlow: StateFlow<ViewMode> = _viewModeFlow.asStateFlow()
|
|
||||||
|
|
||||||
private val _sizeStepFlow = MutableStateFlow(loadSizeStep())
|
|
||||||
val sizeStepFlow: StateFlow<IconSizeStep> = _sizeStepFlow.asStateFlow()
|
|
||||||
|
|
||||||
private val _seenFavoritesFlow = MutableStateFlow(loadSeenFavorites())
|
private val _seenFavoritesFlow = MutableStateFlow(loadSeenFavorites())
|
||||||
val seenFavoritesFlow: StateFlow<Set<String>> = _seenFavoritesFlow.asStateFlow()
|
val seenFavoritesFlow: StateFlow<Set<String>> = _seenFavoritesFlow.asStateFlow()
|
||||||
|
|
||||||
@@ -225,34 +254,6 @@ class RadioRepository(context: Context) {
|
|||||||
prefs.edit { putString("recents", arr.toString()) }
|
prefs.edit { putString("recents", arr.toString()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadViewMode(): ViewMode {
|
|
||||||
val mode = prefs.getString("view_mode", ViewMode.ICONS.name) ?: ViewMode.ICONS.name
|
|
||||||
return try {
|
|
||||||
ViewMode.valueOf(mode)
|
|
||||||
} catch (_: Exception) {
|
|
||||||
ViewMode.ICONS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setViewMode(mode: ViewMode) {
|
|
||||||
_viewModeFlow.value = mode
|
|
||||||
prefs.edit { putString("view_mode", mode.name) }
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun loadSizeStep(): IconSizeStep {
|
|
||||||
val step = prefs.getString("size_step", IconSizeStep.M.name) ?: IconSizeStep.M.name
|
|
||||||
return try {
|
|
||||||
IconSizeStep.valueOf(step)
|
|
||||||
} catch (_: Exception) {
|
|
||||||
IconSizeStep.M
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSizeStep(step: IconSizeStep) {
|
|
||||||
_sizeStepFlow.value = step
|
|
||||||
prefs.edit { putString("size_step", step.name) }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun hasSeenBatteryOptimizationPrompt(): Boolean {
|
fun hasSeenBatteryOptimizationPrompt(): Boolean {
|
||||||
return prefs.getBoolean("seen_battery_optimization_prompt", false)
|
return prefs.getBoolean("seen_battery_optimization_prompt", false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ class RadioPlayerManager(private val context: Context) {
|
|||||||
private val _currentMediaId = MutableStateFlow<String?>(null)
|
private val _currentMediaId = MutableStateFlow<String?>(null)
|
||||||
val currentMediaId: StateFlow<String?> = _currentMediaId.asStateFlow()
|
val currentMediaId: StateFlow<String?> = _currentMediaId.asStateFlow()
|
||||||
|
|
||||||
|
/** Song announced by the stream (ICY / ID3 metadata), or null when the station sends none. */
|
||||||
|
private val _nowPlayingTitle = MutableStateFlow<String?>(null)
|
||||||
|
val nowPlayingTitle: StateFlow<String?> = _nowPlayingTitle.asStateFlow()
|
||||||
|
|
||||||
private var currentStation: RadioStation? = null
|
private var currentStation: RadioStation? = null
|
||||||
private var pendingStation: RadioStation? = null
|
private var pendingStation: RadioStation? = null
|
||||||
|
|
||||||
@@ -41,6 +45,7 @@ class RadioPlayerManager(private val context: Context) {
|
|||||||
override fun onEvents(player: Player, events: Player.Events) {
|
override fun onEvents(player: Player, events: Player.Events) {
|
||||||
_playerState.value = deriveState(player)
|
_playerState.value = deriveState(player)
|
||||||
_currentMediaId.value = player.currentMediaItem?.mediaId
|
_currentMediaId.value = player.currentMediaItem?.mediaId
|
||||||
|
_nowPlayingTitle.value = streamTitle(player)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlayerError(error: PlaybackException) {
|
override fun onPlayerError(error: PlaybackException) {
|
||||||
@@ -85,6 +90,7 @@ class RadioPlayerManager(private val context: Context) {
|
|||||||
} else {
|
} else {
|
||||||
_playerState.value = deriveState(c)
|
_playerState.value = deriveState(c)
|
||||||
_currentMediaId.value = c.currentMediaItem?.mediaId
|
_currentMediaId.value = c.currentMediaItem?.mediaId
|
||||||
|
_nowPlayingTitle.value = streamTitle(c)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Failed to connect to FogwavePlaybackService", e)
|
Log.e(TAG, "Failed to connect to FogwavePlaybackService", e)
|
||||||
@@ -125,6 +131,14 @@ class RadioPlayerManager(private val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stream metadata replaces the item's own title; the station name itself is not a song.
|
||||||
|
private fun streamTitle(p: Player): String? {
|
||||||
|
val title = p.mediaMetadata.title?.toString()?.trim()
|
||||||
|
if (title.isNullOrEmpty()) return null
|
||||||
|
if (title == p.currentMediaItem?.mediaMetadata?.title?.toString()?.trim()) return null
|
||||||
|
return title
|
||||||
|
}
|
||||||
|
|
||||||
private fun errorMessage(error: PlaybackException): String = context.getString(
|
private fun errorMessage(error: PlaybackException): String = context.getString(
|
||||||
when (error.errorCode) {
|
when (error.errorCode) {
|
||||||
PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED,
|
PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED,
|
||||||
@@ -144,6 +158,7 @@ class RadioPlayerManager(private val context: Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_playerState.value = PlayerState.Connecting
|
_playerState.value = PlayerState.Connecting
|
||||||
|
_nowPlayingTitle.value = null
|
||||||
try {
|
try {
|
||||||
c.setMediaItem(station.toMediaItem(context))
|
c.setMediaItem(station.toMediaItem(context))
|
||||||
c.prepare()
|
c.prepare()
|
||||||
|
|||||||
@@ -5,12 +5,15 @@ import android.content.Context
|
|||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.media3.common.MediaItem
|
import androidx.media3.common.MediaItem
|
||||||
import androidx.media3.common.MediaMetadata
|
import androidx.media3.common.MediaMetadata
|
||||||
|
import androidx.media3.common.MimeTypes
|
||||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
|
|
||||||
fun RadioStation.toMediaItem(context: Context): MediaItem {
|
fun RadioStation.toMediaItem(context: Context): MediaItem {
|
||||||
val artworkUri = "${ContentResolver.SCHEME_ANDROID_RESOURCE}://${context.packageName}/$iconResId".toUri()
|
val artworkUri = "${ContentResolver.SCHEME_ANDROID_RESOURCE}://${context.packageName}/$iconResId".toUri()
|
||||||
return MediaItem.Builder()
|
return MediaItem.Builder()
|
||||||
.setUri(streamUrl)
|
.setUri(streamUrl)
|
||||||
|
// HLS playlists are picked up by the HLS module; everything else stays a progressive stream.
|
||||||
|
.apply { if (streamUrl.substringBefore('?').endsWith(".m3u8")) setMimeType(MimeTypes.APPLICATION_M3U8) }
|
||||||
.setMediaId(id)
|
.setMediaId(id)
|
||||||
.setMediaMetadata(
|
.setMediaMetadata(
|
||||||
MediaMetadata.Builder()
|
MediaMetadata.Builder()
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ fun EqualizerSheet(
|
|||||||
text = if (audioEffects.equalizerEnabled) stringResource(R.string.equalizer_on) else stringResource(R.string.equalizer_off),
|
text = if (audioEffects.equalizerEnabled) stringResource(R.string.equalizer_on) else stringResource(R.string.equalizer_off),
|
||||||
style = MaterialTheme.typography.labelMedium.copy(
|
style = MaterialTheme.typography.labelMedium.copy(
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = if (audioEffects.equalizerEnabled) LocalGeoColors.current.liveGreen else LocalGeoColors.current.onSurfaceVariant
|
color = if (audioEffects.equalizerEnabled) LocalGeoColors.current.primary else LocalGeoColors.current.onSurfaceVariant
|
||||||
),
|
),
|
||||||
modifier = Modifier.padding(end = 6.dp)
|
modifier = Modifier.padding(end = 6.dp)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.grid.GridCells
|
|
||||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
|
||||||
import androidx.compose.foundation.lazy.grid.items
|
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
@@ -33,6 +30,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
|
import androidx.compose.ui.res.pluralStringResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
@@ -40,9 +38,7 @@ import androidx.compose.ui.unit.Dp
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import cc.skysparkle.fogwave.R
|
import cc.skysparkle.fogwave.R
|
||||||
import cc.skysparkle.fogwave.data.model.IconSizeStep
|
|
||||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
import cc.skysparkle.fogwave.data.model.ViewMode
|
|
||||||
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -50,8 +46,6 @@ fun FavoritesPanel(
|
|||||||
favorites: List<RadioStation>,
|
favorites: List<RadioStation>,
|
||||||
currentStation: RadioStation?,
|
currentStation: RadioStation?,
|
||||||
isPlaying: Boolean,
|
isPlaying: Boolean,
|
||||||
viewMode: ViewMode,
|
|
||||||
sizeStep: IconSizeStep,
|
|
||||||
onSelectStation: (RadioStation) -> Unit,
|
onSelectStation: (RadioStation) -> Unit,
|
||||||
onBrowseStations: () -> Unit,
|
onBrowseStations: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
@@ -66,68 +60,27 @@ fun FavoritesPanel(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
StationCollection(
|
LazyColumn(
|
||||||
stations = favorites,
|
contentPadding = PaddingValues(start = 10.dp, end = 10.dp, top = 8.dp, bottom = bottomContentPadding),
|
||||||
currentStation = currentStation,
|
verticalArrangement = Arrangement.spacedBy(2.dp),
|
||||||
isPlaying = isPlaying,
|
|
||||||
viewMode = viewMode,
|
|
||||||
sizeStep = sizeStep,
|
|
||||||
onSelectStation = onSelectStation,
|
|
||||||
bottomContentPadding = bottomContentPadding,
|
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
)
|
) {
|
||||||
}
|
item(key = "header") {
|
||||||
|
SectionHeader(
|
||||||
/** The station grid (Icons mode) or list (other modes), shared by the Radio and Favorites tabs. */
|
title = stringResource(R.string.tab_favorites),
|
||||||
@Composable
|
trailing = pluralStringResource(R.plurals.station_count, favorites.size, favorites.size),
|
||||||
fun StationCollection(
|
modifier = Modifier.padding(start = 10.dp, end = 10.dp, bottom = 8.dp)
|
||||||
stations: List<RadioStation>,
|
)
|
||||||
currentStation: RadioStation?,
|
|
||||||
isPlaying: Boolean,
|
|
||||||
viewMode: ViewMode,
|
|
||||||
sizeStep: IconSizeStep,
|
|
||||||
onSelectStation: (RadioStation) -> Unit,
|
|
||||||
bottomContentPadding: Dp,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
val contentPadding = PaddingValues(start = 20.dp, end = 20.dp, top = 8.dp, bottom = bottomContentPadding)
|
|
||||||
when (viewMode) {
|
|
||||||
ViewMode.ICONS -> LazyVerticalGrid(
|
|
||||||
columns = GridCells.Adaptive((sizeStep.sizeDp + 16).dp),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(14.dp),
|
|
||||||
contentPadding = contentPadding,
|
|
||||||
modifier = modifier
|
|
||||||
) {
|
|
||||||
items(stations, key = { it.id }) { station ->
|
|
||||||
val isCur = station.id == currentStation?.id
|
|
||||||
StationItem(
|
|
||||||
station = station,
|
|
||||||
isCurrent = isCur,
|
|
||||||
isPlaying = isCur && isPlaying,
|
|
||||||
viewMode = viewMode,
|
|
||||||
sizeStep = sizeStep,
|
|
||||||
onClick = { onSelectStation(station) }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
items(favorites, key = { it.id }) { station ->
|
||||||
ViewMode.TILES, ViewMode.LIST, ViewMode.DETAILS -> LazyColumn(
|
val isCur = station.id == currentStation?.id
|
||||||
contentPadding = contentPadding,
|
StationRow(
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
station = station,
|
||||||
modifier = modifier
|
isCurrent = isCur,
|
||||||
) {
|
isPlaying = isCur && isPlaying,
|
||||||
items(stations, key = { it.id }) { station ->
|
onClick = { onSelectStation(station) },
|
||||||
val isCur = station.id == currentStation?.id
|
modifier = Modifier.animateItem()
|
||||||
StationItem(
|
)
|
||||||
station = station,
|
|
||||||
isCurrent = isCur,
|
|
||||||
isPlaying = isCur && isPlaying,
|
|
||||||
viewMode = viewMode,
|
|
||||||
sizeStep = sizeStep,
|
|
||||||
onClick = { onSelectStation(station) }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.animation.core.LinearEasing
|
||||||
|
import androidx.compose.animation.core.RepeatMode
|
||||||
|
import androidx.compose.animation.core.animateFloat
|
||||||
|
import androidx.compose.animation.core.infiniteRepeatable
|
||||||
|
import androidx.compose.animation.core.rememberInfiniteTransition
|
||||||
|
import androidx.compose.animation.core.tween
|
||||||
|
import androidx.compose.foundation.Canvas
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clipToBounds
|
||||||
|
import androidx.compose.ui.draw.drawWithContent
|
||||||
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.graphics.BlendMode
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.CompositingStrategy
|
||||||
|
import androidx.compose.ui.graphics.drawscope.DrawScope
|
||||||
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
|
import androidx.compose.ui.graphics.lerp
|
||||||
|
import kotlin.math.PI
|
||||||
|
import kotlin.math.cos
|
||||||
|
import kotlin.math.max
|
||||||
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
/** One drifting patch of mist: where it rests, how far and how it wanders, and how big it is. */
|
||||||
|
private class Wisp(
|
||||||
|
val x: Float,
|
||||||
|
val y: Float,
|
||||||
|
val dx: Float,
|
||||||
|
val dy: Float,
|
||||||
|
val phase: Float,
|
||||||
|
val radius: Float,
|
||||||
|
val alpha: Float,
|
||||||
|
val mix: Float
|
||||||
|
)
|
||||||
|
|
||||||
|
private val Wisps = listOf(
|
||||||
|
Wisp(x = 0.18f, y = 0.30f, dx = 0.10f, dy = 0.05f, phase = 0.0f, radius = 0.62f, alpha = 0.55f, mix = 0.0f),
|
||||||
|
Wisp(x = 0.82f, y = 0.42f, dx = 0.08f, dy = 0.07f, phase = 1.9f, radius = 0.55f, alpha = 0.45f, mix = 0.35f),
|
||||||
|
Wisp(x = 0.50f, y = 0.70f, dx = 0.14f, dy = 0.04f, phase = 3.7f, radius = 0.70f, alpha = 0.35f, mix = 0.15f),
|
||||||
|
Wisp(x = 0.35f, y = 0.55f, dx = 0.06f, dy = 0.08f, phase = 5.1f, radius = 0.38f, alpha = 0.22f, mix = 0.8f)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Slowly drifting colored fog — Fogwave's signature backdrop. [tint] is usually the playing
|
||||||
|
* station's color. Only the draw phase reads the animation, so the fog never recomposes anything.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun FogLayer(
|
||||||
|
tint: Color,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
intensity: Float = 1f
|
||||||
|
) {
|
||||||
|
val transition = rememberInfiniteTransition(label = "fog")
|
||||||
|
val t by transition.animateFloat(
|
||||||
|
initialValue = 0f,
|
||||||
|
targetValue = (2 * PI).toFloat(),
|
||||||
|
animationSpec = infiniteRepeatable(tween(28_000, easing = LinearEasing), RepeatMode.Restart),
|
||||||
|
label = "fog_t"
|
||||||
|
)
|
||||||
|
val breathe by transition.animateFloat(
|
||||||
|
initialValue = 0.85f,
|
||||||
|
targetValue = 1f,
|
||||||
|
animationSpec = infiniteRepeatable(tween(6_000), RepeatMode.Reverse),
|
||||||
|
label = "fog_breathe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Wisps are larger than the layer; clipping keeps them from leaking past its edges.
|
||||||
|
Canvas(modifier = modifier.clipToBounds()) {
|
||||||
|
Wisps.forEach { wisp -> drawWisp(wisp, t, breathe * intensity, tint) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun DrawScope.drawWisp(wisp: Wisp, time: Float, intensity: Float, tint: Color) {
|
||||||
|
val unit = max(size.width, size.height)
|
||||||
|
val center = Offset(
|
||||||
|
x = size.width * (wisp.x + wisp.dx * sin(time + wisp.phase)),
|
||||||
|
y = size.height * (wisp.y + wisp.dy * cos(time * 2f + wisp.phase))
|
||||||
|
)
|
||||||
|
val radius = unit * wisp.radius
|
||||||
|
// Part of the mist is paler, so the fog is not a flat single-color glow.
|
||||||
|
val color = lerp(tint, Color(0xFFDDE6FF), wisp.mix)
|
||||||
|
val a = (wisp.alpha * intensity).coerceIn(0f, 1f)
|
||||||
|
drawCircle(
|
||||||
|
brush = Brush.radialGradient(
|
||||||
|
0f to color.copy(alpha = a),
|
||||||
|
0.45f to color.copy(alpha = a * 0.35f),
|
||||||
|
1f to Color.Transparent,
|
||||||
|
center = center,
|
||||||
|
radius = radius
|
||||||
|
),
|
||||||
|
radius = radius,
|
||||||
|
center = center
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fades the content to transparent towards the bottom, starting at [from] of its height. */
|
||||||
|
fun Modifier.fadeOutBottom(from: Float = 0.55f): Modifier = this
|
||||||
|
.clipToBounds()
|
||||||
|
.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
|
||||||
|
.drawWithContent {
|
||||||
|
drawContent()
|
||||||
|
drawRect(
|
||||||
|
brush = Brush.verticalGradient(from to Color.Black, 1f to Color.Transparent),
|
||||||
|
blendMode = BlendMode.DstIn
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
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.Brush
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
|
import androidx.compose.ui.graphics.ColorMatrix
|
||||||
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import cc.skysparkle.fogwave.R
|
||||||
|
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||||
|
import coil.compose.AsyncImage
|
||||||
|
import coil.request.ImageRequest
|
||||||
|
import coil.size.Scale
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Misty peak at the top of the home screen with drifting fog in the playing station's color.
|
||||||
|
* [visibility] is read in the draw phase (0 = gone, 1 = fully shown) so scrolling never recomposes it.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun HomeBackdrop(
|
||||||
|
tint: Color,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
visibility: () -> Float = { 1f }
|
||||||
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val background = LocalGeoColors.current.background
|
||||||
|
val request = remember(context) {
|
||||||
|
ImageRequest.Builder(context)
|
||||||
|
.data(R.drawable.bg_misty_mountain)
|
||||||
|
.scale(Scale.FILL)
|
||||||
|
.crossfade(300)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
// Cool, slightly desaturated photo so the colored fog and the UI stay in front.
|
||||||
|
val muted = remember {
|
||||||
|
ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0.35f) })
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(420.dp)
|
||||||
|
.graphicsLayer { alpha = visibility().coerceIn(0f, 1f) }
|
||||||
|
// Everything (photo and fog) melts into the page instead of ending at a hard edge.
|
||||||
|
.fadeOutBottom(from = 0.45f)
|
||||||
|
) {
|
||||||
|
AsyncImage(
|
||||||
|
model = request,
|
||||||
|
contentDescription = null,
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
alignment = Alignment.TopCenter,
|
||||||
|
colorFilter = muted,
|
||||||
|
alpha = 0.5f,
|
||||||
|
modifier = Modifier.fillMaxSize()
|
||||||
|
)
|
||||||
|
FogLayer(tint = tint, intensity = 0.6f, modifier = Modifier.fillMaxSize())
|
||||||
|
// Darker top keeps the header readable over the photo.
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.background(
|
||||||
|
Brush.verticalGradient(
|
||||||
|
0f to background.copy(alpha = 0.45f),
|
||||||
|
0.35f to Color.Transparent
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,7 +46,7 @@ private val LIBRARIES = listOf(
|
|||||||
LicenseRow("AndroidX Activity Compose", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/activity", BuildConfig.ACTIVITY_VERSION),
|
LicenseRow("AndroidX Activity Compose", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/activity", BuildConfig.ACTIVITY_VERSION),
|
||||||
LicenseRow("AndroidX Core KTX", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/core", BuildConfig.CORE_KTX_VERSION),
|
LicenseRow("AndroidX Core KTX", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/core", BuildConfig.CORE_KTX_VERSION),
|
||||||
LicenseRow("AndroidX Lifecycle (ViewModel + Runtime Compose)", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/lifecycle", BuildConfig.LIFECYCLE_VERSION),
|
LicenseRow("AndroidX Lifecycle (ViewModel + Runtime Compose)", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/lifecycle", BuildConfig.LIFECYCLE_VERSION),
|
||||||
LicenseRow("AndroidX Media3 (ExoPlayer, MediaSession)", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/media3", BuildConfig.MEDIA3_VERSION),
|
LicenseRow("AndroidX Media3 (ExoPlayer, HLS, MediaSession)", AOSP, APACHE, "https://developer.android.com/jetpack/androidx/releases/media3", BuildConfig.MEDIA3_VERSION),
|
||||||
LicenseRow("AndroidX \u2014 other libraries pulled in by the ones above", AOSP, APACHE, "https://developer.android.com/jetpack/androidx"),
|
LicenseRow("AndroidX \u2014 other libraries pulled in by the ones above", AOSP, APACHE, "https://developer.android.com/jetpack/androidx"),
|
||||||
LicenseRow("Guava (used by Media3)", "Google", APACHE, "https://github.com/google/guava"),
|
LicenseRow("Guava (used by Media3)", "Google", APACHE, "https://github.com/google/guava"),
|
||||||
LicenseRow("kotlinx.coroutines", "JetBrains", APACHE, "https://github.com/Kotlin/kotlinx.coroutines", BuildConfig.COROUTINES_VERSION),
|
LicenseRow("kotlinx.coroutines", "JetBrains", APACHE, "https://github.com/Kotlin/kotlinx.coroutines", BuildConfig.COROUTINES_VERSION),
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import androidx.compose.animation.core.Spring
|
|||||||
import androidx.compose.animation.core.animate
|
import androidx.compose.animation.core.animate
|
||||||
import androidx.compose.animation.core.spring
|
import androidx.compose.animation.core.spring
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.foundation.Image
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
@@ -40,10 +39,8 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
import androidx.compose.ui.layout.ContentScale
|
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.painterResource
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
@@ -63,8 +60,8 @@ private val TABLET_MINI_PLAYER_MAX_WIDTH_DP = 640.dp
|
|||||||
fun MiniPlayer(
|
fun MiniPlayer(
|
||||||
station: RadioStation?,
|
station: RadioStation?,
|
||||||
playerState: PlayerState,
|
playerState: PlayerState,
|
||||||
|
trackTitle: String?,
|
||||||
onTogglePlay: () -> Unit,
|
onTogglePlay: () -> Unit,
|
||||||
onPrevious: () -> Unit,
|
|
||||||
onNext: () -> Unit,
|
onNext: () -> Unit,
|
||||||
onOpenNowPlaying: () -> Unit,
|
onOpenNowPlaying: () -> Unit,
|
||||||
onHide: () -> Unit,
|
onHide: () -> Unit,
|
||||||
@@ -72,6 +69,7 @@ fun MiniPlayer(
|
|||||||
) {
|
) {
|
||||||
if (station == null) return
|
if (station == null) return
|
||||||
|
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
val isPlaying = playerState is PlayerState.Playing
|
val isPlaying = playerState is PlayerState.Playing
|
||||||
val isConnecting = playerState is PlayerState.Connecting
|
val isConnecting = playerState is PlayerState.Connecting
|
||||||
val isError = playerState is PlayerState.Error
|
val isError = playerState is PlayerState.Error
|
||||||
@@ -79,7 +77,7 @@ fun MiniPlayer(
|
|||||||
val subText = when {
|
val subText = when {
|
||||||
isError -> playerState.message
|
isError -> playerState.message
|
||||||
isConnecting -> stringResource(R.string.player_connecting)
|
isConnecting -> stringResource(R.string.player_connecting)
|
||||||
isPlaying -> stringResource(R.string.player_on_air)
|
isPlaying && trackTitle != null -> trackTitle
|
||||||
else -> stationDescription(station)
|
else -> stationDescription(station)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,10 +105,10 @@ fun MiniPlayer(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.shadow(6.dp, RoundedCornerShape(32.dp))
|
.shadow(12.dp, RoundedCornerShape(28.dp))
|
||||||
.clip(RoundedCornerShape(32.dp))
|
.clip(RoundedCornerShape(28.dp))
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
.background(colors.surfaceContainerHigh)
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(32.dp))
|
.border(1.dp, colors.outlineVariant, RoundedCornerShape(28.dp))
|
||||||
.clickable(
|
.clickable(
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
indication = ripple(bounded = true)
|
indication = ripple(bounded = true)
|
||||||
@@ -150,109 +148,84 @@ fun MiniPlayer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.padding(start = 10.dp, end = 12.dp, top = 8.dp, bottom = 8.dp)
|
.padding(start = 8.dp, end = 4.dp, top = 8.dp, bottom = 8.dp)
|
||||||
.testTag("mini_player"),
|
.testTag("mini_player"),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
) {
|
) {
|
||||||
Box(
|
StationDisc(
|
||||||
modifier = Modifier
|
station = station,
|
||||||
.size(46.dp)
|
isPlaying = isPlaying,
|
||||||
.clip(RoundedCornerShape(14.dp))
|
ringWidth = 2.dp,
|
||||||
.background(stationTileColor(station))
|
ringGap = 3.dp,
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(14.dp))
|
glow = false,
|
||||||
) {
|
modifier = Modifier.size(56.dp)
|
||||||
Image(
|
)
|
||||||
painter = painterResource(id = station.iconResId),
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.spacedBy(1.dp)
|
||||||
) {
|
) {
|
||||||
|
LiveLabel(active = isPlaying)
|
||||||
Text(
|
Text(
|
||||||
text = station.name,
|
text = station.name,
|
||||||
style = MaterialTheme.typography.bodyMedium.copy(
|
style = MaterialTheme.typography.bodyMedium.copy(
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
fontSize = 14.5.sp,
|
fontSize = 15.sp,
|
||||||
color = LocalGeoColors.current.deepPurple
|
color = colors.deepPurple
|
||||||
),
|
),
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = subText,
|
text = subText,
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
fontSize = 11.5.sp,
|
fontSize = 12.sp,
|
||||||
color = if (isError) LocalGeoColors.current.redFavorite else (if (isPlaying) LocalGeoColors.current.liveGreen else LocalGeoColors.current.onSurfaceVariant)
|
color = if (isError) colors.redFavorite else colors.onSurfaceVariant
|
||||||
),
|
),
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Box(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
modifier = Modifier
|
||||||
horizontalArrangement = Arrangement.spacedBy(2.dp)
|
.size(48.dp)
|
||||||
|
.shadow(6.dp, CircleShape)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(colors.accentLavender)
|
||||||
|
.clickable { onTogglePlay() }
|
||||||
|
.testTag("mini_play_btn"),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
IconButton(
|
if (isConnecting) {
|
||||||
onClick = onPrevious,
|
CircularProgressIndicator(
|
||||||
modifier = Modifier
|
modifier = Modifier.size(22.dp),
|
||||||
.size(36.dp)
|
color = colors.onAccentLavender,
|
||||||
.testTag("mini_prev_btn")
|
strokeWidth = 2.dp
|
||||||
) {
|
)
|
||||||
|
} else {
|
||||||
AppIcon(
|
AppIcon(
|
||||||
resId = R.drawable.ic_chevron_left,
|
resId = if (isPlaying) R.drawable.ic_pause else R.drawable.ic_play,
|
||||||
contentDescription = stringResource(R.string.previous_station_content_desc),
|
contentDescription = if (isPlaying) stringResource(R.string.pause_content_desc) else stringResource(R.string.play_content_desc),
|
||||||
tint = LocalGeoColors.current.onSurfaceVariant,
|
tint = colors.onAccentLavender,
|
||||||
size = 24.dp
|
size = 22.dp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Box(
|
IconButton(
|
||||||
modifier = Modifier
|
onClick = onNext,
|
||||||
.size(42.dp)
|
modifier = Modifier
|
||||||
.shadow(2.dp, CircleShape)
|
.size(40.dp)
|
||||||
.clip(CircleShape)
|
.testTag("mini_next_btn")
|
||||||
.background(LocalGeoColors.current.accentLavender)
|
) {
|
||||||
.clickable { onTogglePlay() }
|
AppIcon(
|
||||||
.testTag("mini_play_btn"),
|
resId = R.drawable.ic_skip_next,
|
||||||
contentAlignment = Alignment.Center
|
contentDescription = stringResource(R.string.next_station_content_desc),
|
||||||
) {
|
tint = colors.onSurfaceVariant,
|
||||||
if (isConnecting) {
|
size = 22.dp
|
||||||
CircularProgressIndicator(
|
)
|
||||||
modifier = Modifier.size(20.dp),
|
|
||||||
color = LocalGeoColors.current.onAccentLavender,
|
|
||||||
strokeWidth = 2.dp
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
AppIcon(
|
|
||||||
resId = if (isPlaying) R.drawable.ic_pause else R.drawable.ic_play,
|
|
||||||
contentDescription = if (isPlaying) stringResource(R.string.pause_content_desc) else stringResource(R.string.play_content_desc),
|
|
||||||
tint = LocalGeoColors.current.onAccentLavender,
|
|
||||||
size = 22.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IconButton(
|
|
||||||
onClick = onNext,
|
|
||||||
modifier = Modifier
|
|
||||||
.size(36.dp)
|
|
||||||
.testTag("mini_next_btn")
|
|
||||||
) {
|
|
||||||
AppIcon(
|
|
||||||
resId = R.drawable.ic_chevron_right,
|
|
||||||
contentDescription = stringResource(R.string.next_station_content_desc),
|
|
||||||
tint = LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
size = 24.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
package cc.skysparkle.fogwave.ui.components
|
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.layout.ContentScale
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
|
||||||
import coil.compose.AsyncImage
|
|
||||||
import coil.request.ImageRequest
|
|
||||||
import coil.size.Scale
|
|
||||||
import cc.skysparkle.fogwave.R
|
|
||||||
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun MistyMountainBackground(modifier: Modifier = Modifier) {
|
|
||||||
val context = LocalContext.current
|
|
||||||
val request = remember(context) {
|
|
||||||
ImageRequest.Builder(context)
|
|
||||||
.data(R.drawable.bg_misty_mountain)
|
|
||||||
.scale(Scale.FILL)
|
|
||||||
.crossfade(200)
|
|
||||||
.build()
|
|
||||||
}
|
|
||||||
|
|
||||||
Box(modifier = modifier.fillMaxSize().background(LocalGeoColors.current.background)) {
|
|
||||||
AsyncImage(
|
|
||||||
model = request,
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.fillMaxSize()
|
|
||||||
)
|
|
||||||
|
|
||||||
val scrimBase = LocalGeoColors.current.background
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxSize()
|
|
||||||
.background(
|
|
||||||
Brush.verticalGradient(
|
|
||||||
colors = listOf(
|
|
||||||
scrimBase.copy(alpha = 0.62f),
|
|
||||||
scrimBase.copy(alpha = 0.48f),
|
|
||||||
scrimBase.copy(alpha = 0.52f),
|
|
||||||
scrimBase.copy(alpha = 0.78f)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package cc.skysparkle.fogwave.ui.components
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import androidx.compose.animation.animateColorAsState
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.core.FastOutLinearInEasing
|
import androidx.compose.animation.core.FastOutLinearInEasing
|
||||||
import androidx.compose.animation.core.Spring
|
import androidx.compose.animation.core.Spring
|
||||||
@@ -7,34 +9,34 @@ import androidx.compose.animation.core.animate
|
|||||||
import androidx.compose.animation.core.animateFloatAsState
|
import androidx.compose.animation.core.animateFloatAsState
|
||||||
import androidx.compose.animation.core.spring
|
import androidx.compose.animation.core.spring
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.foundation.Image
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.gestures.detectTapGestures
|
import androidx.compose.foundation.gestures.detectTapGestures
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.horizontalScroll
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
|
||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.heightIn
|
||||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
import androidx.compose.foundation.layout.offset
|
import androidx.compose.foundation.layout.offset
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -51,15 +53,15 @@ import androidx.compose.ui.draw.drawBehind
|
|||||||
import androidx.compose.ui.draw.scale
|
import androidx.compose.ui.draw.scale
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
|
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
|
||||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||||
import androidx.compose.ui.input.pointer.pointerInput
|
import androidx.compose.ui.input.pointer.pointerInput
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.painterResource
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.semantics.contentDescription
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
import androidx.compose.ui.semantics.semantics
|
import androidx.compose.ui.semantics.semantics
|
||||||
@@ -82,6 +84,7 @@ import kotlin.math.roundToInt
|
|||||||
fun NowPlayingSheet(
|
fun NowPlayingSheet(
|
||||||
station: RadioStation?,
|
station: RadioStation?,
|
||||||
playerState: PlayerState,
|
playerState: PlayerState,
|
||||||
|
trackTitle: String?,
|
||||||
isFavorite: Boolean,
|
isFavorite: Boolean,
|
||||||
onToggleFavorite: () -> Unit,
|
onToggleFavorite: () -> Unit,
|
||||||
onTogglePlay: () -> Unit,
|
onTogglePlay: () -> Unit,
|
||||||
@@ -100,6 +103,8 @@ fun NowPlayingSheet(
|
|||||||
) {
|
) {
|
||||||
if (station == null) return
|
if (station == null) return
|
||||||
|
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
|
val context = LocalContext.current
|
||||||
val isPlaying = playerState is PlayerState.Playing
|
val isPlaying = playerState is PlayerState.Playing
|
||||||
val isConnecting = playerState is PlayerState.Connecting
|
val isConnecting = playerState is PlayerState.Connecting
|
||||||
val isError = playerState is PlayerState.Error
|
val isError = playerState is PlayerState.Error
|
||||||
@@ -110,238 +115,243 @@ fun NowPlayingSheet(
|
|||||||
SheetDragState(
|
SheetDragState(
|
||||||
dismissThresholdPx = with(density) { 110.dp.toPx() },
|
dismissThresholdPx = with(density) { 110.dp.toPx() },
|
||||||
flingThresholdPx = with(density) { 1400.dp.toPx() },
|
flingThresholdPx = with(density) { 1400.dp.toPx() },
|
||||||
offscreenPx = with(density) { 900.dp.toPx() },
|
offscreenPx = with(density) { 1200.dp.toPx() },
|
||||||
onDismiss = { currentOnClose() }
|
onDismiss = { currentOnClose() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val artScale by animateFloatAsState(
|
val accent by animateColorAsState(
|
||||||
targetValue = if (isPlaying) 1.02f else 0.98f,
|
targetValue = rememberStationArt(station).accentOr(colors.accentLavender),
|
||||||
|
animationSpec = tween(700),
|
||||||
|
label = "page_accent"
|
||||||
|
)
|
||||||
|
val discScale by animateFloatAsState(
|
||||||
|
targetValue = if (isPlaying) 1f else 0.94f,
|
||||||
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
||||||
label = "art_scale"
|
label = "disc_scale"
|
||||||
)
|
)
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
// Read in the draw phase so pulling the sheet does not recompose the whole player.
|
// Read in the draw phase so pulling the page does not recompose the whole player.
|
||||||
.drawBehind {
|
.drawBehind {
|
||||||
val progress = (drag.offsetPx / drag.dismissThresholdPx).coerceIn(0f, 1f)
|
val progress = (drag.offsetPx / drag.dismissThresholdPx).coerceIn(0f, 1f)
|
||||||
drawRect(Color.Black.copy(alpha = 0.55f * (1f - progress)))
|
drawRect(Color.Black.copy(alpha = 0.55f * (1f - progress)))
|
||||||
}
|
}
|
||||||
.clickable(
|
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
|
||||||
indication = null
|
|
||||||
) {
|
|
||||||
onClose()
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
|
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
|
||||||
val isTablet = maxWidth > 600.dp
|
val isTablet = maxWidth > 600.dp
|
||||||
val sheetWidthModifier = if (isTablet) Modifier.widthIn(max = 560.dp) else Modifier.fillMaxWidth()
|
val pageWidth = if (isTablet) Modifier.widthIn(max = 560.dp) else Modifier.fillMaxWidth()
|
||||||
|
|
||||||
Column(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomCenter)
|
.align(Alignment.TopCenter)
|
||||||
.then(sheetModifier)
|
.then(sheetModifier)
|
||||||
.offset { IntOffset(0, drag.offsetPx.roundToInt()) }
|
.offset { IntOffset(0, drag.offsetPx.roundToInt()) }
|
||||||
.then(sheetWidthModifier)
|
.fillMaxSize()
|
||||||
.fillMaxHeight(0.94f)
|
.background(colors.background)
|
||||||
.shadow(16.dp, RoundedCornerShape(topStart = 36.dp, topEnd = 36.dp))
|
// Swallow taps so nothing underneath reacts to them.
|
||||||
.clip(RoundedCornerShape(topStart = 36.dp, topEnd = 36.dp))
|
|
||||||
.background(LocalGeoColors.current.background)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(topStart = 36.dp, topEnd = 36.dp))
|
|
||||||
// Swallow taps so they do not fall through to the scrim (which closes the sheet),
|
|
||||||
// without exposing the sheet itself as a button to accessibility services.
|
|
||||||
.pointerInput(Unit) { detectTapGestures { } }
|
.pointerInput(Unit) { detectTapGestures { } }
|
||||||
// The whole sheet scrolls; drags that the content cannot use pull the sheet down.
|
.testTag("now_playing_sheet")
|
||||||
.nestedScroll(drag.nestedScrollConnection)
|
|
||||||
.navigationBarsPadding()
|
|
||||||
.verticalScroll(rememberScrollState())
|
|
||||||
.padding(bottom = 28.dp)
|
|
||||||
.testTag("now_playing_sheet"),
|
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
|
||||||
) {
|
) {
|
||||||
|
// Fog in the station's color drifts behind the disc and fades into the page.
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 12.dp, bottom = 4.dp)
|
|
||||||
.size(width = 48.dp, height = 5.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(LocalGeoColors.current.outlineVariant)
|
|
||||||
)
|
|
||||||
|
|
||||||
// The sheet closes by swiping down, tapping outside it or pressing Back.
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.now_playing_label),
|
|
||||||
style = MaterialTheme.typography.labelSmall.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
letterSpacing = 1.2.sp,
|
|
||||||
color = LocalGeoColors.current.primary
|
|
||||||
),
|
|
||||||
modifier = Modifier.padding(horizontal = 24.dp, vertical = 12.dp)
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(horizontal = 44.dp, vertical = 10.dp)
|
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.aspectRatio(1f)
|
.height(620.dp)
|
||||||
.scale(artScale)
|
.fadeOutBottom(from = 0.5f)
|
||||||
.shadow(8.dp, RoundedCornerShape(32.dp))
|
|
||||||
.clip(RoundedCornerShape(32.dp))
|
|
||||||
.background(stationTileColor(station))
|
|
||||||
.border(1.5.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(32.dp))
|
|
||||||
) {
|
) {
|
||||||
Image(
|
FogLayer(
|
||||||
painter = painterResource(id = station.iconResId),
|
tint = accent,
|
||||||
contentDescription = null,
|
intensity = if (isPlaying) 0.9f else 0.45f,
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
modifier = Modifier.matchParentSize()
|
||||||
)
|
)
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.matchParentSize()
|
||||||
|
.background(
|
||||||
|
Brush.verticalGradient(
|
||||||
|
0f to colors.background.copy(alpha = 0.35f),
|
||||||
|
0.3f to Color.Transparent
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.align(Alignment.TopCenter)
|
||||||
.padding(horizontal = 24.dp, vertical = 6.dp),
|
.then(pageWidth)
|
||||||
|
.fillMaxHeight()
|
||||||
|
// The page scrolls; drags the content cannot use pull it down to close.
|
||||||
|
.nestedScroll(drag.nestedScrollConnection)
|
||||||
|
.verticalScroll(rememberScrollState())
|
||||||
|
.statusBarsPadding()
|
||||||
|
.navigationBarsPadding()
|
||||||
|
.padding(bottom = 24.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
Text(
|
|
||||||
text = station.name,
|
|
||||||
style = MaterialTheme.typography.headlineMedium.copy(
|
|
||||||
fontWeight = FontWeight.ExtraBold,
|
|
||||||
fontSize = 25.sp,
|
|
||||||
letterSpacing = (-0.5).sp,
|
|
||||||
color = LocalGeoColors.current.deepPurple,
|
|
||||||
textAlign = TextAlign.Center
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
|
||||||
|
|
||||||
Text(
|
|
||||||
text = stationDescription(station),
|
|
||||||
style = MaterialTheme.typography.bodyMedium.copy(
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
textAlign = TextAlign.Center
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(CircleShape)
|
.fillMaxWidth()
|
||||||
.background(if (isPlaying) LocalGeoColors.current.primaryContainer else LocalGeoColors.current.surfaceContainer)
|
.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||||
.border(
|
verticalAlignment = Alignment.CenterVertically
|
||||||
width = 1.dp,
|
|
||||||
color = if (isPlaying) LocalGeoColors.current.primary.copy(alpha = 0.4f) else LocalGeoColors.current.outlineVariant,
|
|
||||||
shape = CircleShape
|
|
||||||
)
|
|
||||||
.padding(horizontal = 14.dp, vertical = 6.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
|
||||||
) {
|
) {
|
||||||
when {
|
// Closed by swiping down or the system Back gesture.
|
||||||
isPlaying -> LiveOnAirDot()
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
isError -> AppIcon(
|
IconButton(onClick = onOpenEqualizer, modifier = Modifier.testTag("np_equalizer_toggle")) {
|
||||||
resId = R.drawable.ic_alert,
|
|
||||||
tint = LocalGeoColors.current.redFavorite,
|
|
||||||
size = 12.dp
|
|
||||||
)
|
|
||||||
!isConnecting -> AppIcon(
|
|
||||||
resId = R.drawable.ic_sleep,
|
|
||||||
tint = LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
size = 12.dp
|
|
||||||
)
|
|
||||||
else -> Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(6.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(LocalGeoColors.current.onSurfaceVariant)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = when {
|
|
||||||
isError -> playerState.message
|
|
||||||
isConnecting -> stringResource(R.string.player_connecting)
|
|
||||||
isPlaying -> stringResource(R.string.now_playing_live)
|
|
||||||
else -> stringResource(R.string.player_stopped)
|
|
||||||
},
|
|
||||||
style = MaterialTheme.typography.labelSmall.copy(
|
|
||||||
fontWeight = FontWeight.SemiBold,
|
|
||||||
fontSize = 12.sp,
|
|
||||||
color = if (isPlaying) LocalGeoColors.current.deepPurple else (if (isError) LocalGeoColors.current.redFavorite else LocalGeoColors.current.onSurfaceVariant)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LiveBars(
|
|
||||||
active = isPlaying,
|
|
||||||
color = LocalGeoColors.current.primary,
|
|
||||||
modifier = Modifier
|
|
||||||
.align(Alignment.CenterHorizontally)
|
|
||||||
.padding(vertical = 10.dp)
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = 18.dp, vertical = 8.dp),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(14.dp)
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(50.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, CircleShape)
|
|
||||||
.clickable { onOpenEqualizer() }
|
|
||||||
.testTag("np_equalizer_toggle"),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
AppIcon(
|
AppIcon(
|
||||||
resId = R.drawable.ic_equalizer,
|
resId = R.drawable.ic_equalizer,
|
||||||
contentDescription = stringResource(R.string.equalizer_content_desc),
|
contentDescription = stringResource(R.string.equalizer_content_desc),
|
||||||
tint = if (audioEffects.equalizerEnabled) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurfaceVariant.copy(alpha = 0.5f),
|
tint = if (audioEffects.equalizerEnabled) colors.primary else colors.onSurface,
|
||||||
size = 20.dp
|
size = 22.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StationDisc(
|
||||||
|
station = station,
|
||||||
|
isPlaying = isPlaying,
|
||||||
|
glow = false,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(top = 12.dp, bottom = 20.dp)
|
||||||
|
.fillMaxWidth(if (isTablet) 0.6f else 0.74f)
|
||||||
|
.scale(discScale)
|
||||||
|
)
|
||||||
|
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 24.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
||||||
|
) {
|
||||||
|
Column(modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||||
|
LiveLabel(active = isPlaying)
|
||||||
|
Text(
|
||||||
|
text = station.name,
|
||||||
|
style = MaterialTheme.typography.headlineSmall.copy(
|
||||||
|
fontWeight = FontWeight.ExtraBold,
|
||||||
|
fontSize = 22.sp,
|
||||||
|
letterSpacing = (-0.4).sp,
|
||||||
|
color = colors.deepPurple
|
||||||
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = "${station.bitrate} • ${stationGenres(station)}",
|
||||||
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
|
fontSize = 12.sp,
|
||||||
|
color = colors.onSurfaceVariant
|
||||||
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(
|
IconButton(
|
||||||
|
onClick = { context.shareStation(station, trackTitle) },
|
||||||
|
modifier = Modifier.testTag("np_share_btn")
|
||||||
|
) {
|
||||||
|
AppIcon(
|
||||||
|
resId = R.drawable.ic_share,
|
||||||
|
contentDescription = stringResource(R.string.share_content_desc),
|
||||||
|
tint = colors.onSurface,
|
||||||
|
size = 21.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val favScale by animateFloatAsState(
|
||||||
|
targetValue = if (isFavorite) 1.15f else 1f,
|
||||||
|
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
||||||
|
label = "fav_scale"
|
||||||
|
)
|
||||||
|
IconButton(
|
||||||
|
onClick = onToggleFavorite,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(50.dp)
|
.scale(favScale)
|
||||||
.clip(CircleShape)
|
.testTag("np_favorite_toggle")
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
) {
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, CircleShape)
|
AppIcon(
|
||||||
.clickable { onPrevious() }
|
resId = if (isFavorite) R.drawable.ic_heart_fill else R.drawable.ic_heart_outline,
|
||||||
.testTag("np_prev_btn"),
|
contentDescription = stringResource(
|
||||||
contentAlignment = Alignment.Center
|
if (isFavorite) R.string.remove_from_favorites else R.string.add_to_favorites
|
||||||
|
),
|
||||||
|
tint = if (isFavorite) colors.redFavorite else colors.onSurface,
|
||||||
|
size = 22.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(22.dp))
|
||||||
|
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
||||||
|
) {
|
||||||
|
AppIcon(resId = R.drawable.ic_music_note, tint = colors.onSurfaceVariant, size = 13.dp)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.now_playing_label),
|
||||||
|
style = MaterialTheme.typography.labelSmall.copy(
|
||||||
|
fontWeight = FontWeight.SemiBold,
|
||||||
|
fontSize = 10.5.sp,
|
||||||
|
letterSpacing = 1.2.sp,
|
||||||
|
color = colors.onSurfaceVariant
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
|
|
||||||
|
Text(
|
||||||
|
text = when {
|
||||||
|
isError -> playerState.message
|
||||||
|
isConnecting -> stringResource(R.string.player_connecting)
|
||||||
|
!isPlaying -> stringResource(R.string.player_stopped)
|
||||||
|
else -> trackTitle ?: stationDescription(station)
|
||||||
|
},
|
||||||
|
style = MaterialTheme.typography.titleMedium.copy(
|
||||||
|
fontWeight = FontWeight.SemiBold,
|
||||||
|
fontSize = 16.sp,
|
||||||
|
lineHeight = 21.sp,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
color = if (isError) colors.redFavorite else colors.onSurface
|
||||||
|
),
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 32.dp)
|
||||||
|
.heightIn(min = 42.dp)
|
||||||
|
.testTag("np_track_title")
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(18.dp))
|
||||||
|
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(28.dp)
|
||||||
|
) {
|
||||||
|
IconButton(
|
||||||
|
onClick = onPrevious,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(52.dp)
|
||||||
|
.testTag("np_prev_btn")
|
||||||
) {
|
) {
|
||||||
AppIcon(
|
AppIcon(
|
||||||
resId = R.drawable.ic_skip_previous,
|
resId = R.drawable.ic_skip_previous,
|
||||||
contentDescription = stringResource(R.string.previous_station_content_desc),
|
contentDescription = stringResource(R.string.previous_station_content_desc),
|
||||||
tint = LocalGeoColors.current.deepPurple,
|
tint = colors.onSurface,
|
||||||
size = 24.dp
|
size = 28.dp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(72.dp)
|
.size(76.dp)
|
||||||
.shadow(4.dp, RoundedCornerShape(26.dp))
|
.shadow(14.dp, CircleShape, ambientColor = colors.accentLavender, spotColor = colors.accentLavender)
|
||||||
.clip(RoundedCornerShape(26.dp))
|
.clip(CircleShape)
|
||||||
.background(LocalGeoColors.current.accentLavender)
|
.background(colors.accentLavender)
|
||||||
.clickable { onTogglePlay() }
|
.clickable { onTogglePlay() }
|
||||||
.testTag("np_play_btn"),
|
.testTag("np_play_btn"),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
@@ -352,297 +362,180 @@ fun NowPlayingSheet(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(32.dp)
|
.size(32.dp)
|
||||||
.semantics { contentDescription = connecting },
|
.semantics { contentDescription = connecting },
|
||||||
color = LocalGeoColors.current.onAccentLavender,
|
color = colors.onAccentLavender,
|
||||||
strokeWidth = 3.dp
|
strokeWidth = 3.dp
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
AppIcon(
|
AppIcon(
|
||||||
resId = if (isPlaying) R.drawable.ic_pause else R.drawable.ic_play,
|
resId = if (isPlaying) R.drawable.ic_pause else R.drawable.ic_play,
|
||||||
contentDescription = if (isPlaying) stringResource(R.string.pause_content_desc) else stringResource(R.string.play_content_desc),
|
contentDescription = stringResource(
|
||||||
tint = LocalGeoColors.current.onAccentLavender,
|
if (isPlaying) R.string.pause_content_desc else R.string.play_content_desc
|
||||||
size = 34.dp
|
),
|
||||||
|
tint = colors.onAccentLavender,
|
||||||
|
size = 32.dp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(
|
IconButton(
|
||||||
|
onClick = onNext,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(50.dp)
|
.size(52.dp)
|
||||||
.clip(CircleShape)
|
.testTag("np_next_btn")
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, CircleShape)
|
|
||||||
.clickable { onNext() }
|
|
||||||
.testTag("np_next_btn"),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
) {
|
||||||
AppIcon(
|
AppIcon(
|
||||||
resId = R.drawable.ic_skip_next,
|
resId = R.drawable.ic_skip_next,
|
||||||
contentDescription = stringResource(R.string.next_station_content_desc),
|
contentDescription = stringResource(R.string.next_station_content_desc),
|
||||||
tint = LocalGeoColors.current.deepPurple,
|
tint = colors.onSurface,
|
||||||
size = 24.dp
|
size = 28.dp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val favScale by animateFloatAsState(
|
Spacer(modifier = Modifier.height(28.dp))
|
||||||
targetValue = if (isFavorite) 1.12f else 1.0f,
|
|
||||||
animationSpec = spring(dampingRatio = Spring.DampingRatioMediumBouncy),
|
ExtraPanel(
|
||||||
label = "fav_scale"
|
station = station,
|
||||||
)
|
playerState = playerState,
|
||||||
Box(
|
activeExtraTab = activeExtraTab,
|
||||||
modifier = Modifier
|
onSelectExtraTab = onSelectExtraTab,
|
||||||
.size(50.dp)
|
recents = recents,
|
||||||
.clip(CircleShape)
|
similarStations = similarStations,
|
||||||
.background(if (isFavorite) LocalGeoColors.current.redFavorite.copy(alpha = 0.15f) else LocalGeoColors.current.surfaceContainer)
|
onSelectStation = onSelectStation
|
||||||
.border(
|
)
|
||||||
width = 1.2.dp,
|
}
|
||||||
color = if (isFavorite) LocalGeoColors.current.redFavorite else LocalGeoColors.current.outlineVariant,
|
}
|
||||||
shape = CircleShape
|
}
|
||||||
)
|
}
|
||||||
.scale(favScale)
|
}
|
||||||
.clickable { onToggleFavorite() }
|
|
||||||
.testTag("np_favorite_toggle"),
|
/** Lower card of the player: recent and similar stations, station info. */
|
||||||
contentAlignment = Alignment.Center
|
@Composable
|
||||||
) {
|
private fun ExtraPanel(
|
||||||
AppIcon(
|
station: RadioStation,
|
||||||
resId = if (isFavorite) R.drawable.ic_heart_fill else R.drawable.ic_heart_outline,
|
playerState: PlayerState,
|
||||||
contentDescription = if (isFavorite) stringResource(R.string.remove_from_favorites) else stringResource(R.string.add_to_favorites),
|
activeExtraTab: ExtraPlayerTab,
|
||||||
tint = if (isFavorite) LocalGeoColors.current.redFavorite else LocalGeoColors.current.deepPurple,
|
onSelectExtraTab: (ExtraPlayerTab) -> Unit,
|
||||||
size = 22.dp
|
recents: List<RadioStation>,
|
||||||
|
similarStations: List<RadioStation>,
|
||||||
|
onSelectStation: (RadioStation) -> Unit
|
||||||
|
) {
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 12.dp)
|
||||||
|
.clip(RoundedCornerShape(28.dp))
|
||||||
|
.background(colors.surfaceContainer)
|
||||||
|
.border(1.dp, colors.outlineVariant, RoundedCornerShape(28.dp))
|
||||||
|
.padding(vertical = 10.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.size(width = 40.dp, height = 4.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(colors.outlineVariant)
|
||||||
|
)
|
||||||
|
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.horizontalScroll(rememberScrollState())
|
||||||
|
.padding(horizontal = 12.dp, vertical = 12.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
|
) {
|
||||||
|
ExtraPlayerTab.entries.forEach { tab ->
|
||||||
|
val isSelected = tab == activeExtraTab
|
||||||
|
val bg by animateColorAsState(
|
||||||
|
targetValue = if (isSelected) colors.accentLavender else colors.surfaceContainerHigh,
|
||||||
|
label = "extra_tab_bg"
|
||||||
|
)
|
||||||
|
val fg by animateColorAsState(
|
||||||
|
targetValue = if (isSelected) colors.onAccentLavender else colors.onSurfaceVariant,
|
||||||
|
label = "extra_tab_fg"
|
||||||
|
)
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(bg)
|
||||||
|
.clickable { onSelectExtraTab(tab) }
|
||||||
|
.padding(horizontal = 14.dp, vertical = 8.dp)
|
||||||
|
.testTag("extra_tab_${tab.name.lowercase()}"),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(tab.titleRes),
|
||||||
|
style = MaterialTheme.typography.labelMedium.copy(
|
||||||
|
fontWeight = if (isSelected) FontWeight.Bold else FontWeight.Medium,
|
||||||
|
fontSize = 12.5.sp,
|
||||||
|
color = fg
|
||||||
|
),
|
||||||
|
maxLines = 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 8.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(2.dp)
|
||||||
|
) {
|
||||||
|
when (activeExtraTab) {
|
||||||
|
ExtraPlayerTab.RECENT -> {
|
||||||
|
if (recents.isEmpty()) {
|
||||||
|
EmptyHint(stringResource(R.string.recent_empty))
|
||||||
|
} else {
|
||||||
|
recents.forEach { s ->
|
||||||
|
StationRow(
|
||||||
|
station = s,
|
||||||
|
isCurrent = false,
|
||||||
|
isPlaying = false,
|
||||||
|
onClick = { onSelectStation(s) }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
ExtraPlayerTab.SIMILAR -> {
|
||||||
|
if (similarStations.isEmpty()) {
|
||||||
Column(
|
EmptyHint(stringResource(R.string.similar_empty))
|
||||||
modifier = Modifier
|
} else {
|
||||||
.fillMaxWidth()
|
similarStations.forEach { s ->
|
||||||
.padding(horizontal = 20.dp),
|
StationRow(
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
station = s,
|
||||||
) {
|
isCurrent = false,
|
||||||
Row(
|
isPlaying = false,
|
||||||
modifier = Modifier
|
onClick = { onSelectStation(s) },
|
||||||
.fillMaxWidth()
|
subtitle = "${stationDescription(s)} • ${stationGenres(s)}"
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(14.dp))
|
|
||||||
.padding(4.dp),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
|
||||||
) {
|
|
||||||
ExtraPlayerTab.entries.forEach { tab ->
|
|
||||||
val isSelected = tab == activeExtraTab
|
|
||||||
val bg by animateColorAsState(
|
|
||||||
targetValue = if (isSelected) LocalGeoColors.current.primaryContainer else Color.Transparent,
|
|
||||||
label = "extra_tab_bg"
|
|
||||||
)
|
)
|
||||||
val textColor by animateColorAsState(
|
|
||||||
targetValue = if (isSelected) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
label = "extra_tab_text"
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.weight(1f)
|
|
||||||
.clip(RoundedCornerShape(10.dp))
|
|
||||||
.background(bg)
|
|
||||||
.clickable { onSelectExtraTab(tab) }
|
|
||||||
.padding(vertical = 8.dp),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(tab.titleRes),
|
|
||||||
style = MaterialTheme.typography.labelSmall.copy(
|
|
||||||
fontWeight = if (isSelected) FontWeight.Bold else FontWeight.Medium,
|
|
||||||
fontSize = 12.sp,
|
|
||||||
color = textColor
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
when (activeExtraTab) {
|
ExtraPlayerTab.INFO -> {
|
||||||
ExtraPlayerTab.RECENT -> {
|
Column(
|
||||||
if (recents.isEmpty()) {
|
modifier = Modifier
|
||||||
Text(
|
.fillMaxWidth()
|
||||||
text = stringResource(R.string.recent_empty),
|
.padding(horizontal = 10.dp, vertical = 4.dp),
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
color = LocalGeoColors.current.onSurfaceVariant,
|
) {
|
||||||
textAlign = TextAlign.Center
|
InfoRow(key = stringResource(R.string.info_station), value = station.name)
|
||||||
),
|
InfoRow(key = stringResource(R.string.info_description), value = stationDescription(station))
|
||||||
modifier = Modifier
|
InfoRow(key = stringResource(R.string.info_genre), value = stationGenres(station))
|
||||||
.fillMaxWidth()
|
InfoRow(key = stringResource(R.string.info_quality), value = station.bitrate)
|
||||||
.padding(vertical = 16.dp)
|
InfoRow(
|
||||||
)
|
key = stringResource(R.string.info_status),
|
||||||
} else {
|
value = when (playerState) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
is PlayerState.Playing -> stringResource(R.string.status_live)
|
||||||
recents.forEach { s ->
|
is PlayerState.Connecting -> stringResource(R.string.player_connecting)
|
||||||
val isCur = s.id == station.id
|
is PlayerState.Error -> playerState.message
|
||||||
Row(
|
else -> stringResource(R.string.player_stopped)
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(if (isCur) LocalGeoColors.current.primaryContainer.copy(alpha = 0.6f) else LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(0.8.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(14.dp))
|
|
||||||
.clickable { onSelectStation(s) }
|
|
||||||
.padding(8.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp)
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(40.dp)
|
|
||||||
.clip(RoundedCornerShape(10.dp))
|
|
||||||
.background(stationTileColor(s))
|
|
||||||
) {
|
|
||||||
Image(
|
|
||||||
painter = painterResource(id = s.iconResId),
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
|
||||||
) {
|
|
||||||
if (isCur && isPlaying) {
|
|
||||||
LiveOnAirDot()
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = s.name,
|
|
||||||
style = MaterialTheme.typography.bodyMedium.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = if (isCur) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurface
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = stationDescription(s),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
AppIcon(
|
|
||||||
resId = R.drawable.ic_play,
|
|
||||||
contentDescription = stringResource(R.string.play_content_desc),
|
|
||||||
tint = LocalGeoColors.current.deepPurple,
|
|
||||||
size = 18.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
|
|
||||||
ExtraPlayerTab.SIMILAR -> {
|
|
||||||
if (similarStations.isEmpty()) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.similar_empty),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
textAlign = TextAlign.Center
|
|
||||||
),
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(vertical = 16.dp)
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
|
||||||
similarStations.forEach { s ->
|
|
||||||
Row(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(0.8.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(14.dp))
|
|
||||||
.clickable { onSelectStation(s) }
|
|
||||||
.padding(8.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp)
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(40.dp)
|
|
||||||
.clip(RoundedCornerShape(10.dp))
|
|
||||||
.background(stationTileColor(s))
|
|
||||||
) {
|
|
||||||
Image(
|
|
||||||
painter = painterResource(id = s.iconResId),
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
|
||||||
Text(
|
|
||||||
text = s.name,
|
|
||||||
style = MaterialTheme.typography.bodyMedium.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = LocalGeoColors.current.deepPurple
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = "${stationDescription(s)} • ${stationGenres(s)}",
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
AppIcon(
|
|
||||||
resId = R.drawable.ic_play,
|
|
||||||
contentDescription = stringResource(R.string.play_content_desc),
|
|
||||||
tint = LocalGeoColors.current.deepPurple,
|
|
||||||
size = 18.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ExtraPlayerTab.INFO -> {
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(16.dp))
|
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(16.dp))
|
|
||||||
.padding(14.dp),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
|
||||||
) {
|
|
||||||
InfoRow(key = stringResource(R.string.info_station), value = station.name)
|
|
||||||
InfoRow(key = stringResource(R.string.info_description), value = stationDescription(station))
|
|
||||||
InfoRow(key = stringResource(R.string.info_genre), value = stationGenres(station))
|
|
||||||
InfoRow(key = stringResource(R.string.info_quality), value = station.bitrate)
|
|
||||||
InfoRow(
|
|
||||||
key = stringResource(R.string.info_status),
|
|
||||||
value = when (playerState) {
|
|
||||||
is PlayerState.Playing -> stringResource(R.string.status_live)
|
|
||||||
is PlayerState.Connecting -> stringResource(R.string.player_connecting)
|
|
||||||
is PlayerState.Error -> playerState.message
|
|
||||||
else -> stringResource(R.string.player_stopped)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -650,6 +543,20 @@ fun NowPlayingSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun EmptyHint(text: String) {
|
||||||
|
Text(
|
||||||
|
text = text,
|
||||||
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
|
color = LocalGeoColors.current.onSurfaceVariant,
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 16.dp, vertical = 20.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun InfoRow(key: String, value: String) {
|
private fun InfoRow(key: String, value: String) {
|
||||||
Row(
|
Row(
|
||||||
@@ -677,6 +584,22 @@ private fun InfoRow(key: String, value: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun Context.shareStation(station: RadioStation, trackTitle: String?) {
|
||||||
|
val text = if (trackTitle != null) {
|
||||||
|
getString(R.string.share_text_track, trackTitle, station.name)
|
||||||
|
} else {
|
||||||
|
getString(R.string.share_text, station.name)
|
||||||
|
}
|
||||||
|
val send = Intent(Intent.ACTION_SEND).apply {
|
||||||
|
type = "text/plain"
|
||||||
|
putExtra(Intent.EXTRA_TEXT, text)
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
startActivity(Intent.createChooser(send, null).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||||
|
} catch (_: android.content.ActivityNotFoundException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offset of the now-playing sheet while it is being pulled down. Driven through nested scroll so
|
* Offset of the now-playing sheet while it is being pulled down. Driven through nested scroll so
|
||||||
* the gesture works anywhere on the (scrollable) sheet once its content is scrolled to the top.
|
* the gesture works anywhere on the (scrollable) sheet once its content is scrolled to the top.
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import android.content.res.Resources
|
||||||
|
import android.graphics.BitmapFactory
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.Immutable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.produceState
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.core.graphics.ColorUtils
|
||||||
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
import kotlin.math.abs
|
||||||
|
import kotlin.math.atan2
|
||||||
|
import kotlin.math.cos
|
||||||
|
import kotlin.math.sin
|
||||||
|
import kotlin.math.sqrt
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What the UI needs to know about a station logo: its brand color (for the fog and the ring)
|
||||||
|
* and where the visible part of the logo sits, so wide wordmarks can be enlarged inside a circle.
|
||||||
|
*/
|
||||||
|
@Immutable
|
||||||
|
data class StationArt(
|
||||||
|
val accent: Color?,
|
||||||
|
val left: Float = 0f,
|
||||||
|
val top: Float = 0f,
|
||||||
|
val right: Float = 1f,
|
||||||
|
val bottom: Float = 1f
|
||||||
|
) {
|
||||||
|
/** Logos with their own square background are shown edge to edge instead of being shrunk. */
|
||||||
|
val isFullBleed: Boolean get() = right - left > 0.97f && bottom - top > 0.97f
|
||||||
|
|
||||||
|
/** Scale that fits the visible part of the logo into a circle of [fill] of its diameter. */
|
||||||
|
fun circleScale(fill: Float = 0.86f): Float {
|
||||||
|
if (isFullBleed) return 1f
|
||||||
|
val w = right - left
|
||||||
|
val h = bottom - top
|
||||||
|
return (fill / sqrt(w * w + h * h)).coerceIn(0.5f, 1.7f)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Scale that fits the visible part of the logo into [fill] of a square tile. */
|
||||||
|
fun squareScale(fill: Float = 0.84f): Float {
|
||||||
|
if (isFullBleed) return 1f
|
||||||
|
return minOf(fill / (right - left), fill / (bottom - top)).coerceIn(1f, 1.5f)
|
||||||
|
}
|
||||||
|
|
||||||
|
val centerX: Float get() = (left + right) / 2f
|
||||||
|
val centerY: Float get() = (top + bottom) / 2f
|
||||||
|
}
|
||||||
|
|
||||||
|
private val cache = ConcurrentHashMap<Int, StationArt>()
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun rememberStationArt(station: RadioStation): StationArt? {
|
||||||
|
val resources = LocalContext.current.resources
|
||||||
|
val art by produceState(initialValue = cache[station.iconResId], station.iconResId) {
|
||||||
|
value = cache[station.iconResId] ?: withContext(Dispatchers.Default) {
|
||||||
|
analyzeLogo(resources, station.iconResId).also { cache[station.iconResId] = it }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return art
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun analyzeLogo(resources: Resources, resId: Int): StationArt {
|
||||||
|
val options = BitmapFactory.Options().apply { inSampleSize = 4 }
|
||||||
|
val bitmap = BitmapFactory.decodeResource(resources, resId, options) ?: return StationArt(accent = null)
|
||||||
|
val w = bitmap.width
|
||||||
|
val h = bitmap.height
|
||||||
|
val pixels = IntArray(w * h)
|
||||||
|
bitmap.getPixels(pixels, 0, w, 0, 0, w, h)
|
||||||
|
bitmap.recycle()
|
||||||
|
|
||||||
|
var minX = w
|
||||||
|
var minY = h
|
||||||
|
var maxX = -1
|
||||||
|
var maxY = -1
|
||||||
|
// Hue is averaged on the circle, weighted by how vivid each pixel is.
|
||||||
|
var hueX = 0.0
|
||||||
|
var hueY = 0.0
|
||||||
|
var weight = 0.0
|
||||||
|
var opaque = 0
|
||||||
|
val hsl = FloatArray(3)
|
||||||
|
|
||||||
|
for (y in 0 until h) {
|
||||||
|
for (x in 0 until w) {
|
||||||
|
val c = pixels[y * w + x]
|
||||||
|
val alpha = c ushr 24
|
||||||
|
if (alpha <= 24) continue
|
||||||
|
if (x < minX) minX = x
|
||||||
|
if (x > maxX) maxX = x
|
||||||
|
if (y < minY) minY = y
|
||||||
|
if (y > maxY) maxY = y
|
||||||
|
opaque++
|
||||||
|
|
||||||
|
ColorUtils.colorToHSL(c, hsl)
|
||||||
|
val vivid = hsl[1] * (1f - abs(hsl[2] - 0.5f) * 2f)
|
||||||
|
if (vivid < 0.25f) continue
|
||||||
|
val wgt = vivid.toDouble() * (alpha / 255.0)
|
||||||
|
val rad = Math.toRadians(hsl[0].toDouble())
|
||||||
|
hueX += cos(rad) * wgt
|
||||||
|
hueY += sin(rad) * wgt
|
||||||
|
weight += wgt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (maxX < 0) return StationArt(accent = null)
|
||||||
|
|
||||||
|
// Mostly black, white or grey logos keep the app's own blue.
|
||||||
|
val accent = if (opaque > 0 && weight / opaque > 0.08) {
|
||||||
|
var hue = Math.toDegrees(atan2(hueY, hueX)).toFloat()
|
||||||
|
if (hue < 0f) hue += 360f
|
||||||
|
// Same saturation and lightness for every station, so only the hue changes.
|
||||||
|
Color(ColorUtils.HSLToColor(floatArrayOf(hue, 0.78f, 0.6f)))
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
return StationArt(
|
||||||
|
accent = accent,
|
||||||
|
left = minX / w.toFloat(),
|
||||||
|
top = minY / h.toFloat(),
|
||||||
|
right = (maxX + 1) / w.toFloat(),
|
||||||
|
bottom = (maxY + 1) / h.toFloat()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Station color, or the app accent when the logo has none. */
|
||||||
|
fun StationArt?.accentOr(fallback: Color): Color = this?.accent ?: fallback
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.animation.animateColorAsState
|
||||||
|
import androidx.compose.animation.core.Animatable
|
||||||
|
import androidx.compose.animation.core.LinearEasing
|
||||||
|
import androidx.compose.animation.core.tween
|
||||||
|
import androidx.compose.foundation.Canvas
|
||||||
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.geometry.Size
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.StrokeCap
|
||||||
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||||
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
|
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||||
|
import kotlin.math.cos
|
||||||
|
import kotlin.math.min
|
||||||
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
private const val ARC_SWEEP = 280f
|
||||||
|
private const val TURN_MILLIS = 14_000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Round station artwork wrapped in a ring in the station's own color. Live radio has no track
|
||||||
|
* progress, so the arc slowly circles while the station plays and rests where it was when it stops.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun StationDisc(
|
||||||
|
station: RadioStation,
|
||||||
|
isPlaying: Boolean,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
ringWidth: Dp = 4.dp,
|
||||||
|
ringGap: Dp = 10.dp,
|
||||||
|
glow: Boolean = true
|
||||||
|
) {
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
|
val art = rememberStationArt(station)
|
||||||
|
val accent by animateColorAsState(
|
||||||
|
targetValue = art.accentOr(colors.primary),
|
||||||
|
animationSpec = tween(600),
|
||||||
|
label = "disc_accent"
|
||||||
|
)
|
||||||
|
val rotation = remember { Animatable(0f) }
|
||||||
|
|
||||||
|
LaunchedEffect(isPlaying) {
|
||||||
|
while (isPlaying) {
|
||||||
|
rotation.snapTo(rotation.value % 360f)
|
||||||
|
rotation.animateTo(
|
||||||
|
targetValue = rotation.value + 360f,
|
||||||
|
animationSpec = tween(TURN_MILLIS, easing = LinearEasing)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(modifier = modifier.aspectRatio(1f), contentAlignment = Alignment.Center) {
|
||||||
|
Canvas(modifier = Modifier.fillMaxSize()) {
|
||||||
|
val stroke = ringWidth.toPx()
|
||||||
|
val radius = min(size.width, size.height) / 2f - stroke
|
||||||
|
val topLeft = Offset(center.x - radius, center.y - radius)
|
||||||
|
val arcSize = Size(radius * 2, radius * 2)
|
||||||
|
|
||||||
|
if (glow) {
|
||||||
|
drawCircle(
|
||||||
|
brush = Brush.radialGradient(
|
||||||
|
colors = listOf(accent.copy(alpha = 0.28f), Color.Transparent),
|
||||||
|
center = center,
|
||||||
|
radius = radius * 1.25f
|
||||||
|
),
|
||||||
|
radius = radius * 1.25f,
|
||||||
|
center = center
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
drawCircle(
|
||||||
|
color = colors.outlineVariant,
|
||||||
|
radius = radius,
|
||||||
|
center = center,
|
||||||
|
style = Stroke(width = stroke)
|
||||||
|
)
|
||||||
|
|
||||||
|
val start = -90f + rotation.value
|
||||||
|
drawArc(
|
||||||
|
color = accent,
|
||||||
|
startAngle = start,
|
||||||
|
sweepAngle = ARC_SWEEP,
|
||||||
|
useCenter = false,
|
||||||
|
topLeft = topLeft,
|
||||||
|
size = arcSize,
|
||||||
|
style = Stroke(width = stroke, cap = StrokeCap.Round)
|
||||||
|
)
|
||||||
|
|
||||||
|
val end = Math.toRadians((start + ARC_SWEEP).toDouble())
|
||||||
|
val knob = Offset(
|
||||||
|
center.x + radius * cos(end).toFloat(),
|
||||||
|
center.y + radius * sin(end).toFloat()
|
||||||
|
)
|
||||||
|
drawCircle(color = accent, radius = stroke * 1.9f, center = knob)
|
||||||
|
drawCircle(color = Color.White, radius = stroke * 0.8f, center = knob)
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(ringWidth * 2 + ringGap)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(stationTileColor(station))
|
||||||
|
.border(1.dp, colors.outlineVariant, CircleShape),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
// Wide wordmarks are enlarged and centered so they span the circle instead of
|
||||||
|
// floating small in the middle; square logos fill it edge to edge.
|
||||||
|
Image(
|
||||||
|
painter = painterResource(id = station.iconResId),
|
||||||
|
contentDescription = null,
|
||||||
|
contentScale = ContentScale.Fit,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.graphicsLayer {
|
||||||
|
val scale = art?.circleScale() ?: 0.78f
|
||||||
|
scaleX = scale
|
||||||
|
scaleY = scale
|
||||||
|
if (art != null) {
|
||||||
|
translationX = (0.5f - art.centerX) * size.width * scale
|
||||||
|
translationY = (0.5f - art.centerY) * size.height * scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,462 +0,0 @@
|
|||||||
package cc.skysparkle.fogwave.ui.components
|
|
||||||
|
|
||||||
import androidx.compose.animation.core.FastOutSlowInEasing
|
|
||||||
import androidx.compose.animation.core.RepeatMode
|
|
||||||
import androidx.compose.animation.core.Spring
|
|
||||||
import androidx.compose.animation.core.animateFloat
|
|
||||||
import androidx.compose.animation.core.animateFloatAsState
|
|
||||||
import androidx.compose.animation.core.infiniteRepeatable
|
|
||||||
import androidx.compose.animation.core.rememberInfiniteTransition
|
|
||||||
import androidx.compose.animation.core.spring
|
|
||||||
import androidx.compose.animation.core.tween
|
|
||||||
import androidx.compose.foundation.LocalIndication
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
||||||
import androidx.compose.foundation.interaction.collectIsPressedAsState
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.Row
|
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
|
||||||
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.foundation.shape.CircleShape
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.getValue
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.draw.clip
|
|
||||||
import androidx.compose.ui.draw.shadow
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.graphics.Shadow
|
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
|
||||||
import androidx.compose.ui.layout.ContentScale
|
|
||||||
import androidx.compose.ui.platform.testTag
|
|
||||||
import androidx.compose.ui.semantics.Role
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
|
||||||
import androidx.compose.ui.unit.Dp
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import cc.skysparkle.fogwave.data.model.IconSizeStep
|
|
||||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
|
||||||
import cc.skysparkle.fogwave.data.model.ViewMode
|
|
||||||
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
|
||||||
import coil.compose.AsyncImage
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun LiveOnAirDot(modifier: Modifier = Modifier) {
|
|
||||||
val infiniteTransition = rememberInfiniteTransition(label = "pulse")
|
|
||||||
val scale by infiniteTransition.animateFloat(
|
|
||||||
initialValue = 0.8f,
|
|
||||||
targetValue = 1.25f,
|
|
||||||
animationSpec = infiniteRepeatable(
|
|
||||||
animation = tween(900, easing = FastOutSlowInEasing),
|
|
||||||
repeatMode = RepeatMode.Reverse
|
|
||||||
),
|
|
||||||
label = "live_pulse"
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = modifier
|
|
||||||
.size(7.dp)
|
|
||||||
.graphicsLayer {
|
|
||||||
scaleX = scale
|
|
||||||
scaleY = scale
|
|
||||||
}
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(LocalGeoColors.current.liveGreen)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
private val GridTextShadow = Shadow(color = Color.Black.copy(alpha = 0.55f), blurRadius = 8f)
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun StationItem(
|
|
||||||
station: RadioStation,
|
|
||||||
isCurrent: Boolean,
|
|
||||||
isPlaying: Boolean,
|
|
||||||
viewMode: ViewMode,
|
|
||||||
sizeStep: IconSizeStep,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
val interactionSource = remember { MutableInteractionSource() }
|
|
||||||
val pressed by interactionSource.collectIsPressedAsState()
|
|
||||||
val pressScale by animateFloatAsState(
|
|
||||||
targetValue = if (pressed) 0.96f else 1f,
|
|
||||||
animationSpec = spring(dampingRatio = 0.6f, stiffness = Spring.StiffnessMediumLow),
|
|
||||||
label = "station_press"
|
|
||||||
)
|
|
||||||
val cardModifier = modifier.graphicsLayer {
|
|
||||||
scaleX = pressScale
|
|
||||||
scaleY = pressScale
|
|
||||||
}
|
|
||||||
|
|
||||||
when (viewMode) {
|
|
||||||
ViewMode.ICONS -> {
|
|
||||||
StationIconsCard(
|
|
||||||
station = station,
|
|
||||||
isCurrent = isCurrent,
|
|
||||||
isPlaying = isPlaying,
|
|
||||||
sizeDp = sizeStep.sizeDp.dp,
|
|
||||||
onClick = onClick,
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
modifier = cardModifier
|
|
||||||
)
|
|
||||||
}
|
|
||||||
ViewMode.TILES -> {
|
|
||||||
StationTilesCard(
|
|
||||||
station = station,
|
|
||||||
isCurrent = isCurrent,
|
|
||||||
isPlaying = isPlaying,
|
|
||||||
sizeDp = (sizeStep.sizeDp * 0.7f).dp,
|
|
||||||
onClick = onClick,
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
modifier = cardModifier
|
|
||||||
)
|
|
||||||
}
|
|
||||||
ViewMode.LIST -> {
|
|
||||||
StationListRow(
|
|
||||||
station = station,
|
|
||||||
isCurrent = isCurrent,
|
|
||||||
isPlaying = isPlaying,
|
|
||||||
sizeDp = (sizeStep.sizeDp * 0.45f).coerceAtLeast(36f).dp,
|
|
||||||
onClick = onClick,
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
modifier = cardModifier
|
|
||||||
)
|
|
||||||
}
|
|
||||||
ViewMode.DETAILS -> {
|
|
||||||
StationDetailsRow(
|
|
||||||
station = station,
|
|
||||||
isCurrent = isCurrent,
|
|
||||||
isPlaying = isPlaying,
|
|
||||||
sizeDp = (sizeStep.sizeDp * 0.45f).coerceAtLeast(36f).dp,
|
|
||||||
onClick = onClick,
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
modifier = cardModifier
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun StationIconsCard(
|
|
||||||
station: RadioStation,
|
|
||||||
isCurrent: Boolean,
|
|
||||||
isPlaying: Boolean,
|
|
||||||
sizeDp: Dp,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
interactionSource: MutableInteractionSource,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = modifier
|
|
||||||
.width(sizeDp)
|
|
||||||
.clip(RoundedCornerShape(20.dp))
|
|
||||||
.clickable(
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
indication = LocalIndication.current,
|
|
||||||
role = Role.Button,
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
.padding(4.dp)
|
|
||||||
.testTag("station_${station.id}"),
|
|
||||||
horizontalAlignment = Alignment.Start
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.aspectRatio(1f)
|
|
||||||
.shadow(if (isCurrent) 4.dp else 1.dp, RoundedCornerShape(22.dp))
|
|
||||||
.clip(RoundedCornerShape(22.dp))
|
|
||||||
.background(stationTileColor(station))
|
|
||||||
.border(
|
|
||||||
width = if (isCurrent) 2.dp else 1.dp,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.primary else LocalGeoColors.current.outlineVariant,
|
|
||||||
shape = RoundedCornerShape(22.dp)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
AsyncImage(
|
|
||||||
model = station.iconResId,
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
|
||||||
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
|
||||||
) {
|
|
||||||
if (isCurrent && isPlaying) {
|
|
||||||
LiveOnAirDot()
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = station.name,
|
|
||||||
style = MaterialTheme.typography.titleSmall.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 14.5.sp,
|
|
||||||
lineHeight = 17.sp,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurface,
|
|
||||||
shadow = GridTextShadow
|
|
||||||
),
|
|
||||||
maxLines = 2,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(
|
|
||||||
text = stationDescription(station),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
color = LocalGeoColors.current.onSurface.copy(alpha = 0.82f),
|
|
||||||
shadow = GridTextShadow
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun StationTilesCard(
|
|
||||||
station: RadioStation,
|
|
||||||
isCurrent: Boolean,
|
|
||||||
isPlaying: Boolean,
|
|
||||||
sizeDp: Dp,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
interactionSource: MutableInteractionSource,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
modifier = modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(18.dp))
|
|
||||||
.background(if (isCurrent) LocalGeoColors.current.primaryContainer.copy(alpha = 0.7f) else LocalGeoColors.current.surfaceContainer.copy(alpha = 0.9f))
|
|
||||||
.border(
|
|
||||||
width = if (isCurrent) 1.5.dp else 1.dp,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.primary else LocalGeoColors.current.outlineVariant,
|
|
||||||
shape = RoundedCornerShape(18.dp)
|
|
||||||
)
|
|
||||||
.clickable(
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
indication = LocalIndication.current,
|
|
||||||
role = Role.Button,
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
.padding(10.dp)
|
|
||||||
.testTag("station_${station.id}"),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(sizeDp)
|
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(stationTileColor(station))
|
|
||||||
.border(0.8.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(14.dp))
|
|
||||||
) {
|
|
||||||
AsyncImage(
|
|
||||||
model = station.iconResId,
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
|
||||||
) {
|
|
||||||
if (isCurrent && isPlaying) {
|
|
||||||
LiveOnAirDot()
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = station.name,
|
|
||||||
style = MaterialTheme.typography.titleSmall.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 15.sp,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurface
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = stationDescription(station),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
fontSize = 12.sp,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun StationListRow(
|
|
||||||
station: RadioStation,
|
|
||||||
isCurrent: Boolean,
|
|
||||||
isPlaying: Boolean,
|
|
||||||
sizeDp: Dp,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
interactionSource: MutableInteractionSource,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
modifier = modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(if (isCurrent) LocalGeoColors.current.primaryContainer.copy(alpha = 0.6f) else Color.Transparent)
|
|
||||||
.clickable(
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
indication = LocalIndication.current,
|
|
||||||
role = Role.Button,
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
.padding(horizontal = 10.dp, vertical = 7.dp)
|
|
||||||
.testTag("station_${station.id}"),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(sizeDp)
|
|
||||||
.clip(RoundedCornerShape(10.dp))
|
|
||||||
.background(stationTileColor(station))
|
|
||||||
.border(0.8.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(10.dp))
|
|
||||||
) {
|
|
||||||
AsyncImage(
|
|
||||||
model = station.iconResId,
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
|
||||||
) {
|
|
||||||
if (isCurrent && isPlaying) {
|
|
||||||
LiveOnAirDot()
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = station.name,
|
|
||||||
style = MaterialTheme.typography.bodyMedium.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurface
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun StationDetailsRow(
|
|
||||||
station: RadioStation,
|
|
||||||
isCurrent: Boolean,
|
|
||||||
isPlaying: Boolean,
|
|
||||||
sizeDp: Dp,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
interactionSource: MutableInteractionSource,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
modifier = modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(if (isCurrent) LocalGeoColors.current.primaryContainer.copy(alpha = 0.6f) else Color.Transparent)
|
|
||||||
.border(
|
|
||||||
width = 0.8.dp,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.primary else LocalGeoColors.current.outlineVariant.copy(alpha = 0.6f),
|
|
||||||
shape = RoundedCornerShape(14.dp)
|
|
||||||
)
|
|
||||||
.clickable(
|
|
||||||
interactionSource = interactionSource,
|
|
||||||
indication = LocalIndication.current,
|
|
||||||
role = Role.Button,
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
.padding(horizontal = 10.dp, vertical = 8.dp)
|
|
||||||
.testTag("station_${station.id}"),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(sizeDp)
|
|
||||||
.clip(RoundedCornerShape(10.dp))
|
|
||||||
.background(stationTileColor(station))
|
|
||||||
.border(0.8.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(10.dp))
|
|
||||||
) {
|
|
||||||
AsyncImage(
|
|
||||||
model = station.iconResId,
|
|
||||||
contentDescription = null,
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.matchParentSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(modifier = Modifier.weight(1.3f)) {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
|
||||||
) {
|
|
||||||
if (isCurrent && isPlaying) {
|
|
||||||
LiveOnAirDot()
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = station.name,
|
|
||||||
style = MaterialTheme.typography.bodyMedium.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = if (isCurrent) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurface
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
text = stationDescription(station),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(
|
|
||||||
text = stationGenres(station),
|
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
color = LocalGeoColors.current.primary
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
modifier = Modifier.weight(0.9f)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.animation.animateColorAsState
|
||||||
|
import androidx.compose.animation.core.FastOutSlowInEasing
|
||||||
|
import androidx.compose.animation.core.RepeatMode
|
||||||
|
import androidx.compose.animation.core.animateFloat
|
||||||
|
import androidx.compose.animation.core.infiniteRepeatable
|
||||||
|
import androidx.compose.animation.core.rememberInfiniteTransition
|
||||||
|
import androidx.compose.animation.core.tween
|
||||||
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
import androidx.compose.ui.platform.testTag
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.Role
|
||||||
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import cc.skysparkle.fogwave.R
|
||||||
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
|
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun LiveOnAirDot(modifier: Modifier = Modifier, size: Dp = 7.dp) {
|
||||||
|
val infiniteTransition = rememberInfiniteTransition(label = "pulse")
|
||||||
|
val scale by infiniteTransition.animateFloat(
|
||||||
|
initialValue = 0.8f,
|
||||||
|
targetValue = 1.25f,
|
||||||
|
animationSpec = infiniteRepeatable(
|
||||||
|
animation = tween(900, easing = FastOutSlowInEasing),
|
||||||
|
repeatMode = RepeatMode.Reverse
|
||||||
|
),
|
||||||
|
label = "live_pulse"
|
||||||
|
)
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.size(size)
|
||||||
|
.graphicsLayer {
|
||||||
|
scaleX = scale
|
||||||
|
scaleY = scale
|
||||||
|
}
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(LocalGeoColors.current.liveRed)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Small red "● LIVE" label used above station names. */
|
||||||
|
@Composable
|
||||||
|
fun LiveLabel(active: Boolean, modifier: Modifier = Modifier) {
|
||||||
|
Row(
|
||||||
|
modifier = modifier,
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(5.dp)
|
||||||
|
) {
|
||||||
|
if (active) {
|
||||||
|
LiveOnAirDot(size = 6.dp)
|
||||||
|
} else {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.size(6.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(LocalGeoColors.current.outline)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.live_label),
|
||||||
|
style = MaterialTheme.typography.labelSmall.copy(
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
fontSize = 10.sp,
|
||||||
|
letterSpacing = 1.sp,
|
||||||
|
color = if (active) LocalGeoColors.current.liveRed else LocalGeoColors.current.outline
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Station logo on its tile color with rounded corners. */
|
||||||
|
@Composable
|
||||||
|
fun StationThumb(
|
||||||
|
station: RadioStation,
|
||||||
|
size: Dp,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
cornerRadius: Dp = 12.dp
|
||||||
|
) {
|
||||||
|
val art = rememberStationArt(station)
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.size(size)
|
||||||
|
.clip(RoundedCornerShape(cornerRadius))
|
||||||
|
.background(stationTileColor(station))
|
||||||
|
) {
|
||||||
|
Image(
|
||||||
|
painter = painterResource(id = station.iconResId),
|
||||||
|
contentDescription = null,
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
modifier = Modifier
|
||||||
|
.matchParentSize()
|
||||||
|
.graphicsLayer {
|
||||||
|
if (art != null) {
|
||||||
|
val scale = art.squareScale()
|
||||||
|
scaleX = scale
|
||||||
|
scaleY = scale
|
||||||
|
translationX = (0.5f - art.centerX) * this.size.width * scale
|
||||||
|
translationY = (0.5f - art.centerY) * this.size.height * scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A row of the station list: logo, name, description and a play / live indicator. */
|
||||||
|
@Composable
|
||||||
|
fun StationRow(
|
||||||
|
station: RadioStation,
|
||||||
|
isCurrent: Boolean,
|
||||||
|
isPlaying: Boolean,
|
||||||
|
onClick: () -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
subtitle: String? = null
|
||||||
|
) {
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
|
val bg by animateColorAsState(
|
||||||
|
targetValue = if (isCurrent) colors.surfaceContainerHigh else Color.Transparent,
|
||||||
|
label = "station_row_bg"
|
||||||
|
)
|
||||||
|
|
||||||
|
Row(
|
||||||
|
modifier = modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(RoundedCornerShape(16.dp))
|
||||||
|
.background(bg)
|
||||||
|
.clickable(role = Role.Button, onClick = onClick)
|
||||||
|
.padding(horizontal = 10.dp, vertical = 8.dp)
|
||||||
|
.testTag("station_${station.id}"),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(14.dp)
|
||||||
|
) {
|
||||||
|
StationThumb(station = station, size = 48.dp)
|
||||||
|
|
||||||
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
|
Text(
|
||||||
|
text = station.name,
|
||||||
|
style = MaterialTheme.typography.bodyLarge.copy(
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
fontSize = 15.sp,
|
||||||
|
letterSpacing = 0.sp,
|
||||||
|
color = if (isCurrent) colors.deepPurple else colors.onSurface
|
||||||
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = subtitle ?: stationDescription(station),
|
||||||
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
|
fontSize = 12.sp,
|
||||||
|
color = colors.onSurfaceVariant
|
||||||
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(36.dp),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
if (isCurrent && isPlaying) {
|
||||||
|
LiveBars(
|
||||||
|
active = true,
|
||||||
|
color = colors.primary,
|
||||||
|
modifier = Modifier.size(width = 22.dp, height = 16.dp)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
AppIcon(
|
||||||
|
resId = R.drawable.ic_play,
|
||||||
|
contentDescription = stringResource(R.string.play_content_desc),
|
||||||
|
tint = if (isCurrent) colors.primary else colors.onSurfaceVariant,
|
||||||
|
size = 18.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Section title such as "Stations", with an optional trailing count. */
|
||||||
|
@Composable
|
||||||
|
fun SectionHeader(title: String, modifier: Modifier = Modifier, trailing: String? = null) {
|
||||||
|
Row(
|
||||||
|
modifier = modifier.fillMaxWidth(),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = title,
|
||||||
|
style = MaterialTheme.typography.titleMedium.copy(
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
fontSize = 17.sp,
|
||||||
|
letterSpacing = (-0.2).sp,
|
||||||
|
color = LocalGeoColors.current.onSurface
|
||||||
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
|
if (trailing != null) {
|
||||||
|
Text(
|
||||||
|
text = trailing,
|
||||||
|
style = MaterialTheme.typography.labelMedium.copy(
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
color = LocalGeoColors.current.onSurfaceVariant
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,82 +1,173 @@
|
|||||||
package cc.skysparkle.fogwave.ui.components
|
package cc.skysparkle.fogwave.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.animation.AnimatedContent
|
||||||
|
import androidx.compose.animation.core.tween
|
||||||
|
import androidx.compose.animation.fadeIn
|
||||||
|
import androidx.compose.animation.fadeOut
|
||||||
|
import androidx.compose.animation.togetherWith
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.statusBarsPadding
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.foundation.text.BasicTextField
|
||||||
|
import androidx.compose.foundation.text.KeyboardActions
|
||||||
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
|
import androidx.compose.ui.focus.focusRequester
|
||||||
|
import androidx.compose.ui.graphics.SolidColor
|
||||||
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||||
import androidx.compose.ui.platform.testTag
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.semantics.heading
|
import androidx.compose.ui.semantics.heading
|
||||||
import androidx.compose.ui.semantics.semantics
|
import androidx.compose.ui.semantics.semantics
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import cc.skysparkle.fogwave.R
|
import cc.skysparkle.fogwave.R
|
||||||
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header with the logo on the left, the app name centered and a search action on the right.
|
||||||
|
* While searching, the title turns into a search field.
|
||||||
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun TopBrandBar(modifier: Modifier = Modifier) {
|
fun TopBrandBar(
|
||||||
Box(
|
modifier: Modifier = Modifier,
|
||||||
|
showSearch: Boolean = false,
|
||||||
|
isSearchOpen: Boolean = false,
|
||||||
|
query: String = "",
|
||||||
|
onQueryChange: (String) -> Unit = {},
|
||||||
|
onOpenSearch: () -> Unit = {},
|
||||||
|
onCloseSearch: () -> Unit = {}
|
||||||
|
) {
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
|
|
||||||
|
Row(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(LocalGeoColors.current.surfaceContainer.copy(alpha = 0.92f))
|
|
||||||
.statusBarsPadding()
|
.statusBarsPadding()
|
||||||
.padding(horizontal = 20.dp, vertical = 12.dp)
|
.padding(start = 20.dp, end = 10.dp, top = 8.dp, bottom = 8.dp)
|
||||||
|
.height(48.dp)
|
||||||
|
.testTag("top_brand_bar"),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(10.dp)
|
||||||
) {
|
) {
|
||||||
Row(
|
AppIcon(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
resId = R.drawable.ic_fogwave_logo,
|
||||||
horizontalArrangement = Arrangement.spacedBy(14.dp),
|
contentDescription = stringResource(R.string.fogwave_logo_content_desc),
|
||||||
modifier = Modifier
|
size = 30.dp
|
||||||
.fillMaxWidth()
|
)
|
||||||
.testTag("top_brand_bar")
|
|
||||||
) {
|
Box(modifier = Modifier.weight(1f), contentAlignment = Alignment.Center) {
|
||||||
Box(
|
AnimatedContent(
|
||||||
|
targetState = showSearch && isSearchOpen,
|
||||||
|
transitionSpec = { fadeIn(tween(180)) togetherWith fadeOut(tween(120)) },
|
||||||
|
label = "header_search"
|
||||||
|
) { searching ->
|
||||||
|
if (searching) {
|
||||||
|
SearchField(query = query, onQueryChange = onQueryChange)
|
||||||
|
} else {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.app_name),
|
||||||
|
style = MaterialTheme.typography.titleMedium.copy(
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
fontSize = 17.sp,
|
||||||
|
letterSpacing = 0.sp,
|
||||||
|
color = colors.deepPurple
|
||||||
|
),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.semantics { heading() },
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showSearch) {
|
||||||
|
IconButton(
|
||||||
|
onClick = if (isSearchOpen) onCloseSearch else onOpenSearch,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(40.dp)
|
.size(40.dp)
|
||||||
.clip(RoundedCornerShape(12.dp)),
|
.testTag("search_toggle")
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
) {
|
||||||
AppIcon(
|
AppIcon(
|
||||||
resId = R.drawable.ic_fogwave_logo,
|
resId = if (isSearchOpen) R.drawable.ic_close else R.drawable.ic_search,
|
||||||
size = 34.dp
|
contentDescription = stringResource(
|
||||||
)
|
if (isSearchOpen) R.string.close_content_desc else R.string.search_content_desc
|
||||||
}
|
|
||||||
|
|
||||||
Column(
|
|
||||||
verticalArrangement = Arrangement.Center
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.app_name),
|
|
||||||
style = MaterialTheme.typography.titleMedium.copy(
|
|
||||||
fontWeight = FontWeight.SemiBold,
|
|
||||||
fontSize = 20.sp,
|
|
||||||
letterSpacing = (-0.4).sp,
|
|
||||||
color = LocalGeoColors.current.deepPurple
|
|
||||||
),
|
),
|
||||||
modifier = Modifier.semantics { heading() }
|
tint = colors.onSurface,
|
||||||
)
|
size = 22.dp
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.app_subtitle),
|
|
||||||
style = MaterialTheme.typography.labelSmall.copy(
|
|
||||||
fontWeight = FontWeight.Medium,
|
|
||||||
fontSize = 11.5.sp,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
letterSpacing = 0.2.sp
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Box(modifier = Modifier.size(40.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun SearchField(query: String, onQueryChange: (String) -> Unit) {
|
||||||
|
val colors = LocalGeoColors.current
|
||||||
|
val focusRequester = remember { FocusRequester() }
|
||||||
|
val keyboard = LocalSoftwareKeyboardController.current
|
||||||
|
|
||||||
|
LaunchedEffect(Unit) { focusRequester.requestFocus() }
|
||||||
|
|
||||||
|
BasicTextField(
|
||||||
|
value = query,
|
||||||
|
onValueChange = onQueryChange,
|
||||||
|
singleLine = true,
|
||||||
|
textStyle = MaterialTheme.typography.bodyLarge.copy(color = colors.onSurface, fontSize = 15.sp),
|
||||||
|
cursorBrush = SolidColor(colors.primary),
|
||||||
|
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
||||||
|
keyboardActions = KeyboardActions(onSearch = { keyboard?.hide() }),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.focusRequester(focusRequester)
|
||||||
|
.testTag("search_field"),
|
||||||
|
decorationBox = { inner ->
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(colors.surfaceContainerHigh)
|
||||||
|
.padding(horizontal = 14.dp, vertical = 10.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(10.dp)
|
||||||
|
) {
|
||||||
|
AppIcon(resId = R.drawable.ic_search, tint = colors.onSurfaceVariant, size = 18.dp)
|
||||||
|
Box(modifier = Modifier.weight(1f)) {
|
||||||
|
if (query.isEmpty()) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.search_hint),
|
||||||
|
style = MaterialTheme.typography.bodyLarge.copy(
|
||||||
|
color = colors.onSurfaceVariant,
|
||||||
|
fontSize = 15.sp
|
||||||
|
),
|
||||||
|
maxLines = 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
inner()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,287 +0,0 @@
|
|||||||
package cc.skysparkle.fogwave.ui.components
|
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
|
||||||
import androidx.compose.animation.animateColorAsState
|
|
||||||
import androidx.compose.animation.core.FastOutLinearInEasing
|
|
||||||
import androidx.compose.animation.core.Spring
|
|
||||||
import androidx.compose.animation.core.spring
|
|
||||||
import androidx.compose.animation.core.tween
|
|
||||||
import androidx.compose.animation.expandVertically
|
|
||||||
import androidx.compose.animation.fadeIn
|
|
||||||
import androidx.compose.animation.fadeOut
|
|
||||||
import androidx.compose.animation.scaleIn
|
|
||||||
import androidx.compose.animation.scaleOut
|
|
||||||
import androidx.compose.animation.shrinkVertically
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.Row
|
|
||||||
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.selection.selectable
|
|
||||||
import androidx.compose.foundation.selection.selectableGroup
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Slider
|
|
||||||
import androidx.compose.material3.SliderDefaults
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.getValue
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.draw.clip
|
|
||||||
import androidx.compose.ui.draw.shadow
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.graphics.TransformOrigin
|
|
||||||
import androidx.compose.ui.platform.testTag
|
|
||||||
import androidx.compose.ui.res.stringResource
|
|
||||||
import androidx.compose.ui.semantics.Role
|
|
||||||
import androidx.compose.ui.semantics.contentDescription
|
|
||||||
import androidx.compose.ui.semantics.semantics
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import cc.skysparkle.fogwave.R
|
|
||||||
import cc.skysparkle.fogwave.data.model.IconSizeStep
|
|
||||||
import cc.skysparkle.fogwave.data.model.ViewMode
|
|
||||||
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
|
||||||
import kotlin.math.roundToInt
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun StationsToolbar(
|
|
||||||
title: String,
|
|
||||||
isOpen: Boolean,
|
|
||||||
onToggleOpen: () -> Unit,
|
|
||||||
viewMode: ViewMode,
|
|
||||||
onSelectViewMode: (ViewMode) -> Unit,
|
|
||||||
sizeStep: IconSizeStep,
|
|
||||||
onSelectSizeStep: (IconSizeStep) -> Unit,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = 20.dp, vertical = 6.dp)
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = title,
|
|
||||||
style = MaterialTheme.typography.titleLarge.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 22.sp,
|
|
||||||
letterSpacing = (-0.4).sp,
|
|
||||||
color = LocalGeoColors.current.deepPurple
|
|
||||||
),
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
modifier = Modifier
|
|
||||||
.weight(1f)
|
|
||||||
.padding(end = 12.dp)
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(38.dp)
|
|
||||||
.clip(RoundedCornerShape(12.dp))
|
|
||||||
.background(if (isOpen) LocalGeoColors.current.primaryContainer else LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(12.dp))
|
|
||||||
.clickable(role = Role.Button) { onToggleOpen() }
|
|
||||||
.testTag("view_options_trigger"),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
AppIcon(
|
|
||||||
resId = R.drawable.ic_table,
|
|
||||||
contentDescription = stringResource(R.string.view_mode_content_desc),
|
|
||||||
tint = if (isOpen) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
size = 19.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimatedVisibility(
|
|
||||||
visible = isOpen,
|
|
||||||
enter = expandVertically(
|
|
||||||
animationSpec = spring(dampingRatio = 0.85f, stiffness = Spring.StiffnessMediumLow),
|
|
||||||
expandFrom = Alignment.Top
|
|
||||||
) + fadeIn(tween(200)) + scaleIn(
|
|
||||||
initialScale = 0.96f,
|
|
||||||
transformOrigin = TransformOrigin(1f, 0f),
|
|
||||||
animationSpec = spring(dampingRatio = 0.85f, stiffness = Spring.StiffnessMediumLow)
|
|
||||||
),
|
|
||||||
exit = shrinkVertically(
|
|
||||||
animationSpec = tween(180, easing = FastOutLinearInEasing),
|
|
||||||
shrinkTowards = Alignment.Top
|
|
||||||
) + fadeOut(tween(140)) + scaleOut(
|
|
||||||
targetScale = 0.96f,
|
|
||||||
transformOrigin = TransformOrigin(1f, 0f),
|
|
||||||
animationSpec = tween(180)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(top = 10.dp)
|
|
||||||
.fillMaxWidth()
|
|
||||||
.shadow(4.dp, RoundedCornerShape(24.dp))
|
|
||||||
.clip(RoundedCornerShape(24.dp))
|
|
||||||
.background(LocalGeoColors.current.surfaceContainer)
|
|
||||||
.border(1.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(24.dp))
|
|
||||||
.padding(16.dp),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(14.dp)
|
|
||||||
) {
|
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.display_mode_label),
|
|
||||||
style = MaterialTheme.typography.labelSmall.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 10.5.sp,
|
|
||||||
letterSpacing = 0.8.sp,
|
|
||||||
color = LocalGeoColors.current.primary
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
Row(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(12.dp))
|
|
||||||
.background(LocalGeoColors.current.surface)
|
|
||||||
.border(0.8.dp, LocalGeoColors.current.outlineVariant, RoundedCornerShape(12.dp))
|
|
||||||
.padding(3.dp)
|
|
||||||
.selectableGroup(),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(2.dp)
|
|
||||||
) {
|
|
||||||
ViewModeSegment(
|
|
||||||
title = stringResource(R.string.view_mode_list),
|
|
||||||
icon = R.drawable.ic_list,
|
|
||||||
isSelected = viewMode == ViewMode.LIST,
|
|
||||||
onClick = { onSelectViewMode(ViewMode.LIST) },
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
|
||||||
ViewModeSegment(
|
|
||||||
title = stringResource(R.string.view_mode_table),
|
|
||||||
icon = R.drawable.ic_layout_columns,
|
|
||||||
isSelected = viewMode == ViewMode.DETAILS,
|
|
||||||
onClick = { onSelectViewMode(ViewMode.DETAILS) },
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
|
||||||
ViewModeSegment(
|
|
||||||
title = stringResource(R.string.view_mode_tiles),
|
|
||||||
icon = R.drawable.ic_layout_rows,
|
|
||||||
isSelected = viewMode == ViewMode.TILES,
|
|
||||||
onClick = { onSelectViewMode(ViewMode.TILES) },
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
|
||||||
ViewModeSegment(
|
|
||||||
title = stringResource(R.string.view_mode_icons),
|
|
||||||
icon = R.drawable.ic_grid,
|
|
||||||
isSelected = viewMode == ViewMode.ICONS,
|
|
||||||
onClick = { onSelectViewMode(ViewMode.ICONS) },
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.size_label),
|
|
||||||
style = MaterialTheme.typography.labelSmall.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 10.5.sp,
|
|
||||||
letterSpacing = 0.8.sp,
|
|
||||||
color = LocalGeoColors.current.primary
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
Row(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = "S",
|
|
||||||
style = MaterialTheme.typography.labelMedium.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
val steps = IconSizeStep.entries
|
|
||||||
val currentIndex = steps.indexOf(sizeStep).toFloat()
|
|
||||||
val sizeLabel = stringResource(R.string.size_label)
|
|
||||||
|
|
||||||
Slider(
|
|
||||||
value = currentIndex,
|
|
||||||
onValueChange = { indexFloat ->
|
|
||||||
val step = steps[indexFloat.roundToInt().coerceIn(0, steps.size - 1)]
|
|
||||||
// The slider reports every drag frame; only persist real changes.
|
|
||||||
if (step != sizeStep) onSelectSizeStep(step)
|
|
||||||
},
|
|
||||||
valueRange = 0f..(steps.size - 1).toFloat(),
|
|
||||||
steps = steps.size - 2,
|
|
||||||
colors = SliderDefaults.colors(
|
|
||||||
thumbColor = LocalGeoColors.current.primary,
|
|
||||||
activeTrackColor = LocalGeoColors.current.primary,
|
|
||||||
inactiveTrackColor = LocalGeoColors.current.outlineVariant
|
|
||||||
),
|
|
||||||
modifier = Modifier
|
|
||||||
.weight(1f)
|
|
||||||
.semantics { contentDescription = sizeLabel }
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(
|
|
||||||
text = "XL",
|
|
||||||
style = MaterialTheme.typography.labelMedium.copy(
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = LocalGeoColors.current.onSurfaceVariant
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun ViewModeSegment(
|
|
||||||
title: String,
|
|
||||||
icon: Int,
|
|
||||||
isSelected: Boolean,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
val bg by animateColorAsState(
|
|
||||||
targetValue = if (isSelected) LocalGeoColors.current.primaryContainer else Color.Transparent,
|
|
||||||
animationSpec = tween(220),
|
|
||||||
label = "segment_bg"
|
|
||||||
)
|
|
||||||
val tint by animateColorAsState(
|
|
||||||
targetValue = if (isSelected) LocalGeoColors.current.deepPurple else LocalGeoColors.current.onSurfaceVariant,
|
|
||||||
animationSpec = tween(220),
|
|
||||||
label = "segment_tint"
|
|
||||||
)
|
|
||||||
Box(
|
|
||||||
modifier = modifier
|
|
||||||
.height(34.dp)
|
|
||||||
.clip(RoundedCornerShape(9.dp))
|
|
||||||
.background(bg)
|
|
||||||
.selectable(selected = isSelected, role = Role.RadioButton, onClick = onClick),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
AppIcon(
|
|
||||||
resId = icon,
|
|
||||||
contentDescription = title,
|
|
||||||
tint = tint,
|
|
||||||
size = 18.dp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,7 @@ package cc.skysparkle.fogwave.ui.screens
|
|||||||
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.animation.AnimatedContent
|
import androidx.compose.animation.AnimatedContent
|
||||||
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.animation.ExitTransition
|
import androidx.compose.animation.ExitTransition
|
||||||
import androidx.compose.animation.ExperimentalAnimationApi
|
import androidx.compose.animation.ExperimentalAnimationApi
|
||||||
@@ -12,51 +13,67 @@ import androidx.compose.animation.core.spring
|
|||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.animation.fadeIn
|
import androidx.compose.animation.fadeIn
|
||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
import androidx.compose.animation.scaleIn
|
|
||||||
import androidx.compose.animation.slideInHorizontally
|
import androidx.compose.animation.slideInHorizontally
|
||||||
import androidx.compose.animation.slideInVertically
|
import androidx.compose.animation.slideInVertically
|
||||||
import androidx.compose.animation.slideOutHorizontally
|
import androidx.compose.animation.slideOutHorizontally
|
||||||
import androidx.compose.animation.slideOutVertically
|
import androidx.compose.animation.slideOutVertically
|
||||||
import androidx.compose.animation.togetherWith
|
import androidx.compose.animation.togetherWith
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.LazyListState
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.layout.onGloballyPositioned
|
import androidx.compose.ui.layout.onGloballyPositioned
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
|
import androidx.compose.ui.res.pluralStringResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import cc.skysparkle.fogwave.R
|
import cc.skysparkle.fogwave.R
|
||||||
import cc.skysparkle.fogwave.data.model.AppTab
|
import cc.skysparkle.fogwave.data.model.AppTab
|
||||||
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
import cc.skysparkle.fogwave.player.PlayerState
|
import cc.skysparkle.fogwave.player.PlayerState
|
||||||
import cc.skysparkle.fogwave.ui.components.AboutPanel
|
import cc.skysparkle.fogwave.ui.components.AboutPanel
|
||||||
import cc.skysparkle.fogwave.ui.components.BatteryOptimizationDialog
|
import cc.skysparkle.fogwave.ui.components.BatteryOptimizationDialog
|
||||||
import cc.skysparkle.fogwave.ui.components.EqualizerSheet
|
import cc.skysparkle.fogwave.ui.components.EqualizerSheet
|
||||||
import cc.skysparkle.fogwave.ui.components.FavoritesPanel
|
import cc.skysparkle.fogwave.ui.components.FavoritesPanel
|
||||||
|
import cc.skysparkle.fogwave.ui.components.HomeBackdrop
|
||||||
import cc.skysparkle.fogwave.ui.components.MiniPlayer
|
import cc.skysparkle.fogwave.ui.components.MiniPlayer
|
||||||
import cc.skysparkle.fogwave.ui.components.MistyMountainBackground
|
|
||||||
import cc.skysparkle.fogwave.ui.components.NavigationTabs
|
import cc.skysparkle.fogwave.ui.components.NavigationTabs
|
||||||
import cc.skysparkle.fogwave.ui.components.NowPlayingSheet
|
import cc.skysparkle.fogwave.ui.components.NowPlayingSheet
|
||||||
import cc.skysparkle.fogwave.ui.components.StationCollection
|
import cc.skysparkle.fogwave.ui.components.SectionHeader
|
||||||
import cc.skysparkle.fogwave.ui.components.StationsToolbar
|
import cc.skysparkle.fogwave.ui.components.StationRow
|
||||||
import cc.skysparkle.fogwave.ui.components.TopBrandBar
|
import cc.skysparkle.fogwave.ui.components.TopBrandBar
|
||||||
|
import cc.skysparkle.fogwave.ui.components.accentOr
|
||||||
|
import cc.skysparkle.fogwave.ui.components.rememberStationArt
|
||||||
|
import cc.skysparkle.fogwave.ui.components.stationDescription
|
||||||
|
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||||
import cc.skysparkle.fogwave.ui.viewmodel.RadioViewModel
|
import cc.skysparkle.fogwave.ui.viewmodel.RadioViewModel
|
||||||
|
|
||||||
@OptIn(ExperimentalAnimationApi::class)
|
@OptIn(ExperimentalAnimationApi::class)
|
||||||
@@ -67,6 +84,9 @@ fun HomeScreen(
|
|||||||
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
|
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
|
||||||
val isPlaying = uiState.playerState is PlayerState.Playing
|
val isPlaying = uiState.playerState is PlayerState.Playing
|
||||||
|
|
||||||
|
var isSearchOpen by rememberSaveable { mutableStateOf(false) }
|
||||||
|
var query by rememberSaveable { mutableStateOf("") }
|
||||||
|
|
||||||
val favoriteStations = remember(uiState.stations, uiState.favorites) {
|
val favoriteStations = remember(uiState.stations, uiState.favorites) {
|
||||||
uiState.stations.filter { it.id in uiState.favorites }
|
uiState.stations.filter { it.id in uiState.favorites }
|
||||||
}
|
}
|
||||||
@@ -77,11 +97,16 @@ fun HomeScreen(
|
|||||||
uiState.recents.filter { it.id != uiState.currentStation?.id }
|
uiState.recents.filter { it.id != uiState.currentStation?.id }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val closeSearch = {
|
||||||
|
isSearchOpen = false
|
||||||
|
query = ""
|
||||||
|
}
|
||||||
|
|
||||||
BackHandler(enabled = uiState.isEqualizerPopOpen) { viewModel.closeEqualizerPop() }
|
BackHandler(enabled = uiState.isEqualizerPopOpen) { viewModel.closeEqualizerPop() }
|
||||||
BackHandler(enabled = uiState.isNowPlayingOpen && !uiState.isEqualizerPopOpen) { viewModel.closeNowPlaying() }
|
BackHandler(enabled = uiState.isNowPlayingOpen && !uiState.isEqualizerPopOpen) { viewModel.closeNowPlaying() }
|
||||||
BackHandler(enabled = uiState.isViewPopOpen && !uiState.isNowPlayingOpen) { viewModel.closeViewPop() }
|
BackHandler(enabled = isSearchOpen && !uiState.isNowPlayingOpen) { closeSearch() }
|
||||||
BackHandler(
|
BackHandler(
|
||||||
enabled = uiState.selectedTab != AppTab.RADIO && !uiState.isNowPlayingOpen && !uiState.isViewPopOpen
|
enabled = uiState.selectedTab != AppTab.RADIO && !uiState.isNowPlayingOpen && !isSearchOpen
|
||||||
) { viewModel.setSelectedTab(AppTab.RADIO) }
|
) { viewModel.setSelectedTab(AppTab.RADIO) }
|
||||||
val showBatteryOptimizationPrompt by viewModel.showBatteryOptimizationPrompt.collectAsStateWithLifecycle()
|
val showBatteryOptimizationPrompt by viewModel.showBatteryOptimizationPrompt.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
@@ -89,17 +114,44 @@ fun HomeScreen(
|
|||||||
BatteryOptimizationDialog(onDismiss = { viewModel.dismissBatteryOptimizationPrompt() })
|
BatteryOptimizationDialog(onDismiss = { viewModel.dismissBatteryOptimizationPrompt() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val radioListState = rememberLazyListState()
|
||||||
|
val accent by animateColorAsState(
|
||||||
|
targetValue = uiState.currentStation?.let { rememberStationArt(it) }.accentOr(LocalGeoColors.current.accentLavender),
|
||||||
|
animationSpec = tween(700),
|
||||||
|
label = "home_accent"
|
||||||
|
)
|
||||||
|
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
var dockHeight by remember { mutableStateOf(140.dp) }
|
var dockHeight by remember { mutableStateOf(160.dp) }
|
||||||
val scrollBottomPadding = dockHeight + 16.dp
|
val scrollBottomPadding = dockHeight + 16.dp
|
||||||
|
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
Box(
|
||||||
MistyMountainBackground()
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.background(LocalGeoColors.current.background)
|
||||||
|
) {
|
||||||
|
HomeBackdrop(
|
||||||
|
tint = accent,
|
||||||
|
visibility = {
|
||||||
|
if (uiState.selectedTab != AppTab.RADIO) {
|
||||||
|
0.55f
|
||||||
|
} else if (radioListState.firstVisibleItemIndex > 0) {
|
||||||
|
0.3f
|
||||||
|
} else {
|
||||||
|
1f - radioListState.firstVisibleItemScrollOffset / with(density) { 420.dp.toPx() } * 0.7f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Column(
|
Column(modifier = Modifier.fillMaxSize()) {
|
||||||
modifier = Modifier.fillMaxSize()
|
TopBrandBar(
|
||||||
) {
|
showSearch = uiState.selectedTab == AppTab.RADIO,
|
||||||
TopBrandBar()
|
isSearchOpen = isSearchOpen,
|
||||||
|
query = query,
|
||||||
|
onQueryChange = { query = it },
|
||||||
|
onOpenSearch = { isSearchOpen = true },
|
||||||
|
onCloseSearch = closeSearch
|
||||||
|
)
|
||||||
|
|
||||||
Box(modifier = Modifier.weight(1f)) {
|
Box(modifier = Modifier.weight(1f)) {
|
||||||
AnimatedContent(
|
AnimatedContent(
|
||||||
@@ -116,73 +168,33 @@ fun HomeScreen(
|
|||||||
label = "tabs"
|
label = "tabs"
|
||||||
) { tab ->
|
) { tab ->
|
||||||
when (tab) {
|
when (tab) {
|
||||||
AppTab.RADIO, AppTab.FAVORITES -> {
|
AppTab.RADIO -> RadioTab(
|
||||||
val isFavorites = tab == AppTab.FAVORITES
|
listState = radioListState,
|
||||||
Column(modifier = Modifier.fillMaxSize()) {
|
stations = uiState.stations,
|
||||||
StationsToolbar(
|
currentStation = uiState.currentStation,
|
||||||
title = stringResource(
|
isPlaying = isPlaying,
|
||||||
if (isFavorites) R.string.favorite_stations_title else R.string.stations_title
|
query = query.trim(),
|
||||||
),
|
onSelectStation = { viewModel.onStationClick(it) },
|
||||||
isOpen = uiState.isViewPopOpen,
|
bottomContentPadding = scrollBottomPadding
|
||||||
onToggleOpen = { viewModel.toggleViewPop() },
|
)
|
||||||
viewMode = uiState.viewMode,
|
|
||||||
onSelectViewMode = { viewModel.setViewMode(it) },
|
|
||||||
sizeStep = uiState.sizeStep,
|
|
||||||
onSelectSizeStep = { viewModel.setSizeStep(it) }
|
|
||||||
)
|
|
||||||
|
|
||||||
Box(modifier = Modifier.weight(1f)) {
|
AppTab.FAVORITES -> FavoritesPanel(
|
||||||
AnimatedContent(
|
favorites = favoriteStations,
|
||||||
targetState = uiState.viewMode,
|
currentStation = uiState.currentStation,
|
||||||
transitionSpec = {
|
isPlaying = isPlaying,
|
||||||
(fadeIn(tween(220, delayMillis = 60)) +
|
onSelectStation = { viewModel.onStationClick(it) },
|
||||||
scaleIn(initialScale = 0.985f, animationSpec = tween(260)))
|
onBrowseStations = { viewModel.setSelectedTab(AppTab.RADIO) },
|
||||||
.togetherWith(fadeOut(tween(120)))
|
bottomContentPadding = scrollBottomPadding,
|
||||||
},
|
modifier = Modifier.fillMaxSize()
|
||||||
label = "view_mode"
|
)
|
||||||
) { mode ->
|
|
||||||
if (isFavorites) {
|
|
||||||
FavoritesPanel(
|
|
||||||
favorites = favoriteStations,
|
|
||||||
currentStation = uiState.currentStation,
|
|
||||||
isPlaying = isPlaying,
|
|
||||||
viewMode = mode,
|
|
||||||
sizeStep = uiState.sizeStep,
|
|
||||||
onSelectStation = { viewModel.onStationClick(it) },
|
|
||||||
onBrowseStations = { viewModel.setSelectedTab(AppTab.RADIO) },
|
|
||||||
bottomContentPadding = scrollBottomPadding,
|
|
||||||
modifier = Modifier.fillMaxSize()
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
StationCollection(
|
|
||||||
stations = uiState.stations,
|
|
||||||
currentStation = uiState.currentStation,
|
|
||||||
isPlaying = isPlaying,
|
|
||||||
viewMode = mode,
|
|
||||||
sizeStep = uiState.sizeStep,
|
|
||||||
onSelectStation = { viewModel.onStationClick(it) },
|
|
||||||
bottomContentPadding = scrollBottomPadding,
|
|
||||||
modifier = Modifier.fillMaxSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PopoverScrim(
|
|
||||||
visible = uiState.isViewPopOpen,
|
|
||||||
onDismiss = { viewModel.closeViewPop() }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AppTab.ABOUT -> {
|
AppTab.ABOUT -> Column(
|
||||||
Column(
|
modifier = Modifier
|
||||||
modifier = Modifier
|
.fillMaxSize()
|
||||||
.fillMaxSize()
|
.verticalScroll(rememberScrollState())
|
||||||
.verticalScroll(rememberScrollState())
|
.padding(bottom = scrollBottomPadding)
|
||||||
.padding(bottom = scrollBottomPadding)
|
) {
|
||||||
) {
|
AboutPanel()
|
||||||
AboutPanel()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,17 +212,19 @@ fun HomeScreen(
|
|||||||
dockHeight = measured
|
dockHeight = measured
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Rows (and the current station's highlight) fade out under the dock
|
||||||
|
// instead of peeking through the gaps around the mini player and tabs.
|
||||||
|
.background(
|
||||||
|
Brush.verticalGradient(
|
||||||
|
0f to Color.Transparent,
|
||||||
|
0.22f to LocalGeoColors.current.background.copy(alpha = 0.94f),
|
||||||
|
1f to LocalGeoColors.current.background
|
||||||
|
)
|
||||||
|
)
|
||||||
// Insets live on the dock itself so the tabs stay clear of the gesture bar
|
// Insets live on the dock itself so the tabs stay clear of the gesture bar
|
||||||
// even when the mini player is swiped away.
|
// even when the mini player is swiped away.
|
||||||
.navigationBarsPadding()
|
.navigationBarsPadding()
|
||||||
) {
|
) {
|
||||||
NavigationTabs(
|
|
||||||
selectedTab = uiState.selectedTab,
|
|
||||||
favoritesCount = uiState.unseenFavoritesCount,
|
|
||||||
onTabSelected = { viewModel.setSelectedTab(it) },
|
|
||||||
modifier = Modifier.padding(horizontal = 20.dp, vertical = 6.dp)
|
|
||||||
)
|
|
||||||
|
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = !uiState.isMiniPlayerHidden,
|
visible = !uiState.isMiniPlayerHidden,
|
||||||
enter = fadeIn() + slideInVertically(initialOffsetY = { it }),
|
enter = fadeIn() + slideInVertically(initialOffsetY = { it }),
|
||||||
@@ -219,13 +233,23 @@ fun HomeScreen(
|
|||||||
MiniPlayer(
|
MiniPlayer(
|
||||||
station = uiState.currentStation,
|
station = uiState.currentStation,
|
||||||
playerState = uiState.playerState,
|
playerState = uiState.playerState,
|
||||||
|
trackTitle = uiState.nowPlayingTitle,
|
||||||
onTogglePlay = { viewModel.togglePlay() },
|
onTogglePlay = { viewModel.togglePlay() },
|
||||||
onPrevious = { viewModel.previousStation() },
|
|
||||||
onNext = { viewModel.nextStation() },
|
onNext = { viewModel.nextStation() },
|
||||||
onOpenNowPlaying = { viewModel.openNowPlaying() },
|
onOpenNowPlaying = { viewModel.openNowPlaying() },
|
||||||
onHide = { viewModel.hideMiniPlayer() }
|
onHide = { viewModel.hideMiniPlayer() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NavigationTabs(
|
||||||
|
selectedTab = uiState.selectedTab,
|
||||||
|
favoritesCount = uiState.unseenFavoritesCount,
|
||||||
|
onTabSelected = {
|
||||||
|
closeSearch()
|
||||||
|
viewModel.setSelectedTab(it)
|
||||||
|
},
|
||||||
|
modifier = Modifier.padding(horizontal = 20.dp, vertical = 6.dp)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
@@ -237,6 +261,7 @@ fun HomeScreen(
|
|||||||
NowPlayingSheet(
|
NowPlayingSheet(
|
||||||
station = uiState.currentStation,
|
station = uiState.currentStation,
|
||||||
playerState = uiState.playerState,
|
playerState = uiState.playerState,
|
||||||
|
trackTitle = uiState.nowPlayingTitle,
|
||||||
isFavorite = isCurFav,
|
isFavorite = isCurFav,
|
||||||
onToggleFavorite = { viewModel.toggleFavorite() },
|
onToggleFavorite = { viewModel.toggleFavorite() },
|
||||||
onTogglePlay = { viewModel.togglePlay() },
|
onTogglePlay = { viewModel.togglePlay() },
|
||||||
@@ -284,22 +309,69 @@ fun HomeScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Station list, filtered by the search query. */
|
||||||
@Composable
|
@Composable
|
||||||
private fun PopoverScrim(visible: Boolean, onDismiss: () -> Unit) {
|
private fun RadioTab(
|
||||||
AnimatedVisibility(
|
listState: LazyListState,
|
||||||
visible = visible,
|
stations: List<RadioStation>,
|
||||||
enter = fadeIn(tween(200)),
|
currentStation: RadioStation?,
|
||||||
exit = fadeOut(tween(160))
|
isPlaying: Boolean,
|
||||||
|
query: String,
|
||||||
|
onSelectStation: (RadioStation) -> Unit,
|
||||||
|
bottomContentPadding: Dp
|
||||||
|
) {
|
||||||
|
val descriptions = stations.associate { it.id to stationDescription(it) }
|
||||||
|
val visible = remember(stations, query, descriptions) {
|
||||||
|
stations.filter { station ->
|
||||||
|
query.isEmpty() ||
|
||||||
|
station.name.contains(query, ignoreCase = true) ||
|
||||||
|
descriptions[station.id].orEmpty().contains(query, ignoreCase = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyColumn(
|
||||||
|
state = listState,
|
||||||
|
contentPadding = PaddingValues(top = 12.dp, bottom = bottomContentPadding),
|
||||||
|
modifier = Modifier.fillMaxSize()
|
||||||
) {
|
) {
|
||||||
Box(
|
item(key = "header") {
|
||||||
modifier = Modifier
|
SectionHeader(
|
||||||
.fillMaxSize()
|
title = stringResource(
|
||||||
.background(Color.Black.copy(alpha = 0.38f))
|
if (query.isNotEmpty()) R.string.search_results_title else R.string.stations_title
|
||||||
.clickable(
|
),
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
trailing = pluralStringResource(R.plurals.station_count, visible.size, visible.size),
|
||||||
indication = null,
|
modifier = Modifier.padding(start = 20.dp, end = 20.dp, bottom = 8.dp)
|
||||||
onClick = onDismiss
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visible.isEmpty()) {
|
||||||
|
item(key = "empty") {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.search_no_results, query),
|
||||||
|
style = MaterialTheme.typography.bodyMedium.copy(
|
||||||
|
color = LocalGeoColors.current.onSurfaceVariant,
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 32.dp, vertical = 32.dp)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items(visible, key = { it.id }) { station ->
|
||||||
|
val isCur = station.id == currentStation?.id
|
||||||
|
StationRow(
|
||||||
|
station = station,
|
||||||
|
isCurrent = isCur,
|
||||||
|
isPlaying = isCur && isPlaying,
|
||||||
|
onClick = { onSelectStation(station) },
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 10.dp, vertical = 1.dp)
|
||||||
|
.animateItem()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
item(key = "spacer") { Spacer(modifier = Modifier.height(8.dp)) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,33 +26,34 @@ data class GeoColors(
|
|||||||
val accentLavender: Color,
|
val accentLavender: Color,
|
||||||
val onAccentLavender: Color,
|
val onAccentLavender: Color,
|
||||||
val deepPurple: Color,
|
val deepPurple: Color,
|
||||||
val liveGreen: Color,
|
val liveRed: Color,
|
||||||
val redFavorite: Color
|
val redFavorite: Color
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Dark take on the "Rad.io" layout: deep navy surfaces with an electric-blue accent.
|
||||||
val DarkGeoColors = GeoColors(
|
val DarkGeoColors = GeoColors(
|
||||||
background = Color(0xFF141218),
|
background = Color(0xFF0D1016),
|
||||||
onBackground = Color(0xFFE6E0E9),
|
onBackground = Color(0xFFEEF1F7),
|
||||||
surface = Color(0xFF141218),
|
surface = Color(0xFF0D1016),
|
||||||
onSurface = Color(0xFFE6E0E9),
|
onSurface = Color(0xFFEEF1F7),
|
||||||
surfaceContainer = Color(0xFF211F26),
|
surfaceContainer = Color(0xFF161A23),
|
||||||
surfaceContainerHigh = Color(0xFF2B2930),
|
surfaceContainerHigh = Color(0xFF1F2430),
|
||||||
onSurfaceVariant = Color(0xFFCAC4D0),
|
onSurfaceVariant = Color(0xFF98A1B3),
|
||||||
outline = Color(0xFF938F99),
|
outline = Color(0xFF5C6577),
|
||||||
outlineVariant = Color(0xFF49454F),
|
outlineVariant = Color(0xFF272D3A),
|
||||||
primary = Color(0xFFD0BCFF),
|
primary = Color(0xFF7C9DFF),
|
||||||
onPrimary = Color(0xFF381E72),
|
onPrimary = Color(0xFF0B1A47),
|
||||||
primaryContainer = Color(0xFF4F378B),
|
primaryContainer = Color(0xFF1F2D5C),
|
||||||
onPrimaryContainer = Color(0xFFEADDFF),
|
onPrimaryContainer = Color(0xFFDCE4FF),
|
||||||
secondary = Color(0xFFCCC2DC),
|
secondary = Color(0xFFB2C1E6),
|
||||||
onSecondary = Color(0xFF332D41),
|
onSecondary = Color(0xFF18233F),
|
||||||
secondaryContainer = Color(0xFF4A4458),
|
secondaryContainer = Color(0xFF283350),
|
||||||
onSecondaryContainer = Color(0xFFE8DEF8),
|
onSecondaryContainer = Color(0xFFDCE4FF),
|
||||||
accentLavender = Color(0xFF4F378B),
|
accentLavender = Color(0xFF3466F6),
|
||||||
onAccentLavender = Color(0xFFEADDFF),
|
onAccentLavender = Color(0xFFFFFFFF),
|
||||||
deepPurple = Color(0xFFD0BCFF),
|
deepPurple = Color(0xFFF3F6FF),
|
||||||
liveGreen = Color(0xFF81C995),
|
liveRed = Color(0xFFFF4D5E),
|
||||||
redFavorite = Color(0xFFF2B8B5)
|
redFavorite = Color(0xFFFF6B81)
|
||||||
)
|
)
|
||||||
|
|
||||||
val LocalGeoColors = staticCompositionLocalOf { DarkGeoColors }
|
val LocalGeoColors = staticCompositionLocalOf { DarkGeoColors }
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ import androidx.lifecycle.AndroidViewModel
|
|||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import cc.skysparkle.fogwave.data.model.AppTab
|
import cc.skysparkle.fogwave.data.model.AppTab
|
||||||
import cc.skysparkle.fogwave.data.model.ExtraPlayerTab
|
import cc.skysparkle.fogwave.data.model.ExtraPlayerTab
|
||||||
import cc.skysparkle.fogwave.data.model.IconSizeStep
|
|
||||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
import cc.skysparkle.fogwave.data.model.ViewMode
|
|
||||||
import cc.skysparkle.fogwave.data.repository.RadioRepository
|
import cc.skysparkle.fogwave.data.repository.RadioRepository
|
||||||
import cc.skysparkle.fogwave.player.AudioEffectsController
|
import cc.skysparkle.fogwave.player.AudioEffectsController
|
||||||
import cc.skysparkle.fogwave.player.AudioEffectsState
|
import cc.skysparkle.fogwave.player.AudioEffectsState
|
||||||
@@ -32,15 +30,13 @@ data class RadioUiState(
|
|||||||
val favorites: Set<String> = emptySet(),
|
val favorites: Set<String> = emptySet(),
|
||||||
val recents: List<RadioStation> = emptyList(),
|
val recents: List<RadioStation> = emptyList(),
|
||||||
val selectedTab: AppTab = AppTab.RADIO,
|
val selectedTab: AppTab = AppTab.RADIO,
|
||||||
val viewMode: ViewMode = ViewMode.ICONS,
|
|
||||||
val sizeStep: IconSizeStep = IconSizeStep.M,
|
|
||||||
val isNowPlayingOpen: Boolean = false,
|
val isNowPlayingOpen: Boolean = false,
|
||||||
val isEqualizerPopOpen: Boolean = false,
|
val isEqualizerPopOpen: Boolean = false,
|
||||||
val isViewPopOpen: Boolean = false,
|
|
||||||
val activeExtraTab: ExtraPlayerTab = ExtraPlayerTab.RECENT,
|
val activeExtraTab: ExtraPlayerTab = ExtraPlayerTab.RECENT,
|
||||||
val audioEffects: AudioEffectsState = AudioEffectsState(),
|
val audioEffects: AudioEffectsState = AudioEffectsState(),
|
||||||
val isMiniPlayerHidden: Boolean = false,
|
val isMiniPlayerHidden: Boolean = false,
|
||||||
val unseenFavoritesCount: Int = 0
|
val unseenFavoritesCount: Int = 0,
|
||||||
|
val nowPlayingTitle: String? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
||||||
@@ -60,7 +56,6 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
private val _selectedTab = MutableStateFlow(AppTab.RADIO)
|
private val _selectedTab = MutableStateFlow(AppTab.RADIO)
|
||||||
private val _isNowPlayingOpen = MutableStateFlow(false)
|
private val _isNowPlayingOpen = MutableStateFlow(false)
|
||||||
private val _isEqualizerPopOpen = MutableStateFlow(false)
|
private val _isEqualizerPopOpen = MutableStateFlow(false)
|
||||||
private val _isViewPopOpen = MutableStateFlow(false)
|
|
||||||
private val _activeExtraTab = MutableStateFlow(ExtraPlayerTab.RECENT)
|
private val _activeExtraTab = MutableStateFlow(ExtraPlayerTab.RECENT)
|
||||||
private val _isMiniPlayerHidden = MutableStateFlow(false)
|
private val _isMiniPlayerHidden = MutableStateFlow(false)
|
||||||
|
|
||||||
@@ -83,16 +78,14 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
repository.favoritesFlow,
|
repository.favoritesFlow,
|
||||||
repository.recentsFlow,
|
repository.recentsFlow,
|
||||||
_selectedTab,
|
_selectedTab,
|
||||||
repository.viewModeFlow,
|
|
||||||
repository.sizeStepFlow,
|
|
||||||
_isNowPlayingOpen,
|
_isNowPlayingOpen,
|
||||||
_isEqualizerPopOpen,
|
_isEqualizerPopOpen,
|
||||||
_isViewPopOpen,
|
|
||||||
_activeExtraTab,
|
_activeExtraTab,
|
||||||
AudioEffectsController.state,
|
AudioEffectsController.state,
|
||||||
_isMiniPlayerHidden,
|
_isMiniPlayerHidden,
|
||||||
repository.seenFavoritesFlow,
|
repository.seenFavoritesFlow,
|
||||||
_stations
|
_stations,
|
||||||
|
playerManager.nowPlayingTitle
|
||||||
) { params ->
|
) { params ->
|
||||||
val current = params[0] as? RadioStation
|
val current = params[0] as? RadioStation
|
||||||
val pState = params[1] as PlayerState
|
val pState = params[1] as PlayerState
|
||||||
@@ -101,18 +94,16 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val recentsIds = params[3] as List<String>
|
val recentsIds = params[3] as List<String>
|
||||||
val tab = params[4] as AppTab
|
val tab = params[4] as AppTab
|
||||||
val mode = params[5] as ViewMode
|
val nowPlaying = params[5] as Boolean
|
||||||
val size = params[6] as IconSizeStep
|
val eqPop = params[6] as Boolean
|
||||||
val nowPlaying = params[7] as Boolean
|
val extraTab = params[7] as ExtraPlayerTab
|
||||||
val eqPop = params[8] as Boolean
|
val effects = params[8] as AudioEffectsState
|
||||||
val viewPop = params[9] as Boolean
|
val miniHidden = params[9] as Boolean
|
||||||
val extraTab = params[10] as ExtraPlayerTab
|
|
||||||
val effects = params[11] as AudioEffectsState
|
|
||||||
val miniHidden = params[12] as Boolean
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val seenFavs = params[13] as Set<String>
|
val seenFavs = params[10] as Set<String>
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val orderedStations = params[14] as List<RadioStation>
|
val orderedStations = params[11] as List<RadioStation>
|
||||||
|
val songTitle = params[12] as String?
|
||||||
|
|
||||||
val byId = orderedStations.associateBy { it.id }
|
val byId = orderedStations.associateBy { it.id }
|
||||||
val recentsList = recentsIds.mapNotNull { byId[it] }
|
val recentsList = recentsIds.mapNotNull { byId[it] }
|
||||||
@@ -124,15 +115,13 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
favorites = favs,
|
favorites = favs,
|
||||||
recents = recentsList,
|
recents = recentsList,
|
||||||
selectedTab = tab,
|
selectedTab = tab,
|
||||||
viewMode = mode,
|
|
||||||
sizeStep = size,
|
|
||||||
isNowPlayingOpen = nowPlaying,
|
isNowPlayingOpen = nowPlaying,
|
||||||
isEqualizerPopOpen = eqPop,
|
isEqualizerPopOpen = eqPop,
|
||||||
isViewPopOpen = viewPop,
|
|
||||||
activeExtraTab = extraTab,
|
activeExtraTab = extraTab,
|
||||||
audioEffects = effects,
|
audioEffects = effects,
|
||||||
isMiniPlayerHidden = miniHidden,
|
isMiniPlayerHidden = miniHidden,
|
||||||
unseenFavoritesCount = favs.count { it !in seenFavs }
|
unseenFavoritesCount = favs.count { it !in seenFavs },
|
||||||
|
nowPlayingTitle = songTitle
|
||||||
)
|
)
|
||||||
}.stateIn(
|
}.stateIn(
|
||||||
scope = viewModelScope,
|
scope = viewModelScope,
|
||||||
@@ -141,8 +130,6 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
stations = stations,
|
stations = stations,
|
||||||
currentStation = initialStation,
|
currentStation = initialStation,
|
||||||
favorites = repository.favoritesFlow.value,
|
favorites = repository.favoritesFlow.value,
|
||||||
viewMode = repository.viewModeFlow.value,
|
|
||||||
sizeStep = repository.sizeStepFlow.value,
|
|
||||||
audioEffects = AudioEffectsController.state.value,
|
audioEffects = AudioEffectsController.state.value,
|
||||||
unseenFavoritesCount = repository.favoritesFlow.value.count { it !in repository.seenFavoritesFlow.value }
|
unseenFavoritesCount = repository.favoritesFlow.value.count { it !in repository.seenFavoritesFlow.value }
|
||||||
)
|
)
|
||||||
@@ -273,20 +260,11 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
|
|
||||||
fun setSelectedTab(tab: AppTab) {
|
fun setSelectedTab(tab: AppTab) {
|
||||||
_selectedTab.value = tab
|
_selectedTab.value = tab
|
||||||
_isViewPopOpen.value = false
|
|
||||||
if (tab == AppTab.FAVORITES) {
|
if (tab == AppTab.FAVORITES) {
|
||||||
repository.markFavoritesSeen(repository.favoritesFlow.value)
|
repository.markFavoritesSeen(repository.favoritesFlow.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setViewMode(mode: ViewMode) {
|
|
||||||
repository.setViewMode(mode)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSizeStep(step: IconSizeStep) {
|
|
||||||
repository.setSizeStep(step)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun openNowPlaying() {
|
fun openNowPlaying() {
|
||||||
_isNowPlayingOpen.value = true
|
_isNowPlayingOpen.value = true
|
||||||
}
|
}
|
||||||
@@ -304,14 +282,6 @@ class RadioViewModel(application: Application) : AndroidViewModel(application) {
|
|||||||
_isEqualizerPopOpen.value = false
|
_isEqualizerPopOpen.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toggleViewPop() {
|
|
||||||
_isViewPopOpen.value = !_isViewPopOpen.value
|
|
||||||
}
|
|
||||||
|
|
||||||
fun closeViewPop() {
|
|
||||||
_isViewPopOpen.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setActiveExtraTab(tab: ExtraPlayerTab) {
|
fun setActiveExtraTab(tab: ExtraPlayerTab) {
|
||||||
_activeExtraTab.value = tab
|
_activeExtraTab.value = tab
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 952 B |
|
Before Width: | Height: | Size: 678 B |
|
Before Width: | Height: | Size: 680 B |
|
Before Width: | Height: | Size: 922 B |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 644 B |
@@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:pathData="M6,6L18,18 M18,6L6,18" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:pathData="M6,17a3,3 0,1 0,6 0a3,3 0,1 0,-6 0z M12,17V4L19,6V9L12,7" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:pathData="M11,4a7,7 0,1 0,0 14a7,7 0,1 0,0 -14z M16.2,16.2L20,20" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:pathData="M15.5,5a2.5,2.5 0,1 0,5 0a2.5,2.5 0,1 0,-5 0z M3.5,12a2.5,2.5 0,1 0,5 0a2.5,2.5 0,1 0,-5 0z M15.5,19a2.5,2.5 0,1 0,5 0a2.5,2.5 0,1 0,-5 0z M8.2,10.8L15.8,6.2 M8.2,13.2L15.8,17.8" />
|
||||||
|
</vector>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Fogwave</string>
|
<string name="app_name">Fogwave</string>
|
||||||
<string name="app_subtitle">Internetradio</string>
|
|
||||||
|
|
||||||
<string name="about_version">Version %1$s</string>
|
<string name="about_version">Version %1$s</string>
|
||||||
<string name="about_description">Ein schneller, eleganter Internetradio-Player mit klarem Klang und ausgewogenem geometrischem Design.</string>
|
<string name="about_description">Ein schneller, eleganter Internetradio-Player mit klarem Klang und ausgewogenem geometrischem Design.</string>
|
||||||
@@ -9,9 +8,7 @@
|
|||||||
<string name="fogwave_logo_content_desc">Fogwave-Logo</string>
|
<string name="fogwave_logo_content_desc">Fogwave-Logo</string>
|
||||||
|
|
||||||
<string name="player_connecting">Verbindung wird hergestellt…</string>
|
<string name="player_connecting">Verbindung wird hergestellt…</string>
|
||||||
<string name="player_on_air">Auf Sendung</string>
|
|
||||||
<string name="player_stopped">Gestoppt</string>
|
<string name="player_stopped">Gestoppt</string>
|
||||||
<string name="now_playing_live">Läuft gerade • LIVE</string>
|
|
||||||
<string name="now_playing_label">LÄUFT GERADE</string>
|
<string name="now_playing_label">LÄUFT GERADE</string>
|
||||||
<string name="close_content_desc">Schließen</string>
|
<string name="close_content_desc">Schließen</string>
|
||||||
<string name="equalizer_content_desc">Equalizer</string>
|
<string name="equalizer_content_desc">Equalizer</string>
|
||||||
@@ -40,19 +37,11 @@
|
|||||||
<string name="info_status">Status</string>
|
<string name="info_status">Status</string>
|
||||||
<string name="status_live">Auf Sendung • Livestream</string>
|
<string name="status_live">Auf Sendung • Livestream</string>
|
||||||
|
|
||||||
<string name="view_mode_content_desc">Anzeigemodus</string>
|
|
||||||
<string name="display_mode_label">ANZEIGEMODUS</string>
|
|
||||||
<string name="view_mode_list">Liste</string>
|
|
||||||
<string name="view_mode_table">Tabelle</string>
|
|
||||||
<string name="view_mode_tiles">Kacheln</string>
|
|
||||||
<string name="view_mode_icons">Symbole</string>
|
|
||||||
<string name="size_label">GRÖSSE</string>
|
|
||||||
|
|
||||||
<string name="favorites_empty_title">Noch keine Favoriten</string>
|
<string name="favorites_empty_title">Noch keine Favoriten</string>
|
||||||
<string name="favorites_empty_subtitle">Öffne den Player eines beliebigen Senders und tippe auf das Herz, um ihn zu den Favoriten hinzuzufügen.</string>
|
<string name="favorites_empty_subtitle">Öffne den Player eines beliebigen Senders und tippe auf das Herz, um ihn zu den Favoriten hinzuzufügen.</string>
|
||||||
|
|
||||||
<string name="stations_title">Sender</string>
|
<string name="stations_title">Sender</string>
|
||||||
<string name="favorite_stations_title">Lieblingssender</string>
|
|
||||||
|
|
||||||
<string name="tab_radio">Radio</string>
|
<string name="tab_radio">Radio</string>
|
||||||
<string name="tab_favorites">Favoriten</string>
|
<string name="tab_favorites">Favoriten</string>
|
||||||
@@ -88,6 +77,10 @@
|
|||||||
<string name="station_desc_plus">Musik & Hit-Klassiker</string>
|
<string name="station_desc_plus">Musik & Hit-Klassiker</string>
|
||||||
<string name="station_desc_goldfm">Goldene Hits</string>
|
<string name="station_desc_goldfm">Goldene Hits</string>
|
||||||
<string name="station_desc_rc">Radiocentras • Litauen</string>
|
<string name="station_desc_rc">Radiocentras • Litauen</string>
|
||||||
|
<string name="station_desc_lrt">Litauischer öffentlicher Rundfunk • Nachrichten</string>
|
||||||
|
<string name="station_desc_ziniu">Wirtschaftsnachrichten & Talk • Litauen</string>
|
||||||
|
<string name="station_desc_lr1">Öffentliche Nachrichten & Talk • Lettland</string>
|
||||||
|
<string name="station_desc_lr2">Lettische Musik • Lettland</string>
|
||||||
<string name="genre_hits">Hits</string>
|
<string name="genre_hits">Hits</string>
|
||||||
<string name="genre_pop">Pop</string>
|
<string name="genre_pop">Pop</string>
|
||||||
<string name="genre_dance">Dance</string>
|
<string name="genre_dance">Dance</string>
|
||||||
@@ -95,6 +88,8 @@
|
|||||||
<string name="genre_rock">Rock</string>
|
<string name="genre_rock">Rock</string>
|
||||||
<string name="genre_easy_listening">Easy Listening</string>
|
<string name="genre_easy_listening">Easy Listening</string>
|
||||||
<string name="genre_lithuanian">Litauische Musik</string>
|
<string name="genre_lithuanian">Litauische Musik</string>
|
||||||
|
<string name="genre_news_talk">Nachrichten & Talk</string>
|
||||||
|
<string name="genre_latvian">Lettische Musik</string>
|
||||||
|
|
||||||
<string name="eq_preset_normal">Normal</string>
|
<string name="eq_preset_normal">Normal</string>
|
||||||
<string name="eq_preset_classical">Klassik</string>
|
<string name="eq_preset_classical">Klassik</string>
|
||||||
@@ -106,4 +101,17 @@
|
|||||||
<string name="eq_preset_jazz">Jazz</string>
|
<string name="eq_preset_jazz">Jazz</string>
|
||||||
<string name="eq_preset_pop">Pop</string>
|
<string name="eq_preset_pop">Pop</string>
|
||||||
<string name="eq_preset_rock">Rock</string>
|
<string name="eq_preset_rock">Rock</string>
|
||||||
|
|
||||||
|
<string name="live_label">LIVE</string>
|
||||||
|
<string name="search_content_desc">Suchen</string>
|
||||||
|
<string name="search_hint">Sender suchen</string>
|
||||||
|
<string name="search_results_title">Suchergebnisse</string>
|
||||||
|
<string name="search_no_results">Keine Sender passend zu „%1$s“</string>
|
||||||
|
<plurals name="station_count">
|
||||||
|
<item quantity="one">%d Sender</item>
|
||||||
|
<item quantity="other">%d Sender</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="share_content_desc">Teilen</string>
|
||||||
|
<string name="share_text">Ich höre %1$s mit Fogwave</string>
|
||||||
|
<string name="share_text_track">Ich höre „%1$s“ auf %2$s mit Fogwave</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Fogwave</string>
|
<string name="app_name">Fogwave</string>
|
||||||
<string name="app_subtitle">インターネットラジオ</string>
|
|
||||||
|
|
||||||
<string name="about_version">バージョン %1$s</string>
|
<string name="about_version">バージョン %1$s</string>
|
||||||
<string name="about_description">クリアなサウンドと調和のとれた幾何学的デザインを備えた、高速でエレガントなインターネットラジオプレーヤー。</string>
|
<string name="about_description">クリアなサウンドと調和のとれた幾何学的デザインを備えた、高速でエレガントなインターネットラジオプレーヤー。</string>
|
||||||
@@ -9,9 +8,7 @@
|
|||||||
<string name="fogwave_logo_content_desc">Fogwave ロゴ</string>
|
<string name="fogwave_logo_content_desc">Fogwave ロゴ</string>
|
||||||
|
|
||||||
<string name="player_connecting">接続中…</string>
|
<string name="player_connecting">接続中…</string>
|
||||||
<string name="player_on_air">オンエア中</string>
|
|
||||||
<string name="player_stopped">停止中</string>
|
<string name="player_stopped">停止中</string>
|
||||||
<string name="now_playing_live">再生中 • ライブ</string>
|
|
||||||
<string name="now_playing_label">再生中</string>
|
<string name="now_playing_label">再生中</string>
|
||||||
<string name="close_content_desc">閉じる</string>
|
<string name="close_content_desc">閉じる</string>
|
||||||
<string name="equalizer_content_desc">イコライザー</string>
|
<string name="equalizer_content_desc">イコライザー</string>
|
||||||
@@ -40,19 +37,11 @@
|
|||||||
<string name="info_status">状態</string>
|
<string name="info_status">状態</string>
|
||||||
<string name="status_live">オンエア中 • ライブストリーム</string>
|
<string name="status_live">オンエア中 • ライブストリーム</string>
|
||||||
|
|
||||||
<string name="view_mode_content_desc">表示モード</string>
|
|
||||||
<string name="display_mode_label">表示モード</string>
|
|
||||||
<string name="view_mode_list">リスト</string>
|
|
||||||
<string name="view_mode_table">テーブル</string>
|
|
||||||
<string name="view_mode_tiles">タイル</string>
|
|
||||||
<string name="view_mode_icons">アイコン</string>
|
|
||||||
<string name="size_label">サイズ</string>
|
|
||||||
|
|
||||||
<string name="favorites_empty_title">お気に入りはまだありません</string>
|
<string name="favorites_empty_title">お気に入りはまだありません</string>
|
||||||
<string name="favorites_empty_subtitle">好きな局のプレーヤーを開き、ハートをタップしてお気に入りに追加してください。</string>
|
<string name="favorites_empty_subtitle">好きな局のプレーヤーを開き、ハートをタップしてお気に入りに追加してください。</string>
|
||||||
|
|
||||||
<string name="stations_title">ラジオ局</string>
|
<string name="stations_title">ラジオ局</string>
|
||||||
<string name="favorite_stations_title">お気に入りの局</string>
|
|
||||||
|
|
||||||
<string name="tab_radio">ラジオ</string>
|
<string name="tab_radio">ラジオ</string>
|
||||||
<string name="tab_favorites">お気に入り</string>
|
<string name="tab_favorites">お気に入り</string>
|
||||||
@@ -88,6 +77,10 @@
|
|||||||
<string name="station_desc_plus">音楽と往年のヒット曲</string>
|
<string name="station_desc_plus">音楽と往年のヒット曲</string>
|
||||||
<string name="station_desc_goldfm">ゴールデンヒット</string>
|
<string name="station_desc_goldfm">ゴールデンヒット</string>
|
||||||
<string name="station_desc_rc">Radiocentras • リトアニア</string>
|
<string name="station_desc_rc">Radiocentras • リトアニア</string>
|
||||||
|
<string name="station_desc_lrt">リトアニア公共放送 • ニュース</string>
|
||||||
|
<string name="station_desc_ziniu">ビジネスニュース・トーク • リトアニア</string>
|
||||||
|
<string name="station_desc_lr1">公共ニュース・トーク • ラトビア</string>
|
||||||
|
<string name="station_desc_lr2">ラトビア音楽 • ラトビア</string>
|
||||||
<string name="genre_hits">ヒット曲</string>
|
<string name="genre_hits">ヒット曲</string>
|
||||||
<string name="genre_pop">ポップ</string>
|
<string name="genre_pop">ポップ</string>
|
||||||
<string name="genre_dance">ダンス</string>
|
<string name="genre_dance">ダンス</string>
|
||||||
@@ -95,6 +88,8 @@
|
|||||||
<string name="genre_rock">ロック</string>
|
<string name="genre_rock">ロック</string>
|
||||||
<string name="genre_easy_listening">イージーリスニング</string>
|
<string name="genre_easy_listening">イージーリスニング</string>
|
||||||
<string name="genre_lithuanian">リトアニア音楽</string>
|
<string name="genre_lithuanian">リトアニア音楽</string>
|
||||||
|
<string name="genre_news_talk">ニュース・トーク</string>
|
||||||
|
<string name="genre_latvian">ラトビア音楽</string>
|
||||||
|
|
||||||
<string name="eq_preset_normal">ノーマル</string>
|
<string name="eq_preset_normal">ノーマル</string>
|
||||||
<string name="eq_preset_classical">クラシック</string>
|
<string name="eq_preset_classical">クラシック</string>
|
||||||
@@ -106,4 +101,16 @@
|
|||||||
<string name="eq_preset_jazz">ジャズ</string>
|
<string name="eq_preset_jazz">ジャズ</string>
|
||||||
<string name="eq_preset_pop">ポップ</string>
|
<string name="eq_preset_pop">ポップ</string>
|
||||||
<string name="eq_preset_rock">ロック</string>
|
<string name="eq_preset_rock">ロック</string>
|
||||||
|
|
||||||
|
<string name="live_label">ライブ</string>
|
||||||
|
<string name="search_content_desc">検索</string>
|
||||||
|
<string name="search_hint">局を検索</string>
|
||||||
|
<string name="search_results_title">検索結果</string>
|
||||||
|
<string name="search_no_results">「%1$s」に一致する局はありません</string>
|
||||||
|
<plurals name="station_count">
|
||||||
|
<item quantity="other">%d 局</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="share_content_desc">共有</string>
|
||||||
|
<string name="share_text">Fogwaveで%1$sを聴いています</string>
|
||||||
|
<string name="share_text_track">Fogwaveで%2$sの「%1$s」を聴いています</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Fogwave</string>
|
<string name="app_name">Fogwave</string>
|
||||||
<string name="app_subtitle">Interneto radijas</string>
|
|
||||||
|
|
||||||
<string name="about_version">Versija %1$s</string>
|
<string name="about_version">Versija %1$s</string>
|
||||||
<string name="about_description">Greitas ir elegantiškas interneto radijo grotuvas su švariu garsu ir darniu geometriniu dizainu.</string>
|
<string name="about_description">Greitas ir elegantiškas interneto radijo grotuvas su švariu garsu ir darniu geometriniu dizainu.</string>
|
||||||
@@ -9,9 +8,7 @@
|
|||||||
<string name="fogwave_logo_content_desc">Fogwave logotipas</string>
|
<string name="fogwave_logo_content_desc">Fogwave logotipas</string>
|
||||||
|
|
||||||
<string name="player_connecting">Jungiamasi…</string>
|
<string name="player_connecting">Jungiamasi…</string>
|
||||||
<string name="player_on_air">Eteryje</string>
|
|
||||||
<string name="player_stopped">Sustabdyta</string>
|
<string name="player_stopped">Sustabdyta</string>
|
||||||
<string name="now_playing_live">Dabar skamba • tiesiogiai</string>
|
|
||||||
<string name="now_playing_label">DABAR SKAMBA</string>
|
<string name="now_playing_label">DABAR SKAMBA</string>
|
||||||
<string name="close_content_desc">Uždaryti</string>
|
<string name="close_content_desc">Uždaryti</string>
|
||||||
<string name="equalizer_content_desc">Ekvalaizeris</string>
|
<string name="equalizer_content_desc">Ekvalaizeris</string>
|
||||||
@@ -40,19 +37,11 @@
|
|||||||
<string name="info_status">Būsena</string>
|
<string name="info_status">Būsena</string>
|
||||||
<string name="status_live">Eteryje • tiesioginė transliacija</string>
|
<string name="status_live">Eteryje • tiesioginė transliacija</string>
|
||||||
|
|
||||||
<string name="view_mode_content_desc">Rodymo būdas</string>
|
|
||||||
<string name="display_mode_label">RODYMO BŪDAS</string>
|
|
||||||
<string name="view_mode_list">Sąrašas</string>
|
|
||||||
<string name="view_mode_table">Lentelė</string>
|
|
||||||
<string name="view_mode_tiles">Plytelės</string>
|
|
||||||
<string name="view_mode_icons">Piktogramos</string>
|
|
||||||
<string name="size_label">DYDIS</string>
|
|
||||||
|
|
||||||
<string name="favorites_empty_title">Mėgstamų kol kas nėra</string>
|
<string name="favorites_empty_title">Mėgstamų kol kas nėra</string>
|
||||||
<string name="favorites_empty_subtitle">Atverkite bet kurios stoties grotuvą ir bakstelėkite širdelę, kad pridėtumėte ją prie mėgstamų.</string>
|
<string name="favorites_empty_subtitle">Atverkite bet kurios stoties grotuvą ir bakstelėkite širdelę, kad pridėtumėte ją prie mėgstamų.</string>
|
||||||
|
|
||||||
<string name="stations_title">Stotys</string>
|
<string name="stations_title">Stotys</string>
|
||||||
<string name="favorite_stations_title">Mėgstamos stotys</string>
|
|
||||||
|
|
||||||
<string name="tab_radio">Radijas</string>
|
<string name="tab_radio">Radijas</string>
|
||||||
<string name="tab_favorites">Mėgstami</string>
|
<string name="tab_favorites">Mėgstami</string>
|
||||||
@@ -88,6 +77,10 @@
|
|||||||
<string name="station_desc_plus">Muzika ir klasikiniai hitai</string>
|
<string name="station_desc_plus">Muzika ir klasikiniai hitai</string>
|
||||||
<string name="station_desc_goldfm">Auksiniai hitai</string>
|
<string name="station_desc_goldfm">Auksiniai hitai</string>
|
||||||
<string name="station_desc_rc">Radiocentras • Lietuva</string>
|
<string name="station_desc_rc">Radiocentras • Lietuva</string>
|
||||||
|
<string name="station_desc_lrt">Lietuvos visuomeninis radijas • Žinios</string>
|
||||||
|
<string name="station_desc_ziniu">Verslo žinios ir pokalbiai • Lietuva</string>
|
||||||
|
<string name="station_desc_lr1">Visuomeninės žinios ir pokalbiai • Latvija</string>
|
||||||
|
<string name="station_desc_lr2">Latviška muzika • Latvija</string>
|
||||||
<string name="genre_hits">Hitai</string>
|
<string name="genre_hits">Hitai</string>
|
||||||
<string name="genre_pop">Pop</string>
|
<string name="genre_pop">Pop</string>
|
||||||
<string name="genre_dance">Šokių</string>
|
<string name="genre_dance">Šokių</string>
|
||||||
@@ -95,6 +88,8 @@
|
|||||||
<string name="genre_rock">Rokas</string>
|
<string name="genre_rock">Rokas</string>
|
||||||
<string name="genre_easy_listening">Lengvoji muzika</string>
|
<string name="genre_easy_listening">Lengvoji muzika</string>
|
||||||
<string name="genre_lithuanian">Lietuviška muzika</string>
|
<string name="genre_lithuanian">Lietuviška muzika</string>
|
||||||
|
<string name="genre_news_talk">Žinios ir pokalbiai</string>
|
||||||
|
<string name="genre_latvian">Latviška muzika</string>
|
||||||
|
|
||||||
<string name="eq_preset_normal">Įprastas</string>
|
<string name="eq_preset_normal">Įprastas</string>
|
||||||
<string name="eq_preset_classical">Klasika</string>
|
<string name="eq_preset_classical">Klasika</string>
|
||||||
@@ -106,4 +101,19 @@
|
|||||||
<string name="eq_preset_jazz">Džiazas</string>
|
<string name="eq_preset_jazz">Džiazas</string>
|
||||||
<string name="eq_preset_pop">Pop</string>
|
<string name="eq_preset_pop">Pop</string>
|
||||||
<string name="eq_preset_rock">Rokas</string>
|
<string name="eq_preset_rock">Rokas</string>
|
||||||
|
|
||||||
|
<string name="live_label">TIESIOGIAI</string>
|
||||||
|
<string name="search_content_desc">Ieškoti</string>
|
||||||
|
<string name="search_hint">Ieškoti stočių</string>
|
||||||
|
<string name="search_results_title">Paieškos rezultatai</string>
|
||||||
|
<string name="search_no_results">Nėra stočių pagal „%1$s“</string>
|
||||||
|
<plurals name="station_count">
|
||||||
|
<item quantity="one">%d stotis</item>
|
||||||
|
<item quantity="few">%d stotys</item>
|
||||||
|
<item quantity="many">%d stoties</item>
|
||||||
|
<item quantity="other">%d stočių</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="share_content_desc">Bendrinti</string>
|
||||||
|
<string name="share_text">Klausausi %1$s per Fogwave</string>
|
||||||
|
<string name="share_text_track">Klausausi „%1$s“ per %2$s su Fogwave</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Fogwave</string>
|
<string name="app_name">Fogwave</string>
|
||||||
<string name="app_subtitle">Интернет-радио</string>
|
|
||||||
|
|
||||||
<string name="about_version">Версия %1$s</string>
|
<string name="about_version">Версия %1$s</string>
|
||||||
<string name="about_description">Быстрый и элегантный плеер интернет-радио с чистым звуком и гармоничным геометрическим дизайном.</string>
|
<string name="about_description">Быстрый и элегантный плеер интернет-радио с чистым звуком и гармоничным геометрическим дизайном.</string>
|
||||||
@@ -9,9 +8,7 @@
|
|||||||
<string name="fogwave_logo_content_desc">Логотип Fogwave</string>
|
<string name="fogwave_logo_content_desc">Логотип Fogwave</string>
|
||||||
|
|
||||||
<string name="player_connecting">Подключение…</string>
|
<string name="player_connecting">Подключение…</string>
|
||||||
<string name="player_on_air">В эфире</string>
|
|
||||||
<string name="player_stopped">Остановлено</string>
|
<string name="player_stopped">Остановлено</string>
|
||||||
<string name="now_playing_live">Сейчас играет • прямой эфир</string>
|
|
||||||
<string name="now_playing_label">СЕЙЧАС ИГРАЕТ</string>
|
<string name="now_playing_label">СЕЙЧАС ИГРАЕТ</string>
|
||||||
<string name="close_content_desc">Закрыть</string>
|
<string name="close_content_desc">Закрыть</string>
|
||||||
<string name="equalizer_content_desc">Эквалайзер</string>
|
<string name="equalizer_content_desc">Эквалайзер</string>
|
||||||
@@ -40,19 +37,11 @@
|
|||||||
<string name="info_status">Статус</string>
|
<string name="info_status">Статус</string>
|
||||||
<string name="status_live">В эфире • прямая трансляция</string>
|
<string name="status_live">В эфире • прямая трансляция</string>
|
||||||
|
|
||||||
<string name="view_mode_content_desc">Вид отображения</string>
|
|
||||||
<string name="display_mode_label">РЕЖИМ ОТОБРАЖЕНИЯ</string>
|
|
||||||
<string name="view_mode_list">Список</string>
|
|
||||||
<string name="view_mode_table">Таблица</string>
|
|
||||||
<string name="view_mode_tiles">Плитки</string>
|
|
||||||
<string name="view_mode_icons">Значки</string>
|
|
||||||
<string name="size_label">РАЗМЕР</string>
|
|
||||||
|
|
||||||
<string name="favorites_empty_title">В любимых пока ничего нет</string>
|
<string name="favorites_empty_title">В любимых пока ничего нет</string>
|
||||||
<string name="favorites_empty_subtitle">Откройте плеер любой станции и нажмите на сердечко, чтобы добавить её в список любимых.</string>
|
<string name="favorites_empty_subtitle">Откройте плеер любой станции и нажмите на сердечко, чтобы добавить её в список любимых.</string>
|
||||||
|
|
||||||
<string name="stations_title">Станции</string>
|
<string name="stations_title">Станции</string>
|
||||||
<string name="favorite_stations_title">Любимые станции</string>
|
|
||||||
|
|
||||||
<string name="tab_radio">Радио</string>
|
<string name="tab_radio">Радио</string>
|
||||||
<string name="tab_favorites">Любимые</string>
|
<string name="tab_favorites">Любимые</string>
|
||||||
@@ -88,6 +77,10 @@
|
|||||||
<string name="station_desc_plus">Музыка и хиты прошлых лет</string>
|
<string name="station_desc_plus">Музыка и хиты прошлых лет</string>
|
||||||
<string name="station_desc_goldfm">Золотые хиты</string>
|
<string name="station_desc_goldfm">Золотые хиты</string>
|
||||||
<string name="station_desc_rc">Radiocentras • Литва</string>
|
<string name="station_desc_rc">Radiocentras • Литва</string>
|
||||||
|
<string name="station_desc_lrt">Общественное радио Литвы • Новости</string>
|
||||||
|
<string name="station_desc_ziniu">Деловые новости и ток-шоу • Литва</string>
|
||||||
|
<string name="station_desc_lr1">Общественные новости и ток-шоу • Латвия</string>
|
||||||
|
<string name="station_desc_lr2">Латышская музыка • Латвия</string>
|
||||||
<string name="genre_hits">Хиты</string>
|
<string name="genre_hits">Хиты</string>
|
||||||
<string name="genre_pop">Поп</string>
|
<string name="genre_pop">Поп</string>
|
||||||
<string name="genre_dance">Танцевальная</string>
|
<string name="genre_dance">Танцевальная</string>
|
||||||
@@ -95,6 +88,8 @@
|
|||||||
<string name="genre_rock">Рок</string>
|
<string name="genre_rock">Рок</string>
|
||||||
<string name="genre_easy_listening">Лёгкая музыка</string>
|
<string name="genre_easy_listening">Лёгкая музыка</string>
|
||||||
<string name="genre_lithuanian">Литовская музыка</string>
|
<string name="genre_lithuanian">Литовская музыка</string>
|
||||||
|
<string name="genre_news_talk">Новости и разговорное</string>
|
||||||
|
<string name="genre_latvian">Латышская музыка</string>
|
||||||
|
|
||||||
<string name="eq_preset_normal">Обычный</string>
|
<string name="eq_preset_normal">Обычный</string>
|
||||||
<string name="eq_preset_classical">Классика</string>
|
<string name="eq_preset_classical">Классика</string>
|
||||||
@@ -106,4 +101,19 @@
|
|||||||
<string name="eq_preset_jazz">Джаз</string>
|
<string name="eq_preset_jazz">Джаз</string>
|
||||||
<string name="eq_preset_pop">Поп</string>
|
<string name="eq_preset_pop">Поп</string>
|
||||||
<string name="eq_preset_rock">Рок</string>
|
<string name="eq_preset_rock">Рок</string>
|
||||||
|
|
||||||
|
<string name="live_label">В ЭФИРЕ</string>
|
||||||
|
<string name="search_content_desc">Поиск</string>
|
||||||
|
<string name="search_hint">Поиск станций</string>
|
||||||
|
<string name="search_results_title">Результаты поиска</string>
|
||||||
|
<string name="search_no_results">Нет станций по запросу «%1$s»</string>
|
||||||
|
<plurals name="station_count">
|
||||||
|
<item quantity="one">%d станция</item>
|
||||||
|
<item quantity="few">%d станции</item>
|
||||||
|
<item quantity="many">%d станций</item>
|
||||||
|
<item quantity="other">%d станции</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="share_content_desc">Поделиться</string>
|
||||||
|
<string name="share_text">Слушаю %1$s в Fogwave</string>
|
||||||
|
<string name="share_text_track">Слушаю «%1$s» на %2$s в Fogwave</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Fogwave</string>
|
<string name="app_name">Fogwave</string>
|
||||||
<string name="app_subtitle">网络电台</string>
|
|
||||||
|
|
||||||
<string name="about_version">版本 %1$s</string>
|
<string name="about_version">版本 %1$s</string>
|
||||||
<string name="about_description">音质清晰、几何设计和谐统一的快速优雅网络电台播放器。</string>
|
<string name="about_description">音质清晰、几何设计和谐统一的快速优雅网络电台播放器。</string>
|
||||||
@@ -9,9 +8,7 @@
|
|||||||
<string name="fogwave_logo_content_desc">Fogwave 标志</string>
|
<string name="fogwave_logo_content_desc">Fogwave 标志</string>
|
||||||
|
|
||||||
<string name="player_connecting">正在连接…</string>
|
<string name="player_connecting">正在连接…</string>
|
||||||
<string name="player_on_air">正在直播</string>
|
|
||||||
<string name="player_stopped">已停止</string>
|
<string name="player_stopped">已停止</string>
|
||||||
<string name="now_playing_live">正在播放 • 直播</string>
|
|
||||||
<string name="now_playing_label">正在播放</string>
|
<string name="now_playing_label">正在播放</string>
|
||||||
<string name="close_content_desc">关闭</string>
|
<string name="close_content_desc">关闭</string>
|
||||||
<string name="equalizer_content_desc">均衡器</string>
|
<string name="equalizer_content_desc">均衡器</string>
|
||||||
@@ -40,19 +37,11 @@
|
|||||||
<string name="info_status">状态</string>
|
<string name="info_status">状态</string>
|
||||||
<string name="status_live">正在直播 • 实时音频流</string>
|
<string name="status_live">正在直播 • 实时音频流</string>
|
||||||
|
|
||||||
<string name="view_mode_content_desc">显示模式</string>
|
|
||||||
<string name="display_mode_label">显示模式</string>
|
|
||||||
<string name="view_mode_list">列表</string>
|
|
||||||
<string name="view_mode_table">表格</string>
|
|
||||||
<string name="view_mode_tiles">磁贴</string>
|
|
||||||
<string name="view_mode_icons">图标</string>
|
|
||||||
<string name="size_label">大小</string>
|
|
||||||
|
|
||||||
<string name="favorites_empty_title">收藏夹还是空的</string>
|
<string name="favorites_empty_title">收藏夹还是空的</string>
|
||||||
<string name="favorites_empty_subtitle">打开任意电台的播放器,点击心形图标即可将其加入收藏。</string>
|
<string name="favorites_empty_subtitle">打开任意电台的播放器,点击心形图标即可将其加入收藏。</string>
|
||||||
|
|
||||||
<string name="stations_title">电台</string>
|
<string name="stations_title">电台</string>
|
||||||
<string name="favorite_stations_title">收藏的电台</string>
|
|
||||||
|
|
||||||
<string name="tab_radio">电台</string>
|
<string name="tab_radio">电台</string>
|
||||||
<string name="tab_favorites">收藏</string>
|
<string name="tab_favorites">收藏</string>
|
||||||
@@ -88,6 +77,10 @@
|
|||||||
<string name="station_desc_plus">音乐与经典金曲</string>
|
<string name="station_desc_plus">音乐与经典金曲</string>
|
||||||
<string name="station_desc_goldfm">黄金金曲</string>
|
<string name="station_desc_goldfm">黄金金曲</string>
|
||||||
<string name="station_desc_rc">Radiocentras • 立陶宛</string>
|
<string name="station_desc_rc">Radiocentras • 立陶宛</string>
|
||||||
|
<string name="station_desc_lrt">立陶宛公共广播 • 新闻</string>
|
||||||
|
<string name="station_desc_ziniu">商业新闻与谈话 • 立陶宛</string>
|
||||||
|
<string name="station_desc_lr1">公共新闻与谈话 • 拉脱维亚</string>
|
||||||
|
<string name="station_desc_lr2">拉脱维亚音乐 • 拉脱维亚</string>
|
||||||
<string name="genre_hits">热门</string>
|
<string name="genre_hits">热门</string>
|
||||||
<string name="genre_pop">流行</string>
|
<string name="genre_pop">流行</string>
|
||||||
<string name="genre_dance">舞曲</string>
|
<string name="genre_dance">舞曲</string>
|
||||||
@@ -95,6 +88,8 @@
|
|||||||
<string name="genre_rock">摇滚</string>
|
<string name="genre_rock">摇滚</string>
|
||||||
<string name="genre_easy_listening">轻音乐</string>
|
<string name="genre_easy_listening">轻音乐</string>
|
||||||
<string name="genre_lithuanian">立陶宛音乐</string>
|
<string name="genre_lithuanian">立陶宛音乐</string>
|
||||||
|
<string name="genre_news_talk">新闻与谈话</string>
|
||||||
|
<string name="genre_latvian">拉脱维亚音乐</string>
|
||||||
|
|
||||||
<string name="eq_preset_normal">正常</string>
|
<string name="eq_preset_normal">正常</string>
|
||||||
<string name="eq_preset_classical">古典</string>
|
<string name="eq_preset_classical">古典</string>
|
||||||
@@ -106,4 +101,16 @@
|
|||||||
<string name="eq_preset_jazz">爵士</string>
|
<string name="eq_preset_jazz">爵士</string>
|
||||||
<string name="eq_preset_pop">流行</string>
|
<string name="eq_preset_pop">流行</string>
|
||||||
<string name="eq_preset_rock">摇滚</string>
|
<string name="eq_preset_rock">摇滚</string>
|
||||||
|
|
||||||
|
<string name="live_label">直播</string>
|
||||||
|
<string name="search_content_desc">搜索</string>
|
||||||
|
<string name="search_hint">搜索电台</string>
|
||||||
|
<string name="search_results_title">搜索结果</string>
|
||||||
|
<string name="search_no_results">没有与“%1$s”匹配的电台</string>
|
||||||
|
<plurals name="station_count">
|
||||||
|
<item quantity="other">%d 个电台</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="share_content_desc">分享</string>
|
||||||
|
<string name="share_text">我正在用 Fogwave 收听 %1$s</string>
|
||||||
|
<string name="share_text_track">我正在用 Fogwave 收听 %2$s 的“%1$s”</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="fogwave_background">#FF141218</color>
|
<color name="fogwave_background">#FF0D1016</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Fogwave</string>
|
<string name="app_name">Fogwave</string>
|
||||||
<string name="app_subtitle">Internet Radio</string>
|
|
||||||
|
|
||||||
<string name="about_version">Version %1$s</string>
|
<string name="about_version">Version %1$s</string>
|
||||||
<string name="about_description">A fast, elegant internet radio player with clean sound and a balanced geometric design.</string>
|
<string name="about_description">A fast, elegant internet radio player with clean sound and a balanced geometric design.</string>
|
||||||
@@ -9,9 +8,7 @@
|
|||||||
<string name="fogwave_logo_content_desc">Fogwave logo</string>
|
<string name="fogwave_logo_content_desc">Fogwave logo</string>
|
||||||
|
|
||||||
<string name="player_connecting">Connecting…</string>
|
<string name="player_connecting">Connecting…</string>
|
||||||
<string name="player_on_air">On air</string>
|
|
||||||
<string name="player_stopped">Stopped</string>
|
<string name="player_stopped">Stopped</string>
|
||||||
<string name="now_playing_live">Now playing • LIVE</string>
|
|
||||||
<string name="now_playing_label">NOW PLAYING</string>
|
<string name="now_playing_label">NOW PLAYING</string>
|
||||||
<string name="close_content_desc">Close</string>
|
<string name="close_content_desc">Close</string>
|
||||||
<string name="equalizer_content_desc">Equalizer</string>
|
<string name="equalizer_content_desc">Equalizer</string>
|
||||||
@@ -44,19 +41,11 @@
|
|||||||
<string name="info_status">Status</string>
|
<string name="info_status">Status</string>
|
||||||
<string name="status_live">On air • Live Stream</string>
|
<string name="status_live">On air • Live Stream</string>
|
||||||
|
|
||||||
<string name="view_mode_content_desc">Display mode</string>
|
|
||||||
<string name="display_mode_label">DISPLAY MODE</string>
|
|
||||||
<string name="view_mode_list">List</string>
|
|
||||||
<string name="view_mode_table">Table</string>
|
|
||||||
<string name="view_mode_tiles">Tiles</string>
|
|
||||||
<string name="view_mode_icons">Icons</string>
|
|
||||||
<string name="size_label">SIZE</string>
|
|
||||||
|
|
||||||
<string name="favorites_empty_title">Nothing in favorites yet</string>
|
<string name="favorites_empty_title">Nothing in favorites yet</string>
|
||||||
<string name="favorites_empty_subtitle">Open any station\'s player and tap the heart to add it to favorites.</string>
|
<string name="favorites_empty_subtitle">Open any station\'s player and tap the heart to add it to favorites.</string>
|
||||||
|
|
||||||
<string name="stations_title">Stations</string>
|
<string name="stations_title">Stations</string>
|
||||||
<string name="favorite_stations_title">Favorite Stations</string>
|
|
||||||
|
|
||||||
<string name="tab_radio">Radio</string>
|
<string name="tab_radio">Radio</string>
|
||||||
<string name="tab_favorites">Favorites</string>
|
<string name="tab_favorites">Favorites</string>
|
||||||
@@ -88,6 +77,10 @@
|
|||||||
<string name="station_desc_plus">Music & classic hits</string>
|
<string name="station_desc_plus">Music & classic hits</string>
|
||||||
<string name="station_desc_goldfm">Golden hits</string>
|
<string name="station_desc_goldfm">Golden hits</string>
|
||||||
<string name="station_desc_rc">Radiocentras • Lithuania</string>
|
<string name="station_desc_rc">Radiocentras • Lithuania</string>
|
||||||
|
<string name="station_desc_lrt">Lithuanian public radio • News</string>
|
||||||
|
<string name="station_desc_ziniu">Business news & talk • Lithuania</string>
|
||||||
|
<string name="station_desc_lr1">Public news & talk • Latvia</string>
|
||||||
|
<string name="station_desc_lr2">Latvian music • Latvia</string>
|
||||||
<string name="genre_hits">Hits</string>
|
<string name="genre_hits">Hits</string>
|
||||||
<string name="genre_pop">Pop</string>
|
<string name="genre_pop">Pop</string>
|
||||||
<string name="genre_dance">Dance</string>
|
<string name="genre_dance">Dance</string>
|
||||||
@@ -95,6 +88,8 @@
|
|||||||
<string name="genre_rock">Rock</string>
|
<string name="genre_rock">Rock</string>
|
||||||
<string name="genre_easy_listening">Easy listening</string>
|
<string name="genre_easy_listening">Easy listening</string>
|
||||||
<string name="genre_lithuanian">Lithuanian music</string>
|
<string name="genre_lithuanian">Lithuanian music</string>
|
||||||
|
<string name="genre_news_talk">News & talk</string>
|
||||||
|
<string name="genre_latvian">Latvian music</string>
|
||||||
|
|
||||||
<string name="eq_preset_normal">Normal</string>
|
<string name="eq_preset_normal">Normal</string>
|
||||||
<string name="eq_preset_classical">Classical</string>
|
<string name="eq_preset_classical">Classical</string>
|
||||||
@@ -106,4 +101,17 @@
|
|||||||
<string name="eq_preset_jazz">Jazz</string>
|
<string name="eq_preset_jazz">Jazz</string>
|
||||||
<string name="eq_preset_pop">Pop</string>
|
<string name="eq_preset_pop">Pop</string>
|
||||||
<string name="eq_preset_rock">Rock</string>
|
<string name="eq_preset_rock">Rock</string>
|
||||||
|
|
||||||
|
<string name="live_label">LIVE</string>
|
||||||
|
<string name="search_content_desc">Search</string>
|
||||||
|
<string name="search_hint">Search stations</string>
|
||||||
|
<string name="search_results_title">Search results</string>
|
||||||
|
<string name="search_no_results">No stations match “%1$s”</string>
|
||||||
|
<plurals name="station_count">
|
||||||
|
<item quantity="one">%d station</item>
|
||||||
|
<item quantity="other">%d stations</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="share_content_desc">Share</string>
|
||||||
|
<string name="share_text">I\'m listening to %1$s on Fogwave</string>
|
||||||
|
<string name="share_text_track">I\'m listening to “%1$s” on %2$s with Fogwave</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package cc.skysparkle.fogwave
|
|||||||
import androidx.compose.ui.test.junit4.createComposeRule
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
import androidx.compose.ui.test.onRoot
|
import androidx.compose.ui.test.onRoot
|
||||||
import cc.skysparkle.fogwave.data.model.Genre
|
import cc.skysparkle.fogwave.data.model.Genre
|
||||||
import cc.skysparkle.fogwave.data.model.IconSizeStep
|
|
||||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||||
import cc.skysparkle.fogwave.data.model.ViewMode
|
import cc.skysparkle.fogwave.ui.components.StationRow
|
||||||
import cc.skysparkle.fogwave.ui.components.StationItem
|
|
||||||
import cc.skysparkle.fogwave.ui.theme.FogwaveTheme
|
import cc.skysparkle.fogwave.ui.theme.FogwaveTheme
|
||||||
import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
|
import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
|
||||||
import com.github.takahirom.roborazzi.captureRoboImage
|
import com.github.takahirom.roborazzi.captureRoboImage
|
||||||
@@ -20,7 +18,7 @@ import org.robolectric.annotation.GraphicsMode
|
|||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
@GraphicsMode(GraphicsMode.Mode.NATIVE)
|
@GraphicsMode(GraphicsMode.Mode.NATIVE)
|
||||||
@Config(qualifiers = RobolectricDeviceQualifiers.Pixel8, sdk = [36])
|
@Config(qualifiers = RobolectricDeviceQualifiers.Pixel8, sdk = [36])
|
||||||
class StationItemScreenshotTest {
|
class StationRowScreenshotTest {
|
||||||
@get:Rule val composeTestRule = createComposeRule()
|
@get:Rule val composeTestRule = createComposeRule()
|
||||||
|
|
||||||
private val station = RadioStation(
|
private val station = RadioStation(
|
||||||
@@ -34,20 +32,18 @@ class StationItemScreenshotTest {
|
|||||||
)
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun stationItem_list_screenshot() {
|
fun stationRow_screenshot() {
|
||||||
composeTestRule.setContent {
|
composeTestRule.setContent {
|
||||||
FogwaveTheme {
|
FogwaveTheme {
|
||||||
StationItem(
|
StationRow(
|
||||||
station = station,
|
station = station,
|
||||||
isCurrent = true,
|
isCurrent = true,
|
||||||
isPlaying = false,
|
isPlaying = false,
|
||||||
viewMode = ViewMode.LIST,
|
|
||||||
sizeStep = IconSizeStep.M,
|
|
||||||
onClick = {}
|
onClick = {}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
composeTestRule.onRoot().captureRoboImage(filePath = "src/test/screenshots/station_item.png")
|
composeTestRule.onRoot().captureRoboImage(filePath = "src/test/screenshots/station_row.png")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 784 KiB After Width: | Height: | Size: 639 KiB |
|
Before Width: | Height: | Size: 1020 KiB After Width: | Height: | Size: 794 KiB |
|
Before Width: | Height: | Size: 989 KiB After Width: | Height: | Size: 658 KiB |
|
Before Width: | Height: | Size: 658 KiB After Width: | Height: | Size: 709 KiB |
@@ -2,5 +2,7 @@
|
|||||||
• Weniger Aussetzer bei schwachem Netz
|
• Weniger Aussetzer bei schwachem Netz
|
||||||
• Flüssigere Equalizer-Regler und schnellerer App-Start
|
• Flüssigere Equalizer-Regler und schnellerer App-Start
|
||||||
• Nicht erreichbare Streams werden nicht mehr minutenlang neu versucht
|
• Nicht erreichbare Streams werden nicht mehr minutenlang neu versucht
|
||||||
|
• Neue Sender: LRT Radijas, Žinių radijas, Latvijas Radio 1 und 2
|
||||||
|
• Ansichtsoptionen nur noch im Tab „Radio“
|
||||||
|
|
||||||
Neue Versionen gibt es auch auf Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
Neue Versionen gibt es auch auf Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• Neues Design mit Suche und schwebendem Mini-Player
|
||||||
|
• Player mit rundem Sender-Cover und dem Titel des laufenden Songs
|
||||||
|
• Ziehender Nebel in der Farbe des laufenden Senders
|
||||||
|
• Teile den Sender oder Song, den du gerade hörst
|
||||||
|
|
||||||
|
Neue Versionen gibt es auch auf Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<p>Nimm Litauens beliebteste Radiosender mit – ganz ohne Ballast. Mit Fogwave schaltest du einfach ein, hörst im Hintergrund und genießt ein aufgeräumtes, werbefreies Erlebnis ohne Konto und ohne Tracking.</p>
|
<p>Nimm Litauens beliebteste Radiosender mit – ganz ohne Ballast. Mit Fogwave schaltest du einfach ein, hörst im Hintergrund und genießt ein aufgeräumtes, werbefreies Erlebnis ohne Konto und ohne Tracking.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Höre 10 litauische Sender, darunter ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1 und Gold FM.</li>
|
<li>Höre 14 Sender aus Litauen und Lettland, darunter ZIP FM, Power Hit Radio, Rock FM, LRT Radijas, Žinių radijas und Latvijas Radio.</li>
|
||||||
<li>Hör weiter, während du andere Apps nutzt – mit Steuerung über Sperrbildschirm, Benachrichtigungen, Kopfhörer und Bluetooth.</li>
|
<li>Hör weiter, während du andere Apps nutzt – mit Steuerung über Sperrbildschirm, Benachrichtigungen, Kopfhörer und Bluetooth.</li>
|
||||||
<li>Genieße deinen Lieblingsklang mit Equalizer, gespeicherten Einstellungen, Lautstärkeverstärkung und Audio-Presets.</li>
|
<li>Genieße deinen Lieblingsklang mit Equalizer, gespeicherten Einstellungen, Lautstärkeverstärkung und Audio-Presets.</li>
|
||||||
<li>Hör einfach weiter: Bricht der Stream oder das Netz ab, verbindet sich die App automatisch neu.</li>
|
<li>Hör einfach weiter: Bricht der Stream oder das Netz ab, verbindet sich die App automatisch neu.</li>
|
||||||
<li>Nimm das Radio mit auf die Straße – mit Android-Auto-Unterstützung.</li>
|
<li>Nimm das Radio mit auf die Straße – mit Android-Auto-Unterstützung.</li>
|
||||||
<li>Finde Sender auf deine Art: Favoriten, zuletzt gehörte Sender, passende Genres und vier Ansichten.</li>
|
<li>Finde Sender auf deine Art: Suche, Favoriten, zuletzt gehörte und ähnliche Sender – dazu der laufende Song.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Wähle einen Sender und tippe auf Wiedergabe. Fogwave spielt im Hintergrund weiter und speichert deine Equalizer-Einstellungen für das nächste Mal. Das dunkle, aufgeräumte Design gibt es auf Englisch, Russisch, Deutsch, Japanisch, Litauisch und Chinesisch.</p>
|
<p>Wähle einen Sender und tippe auf Wiedergabe. Fogwave spielt im Hintergrund weiter und speichert deine Equalizer-Einstellungen für das nächste Mal. Das dunkle, aufgeräumte Design gibt es auf Englisch, Russisch, Deutsch, Japanisch, Litauisch und Chinesisch.</p>
|
||||||
|
|||||||
@@ -2,5 +2,7 @@
|
|||||||
• Less stuttering on a weak network
|
• Less stuttering on a weak network
|
||||||
• Smoother equalizer sliders and faster app start
|
• Smoother equalizer sliders and faster app start
|
||||||
• Hopeless streams are no longer retried for minutes
|
• Hopeless streams are no longer retried for minutes
|
||||||
|
• New stations: LRT Radijas, Žinių radijas, Latvijas Radio 1 and 2
|
||||||
|
• View options are now on the Radio tab only
|
||||||
|
|
||||||
New versions are also available on Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
New versions are also available on Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• New design with search and a floating mini player
|
||||||
|
• Player with a round station disc and the title of the song on air
|
||||||
|
• Drifting fog in the color of the playing station
|
||||||
|
• Share the station or song you are listening to
|
||||||
|
|
||||||
|
New versions are also available on Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<p>Bring Lithuania's favorite radio stations along, without the clutter. Fogwave makes it easy to tune in, listen in the background, and enjoy a clean, ad-free experience with no account or tracking required.</p>
|
<p>Bring Lithuania's favorite radio stations along, without the clutter. Fogwave makes it easy to tune in, listen in the background, and enjoy a clean, ad-free experience with no account or tracking required.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Tune in to 10 Lithuanian stations, including ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1, and Gold FM.</li>
|
<li>Tune in to 14 stations from Lithuania and Latvia, including ZIP FM, Power Hit Radio, Rock FM, LRT Radijas, Žinių radijas, and Latvijas Radio.</li>
|
||||||
<li>Keep listening while you use other apps, with controls on your lock screen, notifications, headphones, and Bluetooth.</li>
|
<li>Keep listening while you use other apps, with controls on your lock screen, notifications, headphones, and Bluetooth.</li>
|
||||||
<li>Enjoy your favorite sound with an equalizer, saved settings, loudness boost, and audio presets.</li>
|
<li>Enjoy your favorite sound with an equalizer, saved settings, loudness boost, and audio presets.</li>
|
||||||
<li>Get back to listening easily with auto-reconnect when your stream or network drops.</li>
|
<li>Get back to listening easily with auto-reconnect when your stream or network drops.</li>
|
||||||
<li>Take radio on the road with Android Auto support.</li>
|
<li>Take radio on the road with Android Auto support.</li>
|
||||||
<li>Find stations your way with favorites, recently played stations, genre matches, and four viewing layouts.</li>
|
<li>Find stations your way with search, favorites, recently played and similar stations, and see the song that is on air.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Choose a station and press play. Fogwave keeps audio running in the background and saves your equalizer settings for your next session. Its dark, uncluttered design is available in English, Russian, German, Japanese, Lithuanian, and Chinese.</p>
|
<p>Choose a station and press play. Fogwave keeps audio running in the background and saves your equalizer settings for your next session. Its dark, uncluttered design is available in English, Russian, German, Japanese, Lithuanian, and Chinese.</p>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 784 KiB After Width: | Height: | Size: 639 KiB |
|
Before Width: | Height: | Size: 1020 KiB After Width: | Height: | Size: 794 KiB |
|
Before Width: | Height: | Size: 989 KiB After Width: | Height: | Size: 658 KiB |
|
Before Width: | Height: | Size: 658 KiB After Width: | Height: | Size: 709 KiB |
@@ -2,5 +2,7 @@
|
|||||||
• 電波の弱い場所での途切れを軽減
|
• 電波の弱い場所での途切れを軽減
|
||||||
• イコライザーのスライダーがなめらかになり、起動も高速化
|
• イコライザーのスライダーがなめらかになり、起動も高速化
|
||||||
• 再生できないストリームを何分も再試行しなくなりました
|
• 再生できないストリームを何分も再試行しなくなりました
|
||||||
|
• 新しい局: LRT Radijas、Žinių radijas、Latvijas Radio 1・2
|
||||||
|
• 表示オプションは「ラジオ」タブのみに
|
||||||
|
|
||||||
新しいバージョンは Gitea でも入手できます: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
新しいバージョンは Gitea でも入手できます: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• 新デザイン: 検索とフローティングミニプレーヤー
|
||||||
|
• 円形の局ディスクと放送中の曲名を表示するプレーヤー
|
||||||
|
• 再生中の局の色で漂う霧
|
||||||
|
• 聴いている局や曲を共有できます
|
||||||
|
|
||||||
|
新しいバージョンは Gitea でも入手できます: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<p>リトアニアで人気のラジオ局を、すっきりといつでも。Fogwaveなら簡単に選局でき、バックグラウンドで聴けて、広告なしの快適な体験を楽しめます。アカウント登録もトラッキングもありません。</p>
|
<p>リトアニアで人気のラジオ局を、すっきりといつでも。Fogwaveなら簡単に選局でき、バックグラウンドで聴けて、広告なしの快適な体験を楽しめます。アカウント登録もトラッキングもありません。</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>ZIP FM、Power Hit Radio、Rock FM、Relax FM、M-1、Gold FMなど、リトアニアの10局を収録。</li>
|
<li>ZIP FM、Power Hit Radio、Rock FM、LRT Radijas、Žinių radijas、Latvijas Radioなど、リトアニアとラトビアの14局を収録。</li>
|
||||||
<li>他のアプリを使いながら聴き続けられます。ロック画面、通知、ヘッドホン、Bluetoothから操作可能。</li>
|
<li>他のアプリを使いながら聴き続けられます。ロック画面、通知、ヘッドホン、Bluetoothから操作可能。</li>
|
||||||
<li>イコライザー、設定の保存、ラウドネスブースト、オーディオプリセットで好みの音に。</li>
|
<li>イコライザー、設定の保存、ラウドネスブースト、オーディオプリセットで好みの音に。</li>
|
||||||
<li>ストリームやネットワークが途切れても自動で再接続し、すぐに再生が戻ります。</li>
|
<li>ストリームやネットワークが途切れても自動で再接続し、すぐに再生が戻ります。</li>
|
||||||
<li>Android Autoに対応し、ドライブ中もラジオを。</li>
|
<li>Android Autoに対応し、ドライブ中もラジオを。</li>
|
||||||
<li>お気に入り、最近聴いた局、ジャンルの一致、4種類の表示レイアウトで、自分好みに局を探せます。</li>
|
<li>検索、お気に入り、最近聴いた局、似ている局で自分好みに局を探せます。再生中の曲名も表示します。</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>局を選んで再生するだけ。Fogwaveはバックグラウンドで再生を続け、イコライザー設定を次回まで保存します。ダークで余計なもののないデザインは、英語、ロシア語、ドイツ語、日本語、リトアニア語、中国語に対応しています。</p>
|
<p>局を選んで再生するだけ。Fogwaveはバックグラウンドで再生を続け、イコライザー設定を次回まで保存します。ダークで余計なもののないデザインは、英語、ロシア語、ドイツ語、日本語、リトアニア語、中国語に対応しています。</p>
|
||||||
|
|||||||
@@ -2,5 +2,7 @@
|
|||||||
• Mažiau trūkčiojimų esant silpnam ryšiui
|
• Mažiau trūkčiojimų esant silpnam ryšiui
|
||||||
• Sklandesni ekvalaizerio slankikliai ir greitesnis paleidimas
|
• Sklandesni ekvalaizerio slankikliai ir greitesnis paleidimas
|
||||||
• Nepasiekiami srautai nebebandomi prijungti kelias minutes
|
• Nepasiekiami srautai nebebandomi prijungti kelias minutes
|
||||||
|
• Naujos stotys: LRT Radijas, Žinių radijas, Latvijas Radio 1 ir 2
|
||||||
|
• Rodinio nustatymai liko tik skiltyje „Radijas“
|
||||||
|
|
||||||
Naujos versijos taip pat pasiekiamos Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
Naujos versijos taip pat pasiekiamos Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• Naujas dizainas su paieška ir plaukiojančiu mini grotuvu
|
||||||
|
• Grotuvas su apvaliu stoties disku ir eteryje skambančios dainos pavadinimu
|
||||||
|
• Judantis rūkas grojančios stoties spalva
|
||||||
|
• Galite pasidalinti klausoma stotimi ar daina
|
||||||
|
|
||||||
|
Naujos versijos taip pat pasiekiamos Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<p>Mėgstamiausios Lietuvos radijo stotys visada su jumis – be nereikalingų dalykų. Su Fogwave lengva įsijungti radiją, klausytis fone ir mėgautis švariu klausymu be reklamų, be paskyros ir be sekimo.</p>
|
<p>Mėgstamiausios Lietuvos radijo stotys visada su jumis – be nereikalingų dalykų. Su Fogwave lengva įsijungti radiją, klausytis fone ir mėgautis švariu klausymu be reklamų, be paskyros ir be sekimo.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Klausykitės 10 Lietuvos stočių, tarp jų ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1 ir Gold FM.</li>
|
<li>Klausykitės 14 Lietuvos ir Latvijos stočių, tarp jų ZIP FM, Power Hit Radio, Rock FM, LRT Radijas, Žinių radijas ir Latvijas Radio.</li>
|
||||||
<li>Klausykitės toliau naudodamiesi kitomis programėlėmis – valdykite atkūrimą iš užrakinimo ekrano, pranešimų, ausinių ir per Bluetooth.</li>
|
<li>Klausykitės toliau naudodamiesi kitomis programėlėmis – valdykite atkūrimą iš užrakinimo ekrano, pranešimų, ausinių ir per Bluetooth.</li>
|
||||||
<li>Mėgaukitės mėgstamu skambėjimu su ekvalaizeriu, išsaugomais nustatymais, garsumo stiprinimu ir garso šablonais.</li>
|
<li>Mėgaukitės mėgstamu skambėjimu su ekvalaizeriu, išsaugomais nustatymais, garsumo stiprinimu ir garso šablonais.</li>
|
||||||
<li>Lengvai grįžkite prie klausymo – nutrūkus srautui ar ryšiui programėlė automatiškai prisijungia iš naujo.</li>
|
<li>Lengvai grįžkite prie klausymo – nutrūkus srautui ar ryšiui programėlė automatiškai prisijungia iš naujo.</li>
|
||||||
<li>Pasiimkite radiją į kelionę su Android Auto palaikymu.</li>
|
<li>Pasiimkite radiją į kelionę su Android Auto palaikymu.</li>
|
||||||
<li>Raskite stotis savaip: mėgstamiausios, neseniai klausytos, panašūs žanrai ir keturi rodinio išdėstymai.</li>
|
<li>Raskite stotis savaip: paieška, mėgstamiausios, neseniai klausytos ir panašios stotys, o taip pat dabar skambanti daina.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Pasirinkite stotį ir paspauskite grojimo mygtuką. Fogwave toliau groja fone ir išsaugo ekvalaizerio nustatymus kitam kartui. Tamsus, tvarkingas dizainas prieinamas anglų, rusų, vokiečių, japonų, lietuvių ir kinų kalbomis.</p>
|
<p>Pasirinkite stotį ir paspauskite grojimo mygtuką. Fogwave toliau groja fone ir išsaugo ekvalaizerio nustatymus kitam kartui. Tamsus, tvarkingas dizainas prieinamas anglų, rusų, vokiečių, japonų, lietuvių ir kinų kalbomis.</p>
|
||||||
|
|||||||
@@ -2,5 +2,7 @@
|
|||||||
• Меньше заиканий на слабой сети
|
• Меньше заиканий на слабой сети
|
||||||
• Плавные слайдеры эквалайзера и более быстрый запуск
|
• Плавные слайдеры эквалайзера и более быстрый запуск
|
||||||
• Недоступные потоки больше не переподключаются по несколько минут
|
• Недоступные потоки больше не переподключаются по несколько минут
|
||||||
|
• Новые станции: LRT Radijas, Žinių radijas, Latvijas Radio 1 и 2
|
||||||
|
• Настройки вида остались только на вкладке «Радио»
|
||||||
|
|
||||||
Новые версии также доступны в Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
Новые версии также доступны в Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• Новый дизайн с поиском и плавающим мини-плеером
|
||||||
|
• Плеер с круглым диском станции и названием песни в эфире
|
||||||
|
• Живой туман в цвете играющей станции
|
||||||
|
• Можно поделиться станцией или песней, которую слушаете
|
||||||
|
|
||||||
|
Новые версии также доступны в Gitea: https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<p>Любимые радиостанции Литвы всегда с вами — без лишнего. Fogwave позволяет легко включить радио, слушать его в фоне и наслаждаться чистым прослушиванием без рекламы, аккаунта и отслеживания.</p>
|
<p>Любимые радиостанции Литвы всегда с вами — без лишнего. Fogwave позволяет легко включить радио, слушать его в фоне и наслаждаться чистым прослушиванием без рекламы, аккаунта и отслеживания.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Слушайте 10 литовских станций, включая ZIP FM, Power Hit Radio, Rock FM, Relax FM, M-1 и Gold FM.</li>
|
<li>Слушайте 14 станций Литвы и Латвии, включая ZIP FM, Power Hit Radio, Rock FM, LRT Radijas, Žinių radijas и Latvijas Radio.</li>
|
||||||
<li>Продолжайте слушать в других приложениях, управляя воспроизведением с экрана блокировки, из уведомлений, наушников и по Bluetooth.</li>
|
<li>Продолжайте слушать в других приложениях, управляя воспроизведением с экрана блокировки, из уведомлений, наушников и по Bluetooth.</li>
|
||||||
<li>Настройте звук под себя: эквалайзер, сохранённые настройки, усиление громкости и аудиопресеты.</li>
|
<li>Настройте звук под себя: эквалайзер, сохранённые настройки, усиление громкости и аудиопресеты.</li>
|
||||||
<li>Легко возвращайтесь к прослушиванию: приложение само переподключится, если поток или сеть пропадут.</li>
|
<li>Легко возвращайтесь к прослушиванию: приложение само переподключится, если поток или сеть пропадут.</li>
|
||||||
<li>Берите радио в дорогу благодаря поддержке Android Auto.</li>
|
<li>Берите радио в дорогу благодаря поддержке Android Auto.</li>
|
||||||
<li>Находите станции по-своему: избранное, недавно прослушанные, подбор по жанру и четыре варианта отображения.</li>
|
<li>Находите станции по-своему: поиск, избранное, недавно прослушанные и похожие станции, а также название текущей песни.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Выберите станцию и нажмите кнопку воспроизведения. Fogwave продолжает играть в фоне и сохраняет настройки эквалайзера до следующего раза. Тёмный лаконичный интерфейс доступен на английском, русском, немецком, японском, литовском и китайском.</p>
|
<p>Выберите станцию и нажмите кнопку воспроизведения. Fogwave продолжает играть в фоне и сохраняет настройки эквалайзера до следующего раза. Тёмный лаконичный интерфейс доступен на английском, русском, немецком, японском, литовском и китайском.</p>
|
||||||
|
|||||||
@@ -2,5 +2,7 @@
|
|||||||
• 网络较弱时卡顿更少
|
• 网络较弱时卡顿更少
|
||||||
• 均衡器滑块更流畅,应用启动更快
|
• 均衡器滑块更流畅,应用启动更快
|
||||||
• 无法播放的音频流不再反复重试数分钟
|
• 无法播放的音频流不再反复重试数分钟
|
||||||
|
• 新增电台:LRT Radijas、Žinių radijas、Latvijas Radio 1 和 2
|
||||||
|
• 视图选项现仅在“电台”标签页中
|
||||||
|
|
||||||
新版本也可在 Gitea 获取:https://git.skysparkle.cc/kalarina/Fogwave/releases
|
新版本也可在 Gitea 获取:https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• 全新设计:搜索和悬浮迷你播放器
|
||||||
|
• 播放器带圆形电台唱片并显示正在播放的歌曲名称
|
||||||
|
• 随正在播放电台颜色飘动的雾
|
||||||
|
• 可分享正在收听的电台或歌曲
|
||||||
|
|
||||||
|
新版本也可在 Gitea 获取:https://git.skysparkle.cc/kalarina/Fogwave/releases
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<p>随身携带立陶宛最受欢迎的电台,简洁不杂乱。Fogwave 让你轻松收听、后台播放,享受干净无广告的体验,无需账号,也没有任何跟踪。</p>
|
<p>随身携带立陶宛最受欢迎的电台,简洁不杂乱。Fogwave 让你轻松收听、后台播放,享受干净无广告的体验,无需账号,也没有任何跟踪。</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>收听 10 个立陶宛电台,包括 ZIP FM、Power Hit Radio、Rock FM、Relax FM、M-1 和 Gold FM。</li>
|
<li>收听 14 个立陶宛和拉脱维亚电台,包括 ZIP FM、Power Hit Radio、Rock FM、LRT Radijas、Žinių radijas 和 Latvijas Radio。</li>
|
||||||
<li>使用其他应用时也能继续收听,可通过锁屏、通知、耳机和蓝牙控制播放。</li>
|
<li>使用其他应用时也能继续收听,可通过锁屏、通知、耳机和蓝牙控制播放。</li>
|
||||||
<li>用均衡器、已保存的设置、响度增强和音频预设,调出你喜欢的声音。</li>
|
<li>用均衡器、已保存的设置、响度增强和音频预设,调出你喜欢的声音。</li>
|
||||||
<li>音频流或网络中断时自动重新连接,轻松恢复收听。</li>
|
<li>音频流或网络中断时自动重新连接,轻松恢复收听。</li>
|
||||||
<li>支持 Android Auto,开车也能听电台。</li>
|
<li>支持 Android Auto,开车也能听电台。</li>
|
||||||
<li>按你的方式查找电台:收藏、最近收听、类型匹配,以及四种显示布局。</li>
|
<li>按你的方式查找电台:搜索、收藏、最近收听和相似电台,还能看到正在播放的歌曲。</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>选择电台,点击播放即可。Fogwave 会在后台持续播放,并保存你的均衡器设置供下次使用。深色简洁的界面支持英语、俄语、德语、日语、立陶宛语和中文。</p>
|
<p>选择电台,点击播放即可。Fogwave 会在后台持续播放,并保存你的均衡器设置供下次使用。深色简洁的界面支持英语、俄语、德语、日语、立陶宛语和中文。</p>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ androidx-runner = { group = "androidx.test", name = "runner", version.ref = "run
|
|||||||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||||
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coilCompose" }
|
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coilCompose" }
|
||||||
androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" }
|
androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" }
|
||||||
|
androidx-media3-exoplayer-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" }
|
||||||
androidx-media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "media3" }
|
androidx-media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "media3" }
|
||||||
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
|
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
|
||||||
kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesAndroid" }
|
kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesAndroid" }
|
||||||
|
|||||||