mirror of
https://github.com/kalarina-bit/Fogwave.git
synced 2026-11-22 16:16:09 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d95499b0e9 | ||
|
|
b9e98c8d75 | ||
|
|
f0b3530479 |
@@ -0,0 +1 @@
|
||||
ko_fi: skysparkle
|
||||
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Main repository on git.skysparkle.cc
|
||||
url: https://git.skysparkle.cc/kalarina/Fogwave
|
||||
about: This GitHub repository is a mirror. Issues are welcome here and on Gitea.
|
||||
- name: Support the project on Ko-fi
|
||||
url: https://ko-fi.com/skysparkle
|
||||
about: Donations keep the apps and the Skysparkle server running.
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ Thanks for wanting to help! This guide explains where to contribute, what fits t
|
||||
|
||||
## Where to contribute
|
||||
|
||||
Issues and pull requests go to the repository on [Gitea](https://git.skysparkle.cc/kalarina/Fogwave).
|
||||
Issues and pull requests go to the repository on [GitHub](https://github.com/kalarina-bit/Fogwave).
|
||||
|
||||
## Ways to help
|
||||
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
Listen to Lithuania's favorite stations in one tap.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://ko-fi.com/skysparkle"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support me on Ko-fi"></a>
|
||||
</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).
|
||||
> **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 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).
|
||||
@@ -21,9 +25,8 @@
|
||||
|
||||
<p align="center">
|
||||
<a href="https://f-droid.org/packages/cc.skysparkle.fogwave/"><img src="assets/get-it-on%20(1).png" height="56" alt="Get it on F-Droid"></a>
|
||||
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.skysparkle.cc/kalarina/Fogwave"><img src="assets/badge_obtainium.png" height="56" alt="Get it on Obtainium"></a>
|
||||
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/kalarina-bit/Fogwave"><img src="assets/badge_obtainium.png" height="56" alt="Get it on Obtainium"></a>
|
||||
<a href="https://github.com/kalarina-bit/Fogwave/releases/latest"><img src="assets/get-it-on-github.png" height="56" alt="Get it on GitHub"></a>
|
||||
<a href="https://git.skysparkle.cc/kalarina/Fogwave/releases"><img src="assets/get-it-on-gitea.png" height="56" alt="Get it on Gitea"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
@@ -51,8 +54,8 @@
|
||||
## <img src="assets/icon-install.png" width="32" alt=""> Installation
|
||||
|
||||
- **[F-Droid](https://f-droid.org/packages/cc.skysparkle.fogwave/)** — install and update through the F-Droid client.
|
||||
- **[Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://git.skysparkle.cc/kalarina/Fogwave)** — installs the APK straight from Gitea releases and keeps it up to date.
|
||||
- **Manually** — download the latest APK from [GitHub](https://github.com/kalarina-bit/Fogwave/releases/latest) or [Gitea](https://git.skysparkle.cc/kalarina/Fogwave/releases), allow installs from unknown sources for the app you open it with (Settings → Apps → Special access → Install unknown apps), then open the `.apk` and confirm.
|
||||
- **[Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/kalarina-bit/Fogwave)** — installs the APK straight from GitHub releases and keeps it up to date.
|
||||
- **Manually** — download the latest APK from [GitHub Releases](https://github.com/kalarina-bit/Fogwave/releases/latest), allow installs from unknown sources for the app you open it with (Settings → Apps → Special access → Install unknown apps), then open the `.apk` and confirm.
|
||||
|
||||
## <img src="assets/icon-verify.png" width="32" alt=""> Verifying a download
|
||||
|
||||
@@ -88,7 +91,13 @@ Release builds are signed only when a keystore is supplied through the `KEYSTORE
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
Bug reports, station suggestions, translation fixes and pull requests are welcome in the [issue tracker](https://git.skysparkle.cc/kalarina/Fogwave/issues). Please read [CONTRIBUTING.md](CONTRIBUTING.md) first — it explains what fits the project and how to send changes. To open an issue or a pull request, [create an account](https://git.skysparkle.cc/user/sign_up) on this Gitea.
|
||||
Bug reports, station suggestions, translation fixes and pull requests are welcome in the [issue tracker](https://github.com/kalarina-bit/Fogwave/issues). Please read [CONTRIBUTING.md](CONTRIBUTING.md) first — it explains what fits the project and how to send changes.
|
||||
|
||||
## ☕ Support
|
||||
|
||||
Fogwave is free, open source and has no ads. If it is useful to you, you can support the project on [Ko-fi](https://ko-fi.com/skysparkle) — donations pay for the Skysparkle server and the time spent on the apps.
|
||||
|
||||
<a href="https://ko-fi.com/skysparkle"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Support me on Ko-fi"></a>
|
||||
|
||||
## 📄 License
|
||||
|
||||
|
||||
@@ -14,9 +14,24 @@ data class RadioStation(
|
||||
@param:DrawableRes val iconResId: Int,
|
||||
val genres: List<Genre>,
|
||||
val bitrate: String,
|
||||
val lightBackdrop: Boolean = false
|
||||
val lightBackdrop: Boolean = false,
|
||||
/** FM frequencies in the biggest cities; empty for stations that are only online. */
|
||||
val frequencies: List<FmFrequency> = emptyList(),
|
||||
/** Station website with its shows and schedule. */
|
||||
val website: String? = null
|
||||
)
|
||||
|
||||
/** One FM transmitter: the city and the frequency in MHz. */
|
||||
@Immutable
|
||||
data class FmFrequency(val city: City, val mhz: Double)
|
||||
|
||||
enum class City(@param:StringRes val labelRes: Int) {
|
||||
VILNIUS(R.string.city_vilnius),
|
||||
KAUNAS(R.string.city_kaunas),
|
||||
KLAIPEDA(R.string.city_klaipeda),
|
||||
RIGA(R.string.city_riga)
|
||||
}
|
||||
|
||||
enum class Genre(@param:StringRes val labelRes: Int) {
|
||||
HITS(R.string.genre_hits),
|
||||
POP(R.string.genre_pop),
|
||||
|
||||
@@ -3,6 +3,8 @@ package cc.skysparkle.fogwave.data.repository
|
||||
import android.content.Context
|
||||
import androidx.core.content.edit
|
||||
import cc.skysparkle.fogwave.R
|
||||
import cc.skysparkle.fogwave.data.model.City
|
||||
import cc.skysparkle.fogwave.data.model.FmFrequency
|
||||
import cc.skysparkle.fogwave.data.model.Genre
|
||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -13,6 +15,8 @@ import org.json.JSONArray
|
||||
class RadioRepository(context: Context) {
|
||||
private val prefs = context.getSharedPreferences("fogwave_prefs", Context.MODE_PRIVATE)
|
||||
|
||||
// FM frequencies: Lithuanian stations from the RRT broadcasting licence list (Vilnius, Kaunas,
|
||||
// Klaipėda), Latvian ones for Riga. Other towns are listed on each station's website.
|
||||
val stations: List<RadioStation> = listOf(
|
||||
RadioStation(
|
||||
id = "zip",
|
||||
@@ -21,7 +25,13 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://stream4.radijas.lt/zipfm",
|
||||
iconResId = R.drawable.ic_station_zipfm,
|
||||
genres = listOf(Genre.HITS, Genre.POP, Genre.LITHUANIAN),
|
||||
bitrate = "MP3"
|
||||
bitrate = "MP3",
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 100.1),
|
||||
FmFrequency(City.KAUNAS, 104.1),
|
||||
FmFrequency(City.KLAIPEDA, 92.5)
|
||||
),
|
||||
website = "https://www.zipfm.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "powerhit",
|
||||
@@ -31,7 +41,13 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://stream.rcs.revma.com/f31w7e0fveuvv",
|
||||
iconResId = R.drawable.ic_station_powerhit,
|
||||
genres = listOf(Genre.DANCE, Genre.POP, Genre.HITS),
|
||||
bitrate = "AAC"
|
||||
bitrate = "AAC",
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 95.9),
|
||||
FmFrequency(City.KAUNAS, 91.0),
|
||||
FmFrequency(City.KLAIPEDA, 96.7)
|
||||
),
|
||||
website = "https://powerhitradio.tv3.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "powerhitgold",
|
||||
@@ -40,7 +56,8 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://stream.rcs.revma.com/asdpz3qfbhuvv",
|
||||
iconResId = R.drawable.ic_station_powerhitgold,
|
||||
genres = listOf(Genre.DANCE, Genre.OLDIES, Genre.HITS),
|
||||
bitrate = "AAC"
|
||||
bitrate = "AAC",
|
||||
website = "https://powerhitradio.tv3.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "rock",
|
||||
@@ -50,7 +67,13 @@ class RadioRepository(context: Context) {
|
||||
iconResId = R.drawable.ic_station_rockfm,
|
||||
genres = listOf(Genre.ROCK, Genre.LITHUANIAN),
|
||||
bitrate = "MP3",
|
||||
lightBackdrop = true
|
||||
lightBackdrop = true,
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 87.8),
|
||||
FmFrequency(City.KAUNAS, 90.3),
|
||||
FmFrequency(City.KLAIPEDA, 100.2)
|
||||
),
|
||||
website = "https://rockfm.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "relax",
|
||||
@@ -59,7 +82,13 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://stream4.radijas.lt/relaxfm",
|
||||
iconResId = R.drawable.ic_station_relaxfm,
|
||||
genres = listOf(Genre.EASY_LISTENING),
|
||||
bitrate = "MP3"
|
||||
bitrate = "MP3",
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 96.4),
|
||||
FmFrequency(City.KAUNAS, 98.5),
|
||||
FmFrequency(City.KLAIPEDA, 87.5)
|
||||
),
|
||||
website = "https://www.relaxfm.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "lietus",
|
||||
@@ -69,7 +98,13 @@ class RadioRepository(context: Context) {
|
||||
iconResId = R.drawable.ic_station_lietus,
|
||||
genres = listOf(Genre.LITHUANIAN, Genre.POP),
|
||||
bitrate = "AAC 64 kbps",
|
||||
lightBackdrop = true
|
||||
lightBackdrop = true,
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 103.1),
|
||||
FmFrequency(City.KAUNAS, 103.5),
|
||||
FmFrequency(City.KLAIPEDA, 103.7)
|
||||
),
|
||||
website = "https://www.lietus.fm"
|
||||
),
|
||||
RadioStation(
|
||||
id = "m1",
|
||||
@@ -78,7 +113,13 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://stream.m-1.fm/m1/aacp64",
|
||||
iconResId = R.drawable.ic_station_m1,
|
||||
genres = listOf(Genre.POP, Genre.HITS),
|
||||
bitrate = "AAC 64 kbps"
|
||||
bitrate = "AAC 64 kbps",
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 106.8),
|
||||
FmFrequency(City.KAUNAS, 106.6),
|
||||
FmFrequency(City.KLAIPEDA, 106.5)
|
||||
),
|
||||
website = "https://www.m-1.fm"
|
||||
),
|
||||
RadioStation(
|
||||
id = "plus",
|
||||
@@ -88,7 +129,13 @@ class RadioRepository(context: Context) {
|
||||
iconResId = R.drawable.ic_station_m1plus,
|
||||
genres = listOf(Genre.POP, Genre.OLDIES),
|
||||
bitrate = "AAC 64 kbps",
|
||||
lightBackdrop = true
|
||||
lightBackdrop = true,
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 106.2),
|
||||
FmFrequency(City.KAUNAS, 97.6),
|
||||
FmFrequency(City.KLAIPEDA, 98.3)
|
||||
),
|
||||
website = "https://www.pliusas.fm"
|
||||
),
|
||||
RadioStation(
|
||||
id = "goldfm",
|
||||
@@ -97,7 +144,13 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://stream.goldfm.lt/goldfm.aac",
|
||||
iconResId = R.drawable.ic_station_goldfm,
|
||||
genres = listOf(Genre.OLDIES, Genre.HITS, Genre.LITHUANIAN),
|
||||
bitrate = "AAC"
|
||||
bitrate = "AAC",
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 102.6),
|
||||
FmFrequency(City.KAUNAS, 104.5),
|
||||
FmFrequency(City.KLAIPEDA, 104.1)
|
||||
),
|
||||
website = "https://goldfm.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "rc",
|
||||
@@ -107,7 +160,13 @@ class RadioRepository(context: Context) {
|
||||
iconResId = R.drawable.ic_station_rc,
|
||||
genres = listOf(Genre.HITS, Genre.LITHUANIAN),
|
||||
bitrate = "MP3 128 kbps",
|
||||
lightBackdrop = true
|
||||
lightBackdrop = true,
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 89.6),
|
||||
FmFrequency(City.KAUNAS, 107.1),
|
||||
FmFrequency(City.KLAIPEDA, 101.5)
|
||||
),
|
||||
website = "https://rc.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "lrt",
|
||||
@@ -117,7 +176,13 @@ class RadioRepository(context: Context) {
|
||||
iconResId = R.drawable.ic_station_lrt,
|
||||
genres = listOf(Genre.NEWS_TALK, Genre.LITHUANIAN),
|
||||
bitrate = "MP3",
|
||||
lightBackdrop = true
|
||||
lightBackdrop = true,
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 89.0),
|
||||
FmFrequency(City.KAUNAS, 102.1),
|
||||
FmFrequency(City.KLAIPEDA, 102.8)
|
||||
),
|
||||
website = "https://www.lrt.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "ziniu",
|
||||
@@ -126,7 +191,13 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://netradio.ziniur.lt/ziniur.mp3?n=975355",
|
||||
iconResId = R.drawable.ic_station_ziniu,
|
||||
genres = listOf(Genre.NEWS_TALK),
|
||||
bitrate = "MP3"
|
||||
bitrate = "MP3",
|
||||
frequencies = listOf(
|
||||
FmFrequency(City.VILNIUS, 97.3),
|
||||
FmFrequency(City.KAUNAS, 104.9),
|
||||
FmFrequency(City.KLAIPEDA, 102.2)
|
||||
),
|
||||
website = "https://www.ziniuradijas.lt"
|
||||
),
|
||||
RadioStation(
|
||||
id = "lr1",
|
||||
@@ -135,7 +206,9 @@ class RadioRepository(context: Context) {
|
||||
streamUrl = "https://muste.latvijasradio.lv/shoutcast/mp4:lr1a.stream/playlist.m3u8",
|
||||
iconResId = R.drawable.ic_station_lr1,
|
||||
genres = listOf(Genre.NEWS_TALK),
|
||||
bitrate = "HLS"
|
||||
bitrate = "HLS",
|
||||
frequencies = listOf(FmFrequency(City.RIGA, 90.7)),
|
||||
website = "https://lr1.lsm.lv"
|
||||
),
|
||||
RadioStation(
|
||||
id = "lr2",
|
||||
@@ -144,7 +217,9 @@ class RadioRepository(context: Context) {
|
||||
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"
|
||||
bitrate = "HLS",
|
||||
frequencies = listOf(FmFrequency(City.RIGA, 91.5)),
|
||||
website = "https://lr2.lsm.lv"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ import cc.skysparkle.fogwave.ui.theme.AppThemeState
|
||||
import cc.skysparkle.fogwave.ui.theme.GeoColors
|
||||
import cc.skysparkle.fogwave.ui.theme.LocalGeoColors
|
||||
|
||||
private const val REPOSITORY_URL = "https://git.skysparkle.cc/kalarina/Fogwave"
|
||||
private const val REPOSITORY_URL = "https://github.com/kalarina-bit/Fogwave"
|
||||
private const val DONATE_URL = "https://ko-fi.com/skysparkle"
|
||||
private const val PRIVACY_POLICY_URL = "https://skysparkle.cc/privacy?lang=en"
|
||||
|
||||
@Composable
|
||||
@@ -64,6 +65,7 @@ fun AboutPanel(modifier: Modifier = Modifier) {
|
||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
||||
) {
|
||||
AppHeader()
|
||||
SupportCard(onDonate = { context.openUrl(DONATE_URL) })
|
||||
|
||||
SectionLabel(stringResource(R.string.about_appearance))
|
||||
GroupCard {
|
||||
@@ -168,6 +170,57 @@ private fun AppHeader() {
|
||||
}
|
||||
}
|
||||
|
||||
/** Asks for a donation: the app icon, a short note and one button. */
|
||||
@Composable
|
||||
private fun SupportCard(onDonate: () -> Unit) {
|
||||
val colors = LocalGeoColors.current
|
||||
GroupCard(contentPadding = 16.dp) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(14.dp)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(44.dp)
|
||||
.clip(RoundedCornerShape(14.dp))
|
||||
.background(colors.primaryContainer),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
AppIcon(resId = R.drawable.ic_fogwave_logo, size = 32.dp)
|
||||
}
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
RowTitle(stringResource(R.string.support_title))
|
||||
RowSubtitle(stringResource(R.string.support_text), maxLines = 4)
|
||||
}
|
||||
}
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(top = 14.dp)
|
||||
.fillMaxWidth()
|
||||
.height(46.dp)
|
||||
.clip(CircleShape)
|
||||
.background(colors.accentLavender)
|
||||
.clickable(
|
||||
onClickLabel = stringResource(R.string.about_open_in_browser),
|
||||
role = Role.Button,
|
||||
onClick = onDonate
|
||||
)
|
||||
.testTag("donate_button"),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally)
|
||||
) {
|
||||
AppIcon(resId = R.drawable.ic_heart_fill, tint = colors.onAccentLavender, size = 18.dp)
|
||||
Text(
|
||||
text = stringResource(R.string.support_button),
|
||||
style = MaterialTheme.typography.labelLarge.copy(
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = colors.onAccentLavender
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun StylePicker() {
|
||||
val context = LocalContext.current
|
||||
|
||||
@@ -68,6 +68,7 @@ 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.TextAlign
|
||||
import androidx.compose.ui.text.style.TextDecoration
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.Velocity
|
||||
@@ -529,6 +530,16 @@ private fun ExtraPanel(
|
||||
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_fm), value = stationFrequencies(station))
|
||||
station.website?.let { url ->
|
||||
val context = LocalContext.current
|
||||
InfoLinkRow(
|
||||
key = stringResource(R.string.info_schedule),
|
||||
label = displayHost(url),
|
||||
description = stringResource(R.string.info_open_website),
|
||||
onClick = { context.openUrl(url) }
|
||||
)
|
||||
}
|
||||
InfoRow(
|
||||
key = stringResource(R.string.info_status),
|
||||
value = when (playerState) {
|
||||
@@ -586,6 +597,39 @@ private fun InfoRow(key: String, value: String) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Like [InfoRow], but the value is a link that opens in the browser. */
|
||||
@Composable
|
||||
private fun InfoLinkRow(key: String, label: String, description: String, onClick: () -> Unit) {
|
||||
val colors = LocalGeoColors.current
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.clickable(role = Role.Button, onClickLabel = description, onClick = onClick)
|
||||
.testTag("info_website"),
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = key,
|
||||
style = MaterialTheme.typography.bodySmall.copy(
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = colors.onSurfaceVariant
|
||||
)
|
||||
)
|
||||
Text(
|
||||
text = "$label \u2197",
|
||||
style = MaterialTheme.typography.bodySmall.copy(
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = colors.accentLavender,
|
||||
textAlign = TextAlign.End,
|
||||
textDecoration = TextDecoration.Underline
|
||||
),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Context.shareStation(station: RadioStation, trackTitle: String?) {
|
||||
val text = if (trackTitle != null) {
|
||||
getString(R.string.share_text_track, trackTitle, station.name)
|
||||
|
||||
@@ -7,7 +7,9 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.ReadOnlyComposable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.core.net.toUri
|
||||
import cc.skysparkle.fogwave.R
|
||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||
import java.util.Locale
|
||||
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
@@ -18,6 +20,20 @@ fun stationDescription(station: RadioStation): String = stringResource(station.d
|
||||
fun stationGenres(station: RadioStation): String =
|
||||
station.genres.map { stringResource(it.labelRes) }.joinToString(", ")
|
||||
|
||||
/** FM frequencies one per line («Vilnius · 100.1 MHz»), or «Online only» for internet stations. */
|
||||
@Composable
|
||||
@ReadOnlyComposable
|
||||
fun stationFrequencies(station: RadioStation): String {
|
||||
if (station.frequencies.isEmpty()) return stringResource(R.string.info_fm_online_only)
|
||||
return station.frequencies.map { f ->
|
||||
// Decimal separator of the current language: 100.1 in English, 100,1 in Lithuanian
|
||||
stringResource(R.string.info_fm_line, stringResource(f.city.labelRes), String.format(Locale.getDefault(), "%.1f", f.mhz))
|
||||
}.joinToString("\n")
|
||||
}
|
||||
|
||||
/** Website address without the scheme and «www.», for display: «zipfm.lt». */
|
||||
fun displayHost(url: String): String = url.substringAfter("://").removePrefix("www.").trimEnd('/')
|
||||
|
||||
/** Opens [url] in the user's browser; silently does nothing when no browser is installed. */
|
||||
fun Context.openUrl(url: String) {
|
||||
try {
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
<string name="info_description">Beschreibung</string>
|
||||
<string name="info_genre">Genre</string>
|
||||
<string name="info_quality">Qualität</string>
|
||||
<string name="info_fm">UKW</string>
|
||||
<string name="info_fm_line">%1$s · %2$s MHz</string>
|
||||
<string name="info_fm_online_only">Nur online</string>
|
||||
<string name="info_schedule">Sendungen & Programm</string>
|
||||
<string name="info_open_website">Website des Senders öffnen</string>
|
||||
<string name="city_vilnius">Vilnius</string>
|
||||
<string name="city_kaunas">Kaunas</string>
|
||||
<string name="city_klaipeda">Klaipėda</string>
|
||||
<string name="city_riga">Riga</string>
|
||||
<string name="info_status">Status</string>
|
||||
<string name="status_live">Auf Sendung • Livestream</string>
|
||||
|
||||
@@ -129,4 +138,7 @@
|
||||
<string name="eq_gain_db">%1$s dB</string>
|
||||
<string name="eq_freq_hz">%1$s Hz</string>
|
||||
<string name="eq_freq_khz">%1$s kHz</string>
|
||||
<string name="support_title">Fogwave unterstützen</string>
|
||||
<string name="support_text">Fogwave ist kostenlos, quelloffen und werbefrei. Wenn dir die App gefällt, hilft eine kleine Spende, das Projekt weiterzuführen.</string>
|
||||
<string name="support_button">Auf Ko-fi spenden</string>
|
||||
</resources>
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
<string name="info_description">説明</string>
|
||||
<string name="info_genre">ジャンル</string>
|
||||
<string name="info_quality">音質</string>
|
||||
<string name="info_fm">FM</string>
|
||||
<string name="info_fm_line">%1$s · %2$s MHz</string>
|
||||
<string name="info_fm_online_only">オンラインのみ</string>
|
||||
<string name="info_schedule">番組と放送スケジュール</string>
|
||||
<string name="info_open_website">局のウェブサイトを開く</string>
|
||||
<string name="city_vilnius">ヴィリニュス</string>
|
||||
<string name="city_kaunas">カウナス</string>
|
||||
<string name="city_klaipeda">クライペダ</string>
|
||||
<string name="city_riga">リガ</string>
|
||||
<string name="info_status">状態</string>
|
||||
<string name="status_live">オンエア中 • ライブストリーム</string>
|
||||
|
||||
@@ -128,4 +137,7 @@
|
||||
<string name="eq_gain_db">%1$s dB</string>
|
||||
<string name="eq_freq_hz">%1$s Hz</string>
|
||||
<string name="eq_freq_khz">%1$s kHz</string>
|
||||
<string name="support_title">Fogwave を応援する</string>
|
||||
<string name="support_text">Fogwave は無料・オープンソースで、広告もありません。気に入っていただけたら、少額の寄付がプロジェクトの継続を支えます。</string>
|
||||
<string name="support_button">Ko-fi で寄付する</string>
|
||||
</resources>
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
<string name="info_description">Aprašymas</string>
|
||||
<string name="info_genre">Žanras</string>
|
||||
<string name="info_quality">Kokybė</string>
|
||||
<string name="info_fm">FM</string>
|
||||
<string name="info_fm_line">%1$s · %2$s MHz</string>
|
||||
<string name="info_fm_online_only">Tik internetu</string>
|
||||
<string name="info_schedule">Laidos ir programa</string>
|
||||
<string name="info_open_website">Atidaryti stoties svetainę</string>
|
||||
<string name="city_vilnius">Vilnius</string>
|
||||
<string name="city_kaunas">Kaunas</string>
|
||||
<string name="city_klaipeda">Klaipėda</string>
|
||||
<string name="city_riga">Ryga</string>
|
||||
<string name="info_status">Būsena</string>
|
||||
<string name="status_live">Eteryje • tiesioginė transliacija</string>
|
||||
|
||||
@@ -131,4 +140,7 @@
|
||||
<string name="eq_gain_db">%1$s dB</string>
|
||||
<string name="eq_freq_hz">%1$s Hz</string>
|
||||
<string name="eq_freq_khz">%1$s kHz</string>
|
||||
<string name="support_title">Paremti Fogwave</string>
|
||||
<string name="support_text">Fogwave nemokama, atvirojo kodo ir be reklamų. Jei programėlė patinka, nedidelė auka padeda projektui gyvuoti.</string>
|
||||
<string name="support_button">Paaukoti per Ko-fi</string>
|
||||
</resources>
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
<string name="info_description">Описание</string>
|
||||
<string name="info_genre">Жанр</string>
|
||||
<string name="info_quality">Качество</string>
|
||||
<string name="info_fm">FM</string>
|
||||
<string name="info_fm_line">%1$s · %2$s МГц</string>
|
||||
<string name="info_fm_online_only">Только онлайн</string>
|
||||
<string name="info_schedule">Передачи и расписание</string>
|
||||
<string name="info_open_website">Открыть сайт станции</string>
|
||||
<string name="city_vilnius">Вильнюс</string>
|
||||
<string name="city_kaunas">Каунас</string>
|
||||
<string name="city_klaipeda">Клайпеда</string>
|
||||
<string name="city_riga">Рига</string>
|
||||
<string name="info_status">Статус</string>
|
||||
<string name="status_live">В эфире • прямая трансляция</string>
|
||||
|
||||
@@ -131,4 +140,7 @@
|
||||
<string name="eq_gain_db">%1$s дБ</string>
|
||||
<string name="eq_freq_hz">%1$s Гц</string>
|
||||
<string name="eq_freq_khz">%1$s кГц</string>
|
||||
<string name="support_title">Поддержать Fogwave</string>
|
||||
<string name="support_text">Fogwave бесплатное, с открытым кодом и без рекламы. Если приложение нравится, небольшое пожертвование помогает проекту развиваться.</string>
|
||||
<string name="support_button">Пожертвовать через Ko-fi</string>
|
||||
</resources>
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
<string name="info_description">简介</string>
|
||||
<string name="info_genre">类型</string>
|
||||
<string name="info_quality">音质</string>
|
||||
<string name="info_fm">FM</string>
|
||||
<string name="info_fm_line">%1$s · %2$s MHz</string>
|
||||
<string name="info_fm_online_only">仅限在线</string>
|
||||
<string name="info_schedule">节目与时间表</string>
|
||||
<string name="info_open_website">打开电台网站</string>
|
||||
<string name="city_vilnius">维尔纽斯</string>
|
||||
<string name="city_kaunas">考纳斯</string>
|
||||
<string name="city_klaipeda">克莱佩达</string>
|
||||
<string name="city_riga">里加</string>
|
||||
<string name="info_status">状态</string>
|
||||
<string name="status_live">正在直播 • 实时音频流</string>
|
||||
|
||||
@@ -128,4 +137,7 @@
|
||||
<string name="eq_gain_db">%1$s dB</string>
|
||||
<string name="eq_freq_hz">%1$s Hz</string>
|
||||
<string name="eq_freq_khz">%1$s kHz</string>
|
||||
<string name="support_title">支持 Fogwave</string>
|
||||
<string name="support_text">Fogwave 免费、开源且无广告。如果你喜欢它,一笔小小的捐助能帮助项目持续下去。</string>
|
||||
<string name="support_button">通过 Ko-fi 捐助</string>
|
||||
</resources>
|
||||
|
||||
@@ -38,6 +38,15 @@
|
||||
<string name="info_description">Description</string>
|
||||
<string name="info_genre">Genre</string>
|
||||
<string name="info_quality">Quality</string>
|
||||
<string name="info_fm">FM</string>
|
||||
<string name="info_fm_line">%1$s · %2$s MHz</string>
|
||||
<string name="info_fm_online_only">Online only</string>
|
||||
<string name="info_schedule">Shows & schedule</string>
|
||||
<string name="info_open_website">Open the station\'s website</string>
|
||||
<string name="city_vilnius">Vilnius</string>
|
||||
<string name="city_kaunas">Kaunas</string>
|
||||
<string name="city_klaipeda">Klaipėda</string>
|
||||
<string name="city_riga">Riga</string>
|
||||
<string name="info_status">Status</string>
|
||||
<string name="status_live">On air • Live Stream</string>
|
||||
|
||||
@@ -130,4 +139,7 @@
|
||||
<string name="eq_gain_db">%1$s dB</string>
|
||||
<string name="eq_freq_hz">%1$s Hz</string>
|
||||
<string name="eq_freq_khz">%1$s kHz</string>
|
||||
<string name="support_title">Support Fogwave</string>
|
||||
<string name="support_text">Fogwave is free, open source and has no ads. If you enjoy it, a small donation helps keep the project going.</string>
|
||||
<string name="support_button">Donate on Ko-fi</string>
|
||||
</resources>
|
||||
|
||||
@@ -65,4 +65,15 @@ class RadioRepositoryTest {
|
||||
assertEquals(listOf("lr2", "rc"), sorted.take(2).map { it.id })
|
||||
assertEquals(repository.stations.size, sorted.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun everyStationHasAWebsiteAndValidFmFrequencies() {
|
||||
RadioRepository(context).stations.forEach { station ->
|
||||
assertTrue("${station.id} website", station.website?.startsWith("https://") == true)
|
||||
station.frequencies.forEach { f ->
|
||||
assertTrue("${station.id} ${f.mhz}", f.mhz in 87.5..108.0)
|
||||
}
|
||||
assertEquals("${station.id} cities", station.frequencies.size, station.frequencies.map { it.city }.toSet().size)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 139 KiB |
Reference in New Issue
Block a user