156 Commits

Author SHA1 Message Date
f038e01981 feat(ui): add keyboard shortcut for favouriting stations 2026-03-28 21:03:54 +01:00
f66b5af810 docs(readme): add DEL key alternative for station removal 2026-03-28 20:56:08 +01:00
a6a9daf3a3 docs(readme): add Android TV controls documentation 2026-03-28 20:54:56 +01:00
d79d5e15fa refactor(ui): consolidate keyboard shortcut handling in collection adapter 2026-03-28 20:48:54 +01:00
c3f37092de feat(ui): add keyboard shortcuts for station removal 2026-03-28 20:34:56 +01:00
48d14fecdb style(ui): adjust highlight colors for better contrast
Reduce opacity of focused highlight colors and adjust control highlight colors across all theme variants to improve visual consistency and accessibility. Changes include:
- Lowering alpha values for focused highlights in night themes
- Switching from white-based to black-based highlights in light themes
- Standardizing highlight opacity across API level-specific styles
2026-03-28 20:10:41 +01:00
c8293b1b6d - standardize highlight colors across themes 2026-03-28 19:38:28 +01:00
51c8d5b303 Add rotation animation to playback button for mobile devices 2026-03-28 19:02:38 +01:00
180d5c2218 Set enabled state for stream URI editing preference 2026-03-28 18:55:19 +01:00
391999c406 Update README to mention Android TV support 2026-03-28 18:40:13 +01:00
fb779bd661 Merge remote-tracking branch 'origin/main' 2026-03-28 18:37:07 +01:00
46ebf21c06 Add support for Android TV and update dependencies
*   Implement initial Android TV support, including `LEANBACK_LAUNCHER` intent filter, hardware feature declarations, and television-specific layouts for the player, search results, and dialogs.
*   Add a splash/loading screen for the TV interface and a dedicated `SplashTheme`.
*   Improve DPAD navigation by adding `OnKeyListener` for station cards and allowing focus on internal elements.
*   Update `LayoutHolder` and `PlayerFragment` to handle TV layouts and add previous/next station navigation buttons.
*   Adjust `PreferencesHelper` to disable station editing by default on TV devices.
*   Update `androidx.media3` to v1.10.0, `work-runtime-ktx` to v2.11.2, and add `androidx.leanback` dependency.
*   Bump `versionCode` to 144 and `versionName` to 14.4.
*   Refactor `PlayerService` to simplify sleep timer cancellation logic.
*   Remove stale copyright headers and license comments from several Kotlin files.
2026-03-28 18:36:50 +01:00
Michachatz
2d2d95875f Merge pull request #60 from Michatec/renovate/media3
Update media3 to v1.10.0
2026-03-27 14:12:16 +01:00
renovate[bot]
46e7b905c8 Update media3 to v1.10.0 2026-03-27 12:45:39 +00:00
Michachatz
d033ae6344 Merge pull request #59 from Michatec/renovate/workruntimektx
Update dependency androidx.work:work-runtime-ktx to v2.11.2
2026-03-27 13:45:08 +01:00
renovate[bot]
fc275d349b Update dependency androidx.work:work-runtime-ktx to v2.11.2 2026-03-25 20:25:14 +00:00
Michachatz
4e6f7c7c67 Update gradle-publish.yml to target main branch
Restrict workflow triggers to main branch for push and pull requests.
2026-03-25 07:52:12 +01:00
Michachatz
272d6fd908 Add installation instructions for Radio 2026-03-25 07:36:28 +01:00
Michachatz
4a30828c99 Update README with warning about Google requirements
Added a warning about Google's upcoming requirement for personal identity details for apps on certified Android devices, effective 2026/2027.
2026-03-25 07:35:21 +01:00
Michachatz
963f6e7618 Merge pull request #58 from Michatec/renovate/android-actions-setup-android-4.x
Update android-actions/setup-android action to v4
2026-03-25 07:30:33 +01:00
renovate[bot]
29ead7e1d8 Update android-actions/setup-android action to v4 2026-03-25 01:58:58 +00:00
9140b54a23 Update AndroidManifest to resolve App Link verification issues
- Update `tools:targetApi` from "tiramisu" to "33"
- Set `android:autoVerify="false"` for the MIME-type based intent-filter
- Add `tools:ignore="AppLinkUrlError"` to the wildcard host in the file-extension intent-filter
- Add comments clarifying App Link behavior for playlist links
2026-03-24 17:54:48 +01:00
57c4075f19 - Updated .gitignore 2026-03-24 12:40:25 +01:00
5334b88f1d Refactor code and clean up unused resources
- Replace `suspendCoroutine` with `suspendCancellableCoroutine` in helper classes for better cancellation support.
- Replace `bundleOf` with manual `Bundle` initialization in `MediaControllerExt` and `SettingsFragment`.
- Remove unused constants in `Keys.kt` and redundant `onTerminate` override in `Radio.kt`.
- Clean up syntax and remove semicolons in `MainActivity.kt`.
2026-03-24 12:36:04 +01:00
5978aab0aa - New Version Released.
- Updated the Gradle Structure.
- libs.versions.toml added.
2026-03-24 12:28:15 +01:00
Michachatz
c3c2ccfdd9 Add FreeDroidWarn import to MainActivity 2026-03-24 08:04:30 +01:00
Michachatz
38fb4d162b Change Maven repository URL from jetpack.io to jitpack.io 2026-03-24 08:00:10 +01:00
Michachatz
3c3c18104b Fix case sensitivity in FreeDroidWarn dependency 2026-03-24 07:58:25 +01:00
Michachatz
4e1ee7d6a7 Fix version tag format for FreeDroidWarn dependency 2026-03-24 07:56:42 +01:00
Michachatz
64ba020eae Update FreeDroidWarn dependency version to 1.10 2026-03-24 07:52:22 +01:00
Michachatz
b35d7bd67c Add JitPack and Jetpack repositories to settings 2026-03-24 07:48:05 +01:00
Michachatz
d3dd098639 Remove unused repositories block in build.gradle
Removed unused repositories block from allprojects.
2026-03-24 07:45:59 +01:00
Michachatz
a8f6c7f946 Re-add allprojects block with repositories configuration 2026-03-24 07:43:30 +01:00
Michachatz
765ccc9250 Add JitPack repository configuration
Add JitPack repository to all projects.
2026-03-24 07:41:22 +01:00
Michachatz
c9d6cf27ec Show warning on upgrade in MainActivity 2026-03-24 07:37:04 +01:00
Michachatz
7b7579d416 Add FreeDroidWarn library dependency 2026-03-24 07:34:09 +01:00
Michachatz
d452d7f7ee Merge pull request #57 from Michatec/renovate/gradle-9.x
Update Gradle to v9.4.1
2026-03-19 17:34:25 +01:00
renovate[bot]
2bb3d22cab Update Gradle to v9.4.1 2026-03-19 09:40:18 +00:00
Michachatz
b4ed3e107c Merge pull request #53 from Michatec/renovate/androidx.media3-media3-datasource-okhttp-1.x
Update dependency androidx.media3:media3-datasource-okhttp to v1.9.3
2026-03-17 08:09:16 +01:00
Michachatz
ef843b601a Merge pull request #54 from Michatec/renovate/androidx.media3-media3-exoplayer-1.x
Update dependency androidx.media3:media3-exoplayer to v1.9.3
2026-03-17 08:09:05 +01:00
renovate[bot]
219d54f4e4 Update dependency androidx.media3:media3-exoplayer to v1.9.3 2026-03-17 07:08:20 +00:00
Michachatz
c8a39bf2d7 Merge pull request #55 from Michatec/renovate/androidx.media3-media3-exoplayer-hls-1.x
Update dependency androidx.media3:media3-exoplayer-hls to v1.9.3
2026-03-17 08:07:59 +01:00
renovate[bot]
81ff920c2c Update dependency androidx.media3:media3-exoplayer-hls to v1.9.3 2026-03-17 07:07:36 +00:00
renovate[bot]
f4a5209e14 Update dependency androidx.media3:media3-datasource-okhttp to v1.9.3 2026-03-17 07:07:33 +00:00
Michachatz
c7b7bdcbed Merge pull request #56 from Michatec/renovate/androidx.media3-media3-session-1.x
Update dependency androidx.media3:media3-session to v1.9.3
2026-03-17 08:07:10 +01:00
Michachatz
eae9176f21 Merge pull request #52 from Michatec/renovate/kotlin-monorepo
Update plugin org.jetbrains.kotlin.android to v2.3.20
2026-03-17 08:06:54 +01:00
renovate[bot]
b3a833fa44 Update dependency androidx.media3:media3-session to v1.9.3 2026-03-16 20:52:12 +00:00
renovate[bot]
35a8ed46ff Update plugin org.jetbrains.kotlin.android to v2.3.20 2026-03-16 09:20:44 +00:00
Michachatz
fd18943878 Change copyright year to 2026
Update copyright year in the LICENSE file.
2026-03-13 06:30:07 +01:00
Michachatz
094fb508e2 Merge pull request #51 from Michatec/renovate/androidx.core-core-ktx-1.x
Update dependency androidx.core:core-ktx to v1.18.0
2026-03-13 06:28:00 +01:00
renovate[bot]
874cf1eb39 Update dependency androidx.core:core-ktx to v1.18.0 2026-03-13 05:26:26 +00:00
Michachatz
211cb387ad Merge pull request #50 from Michatec/renovate/androidx.activity-activity-ktx-1.x
Update dependency androidx.activity:activity-ktx to v1.13.0
2026-03-13 06:25:57 +01:00
renovate[bot]
5481a06343 Update dependency androidx.activity:activity-ktx to v1.13.0 2026-03-11 18:10:24 +00:00
fbafcb9773 - New Version Released
- Updated MainActivity.kt
2026-03-08 16:03:28 +01:00
27c405fd58 - Added Daemon Update
- Updated Icons in PlayerService.kt
2026-03-08 15:45:03 +01:00
Michachatz
c2cba26c66 Merge pull request #49 from Michatec/renovate/gradle-9.x
Update Gradle to v9.4.0
2026-03-04 21:15:21 +01:00
renovate[bot]
9224e45b18 Update Gradle to v9.4.0 2026-03-04 13:05:49 +00:00
Michachatz
90164d7e6a Merge pull request #48 from Michatec/renovate/com.android.library-9.x
Update plugin com.android.library to v9.1.0
2026-03-04 07:36:28 +01:00
renovate[bot]
45e208e7a9 Update plugin com.android.library to v9.1.0 2026-03-04 06:35:34 +00:00
Michachatz
1d040e3edc Merge pull request #47 from Michatec/renovate/com.android.application-9.x
Update plugin com.android.application to v9.1.0
2026-03-04 07:35:02 +01:00
renovate[bot]
efe17bc82b Update plugin com.android.application to v9.1.0 2026-03-03 16:37:22 +00:00
Michachatz
8b06309c64 Merge pull request #46 from Michatec/renovate/major-github-artifact-actions
Update actions/upload-artifact action to v7
2026-02-27 09:41:56 +01:00
669fd4683c - Release of 14.1
- Added new features
- Some bug fixes
2026-02-27 09:40:59 +01:00
26b155a721 - Added the Station update button to the SettingsFragment.kt
- Added the strings for the language: german and english
2026-02-27 08:59:04 +01:00
renovate[bot]
99f7863749 Update actions/upload-artifact action to v7 2026-02-26 21:01:43 +00:00
Michachatz
008170811a Update issue templates 2026-02-24 16:26:38 +01:00
Michachatz
c0072fe54f Aktualisieren von gradle-publish.yml 2026-02-24 16:23:14 +01:00
c62c61f2f1 - Removed some old Systems
- Removed some old functions
2026-02-24 14:55:21 +01:00
5ca2b9b7ef - Some Bug fixes
- Remove Code berg icon
- Updated README.md
- Updated AndroidManifest.xml
- Updated Dependencies
- Fix some code
2026-02-24 14:46:03 +01:00
Michatec
9b5c7e3c04 - New version Initialized 2026-01-25 17:07:30 +01:00
Michatec
4466654e92 - Fix unused import 2026-01-25 16:33:45 +01:00
Michatec
b2de7bd534 - Progress Bar added
- CollectionAdapter.kt updated
- File download optimized
- Housekeeping updated
2026-01-25 16:33:17 +01:00
Michatec
d3dfcb98f9 - Layout Changes
- HLS media extraction
2026-01-25 16:08:22 +01:00
Michachatz
0adb906438 Aktualisieren von provider_paths.xml 2026-01-22 06:55:40 +01:00
Michachatz
49e63d3aaa Aktualisieren von shortcuts.xml 2026-01-22 06:55:08 +01:00
Michatec
f892a137ce - Fix .yml 2026-01-21 18:14:38 +01:00
Michatec
364ef3db5d - Fix window over resize. 2026-01-21 17:47:47 +01:00
Michachatz
e22a5463bd Update APK path in gradle-publish workflow 2026-01-21 17:39:09 +01:00
Michatec
51b37d8f7b - Fixing some bug fixes. 2026-01-21 17:10:35 +01:00
Michatec
5412f59f61 - New Version Initialized
- Some deprecated fixes
- New functions and fallbacks
- Some bug fixes
2026-01-21 16:25:37 +01:00
Michachatz
032728626e Merge pull request #26 from Michatec/renovate/com.android.application-9.x
Update plugin com.android.application to v9
2026-01-21 06:50:14 +01:00
renovate[bot]
1daa762c07 Update plugin com.android.application to v9 2026-01-21 05:49:12 +00:00
Michachatz
bcc8af8e57 Merge pull request #27 from Michatec/renovate/com.android.library-9.x
Update plugin com.android.library to v9
2026-01-21 06:48:44 +01:00
Michachatz
c045c03524 Merge pull request #28 from Michatec/renovate/gradle-9.x
Update Gradle to v9.3.0
2026-01-21 06:48:34 +01:00
renovate[bot]
6e32b17b94 Update Gradle to v9.3.0 2026-01-16 15:34:20 +00:00
renovate[bot]
81427d3853 Update plugin com.android.library to v9 2026-01-15 18:52:39 +00:00
Michachatz
9b6b1afa68 Update gradle-publish.yml 2025-12-19 12:34:55 +01:00
Michachatz
cc631c14c4 Update renovate.json 2025-12-19 12:32:57 +01:00
Michachatz
eb55746a2e Merge pull request #25 from Michatec/renovate/gradle-9.x
Update Gradle to v9
2025-12-19 12:29:47 +01:00
renovate[bot]
026b4936f5 Update Gradle to v9 2025-12-19 11:29:13 +00:00
Michachatz
1719b3079c Merge pull request #24 from Michatec/renovate/com.android.library-8.x
Update plugin com.android.library to v8.13.2
2025-12-19 12:26:50 +01:00
renovate[bot]
89f08f284d Update plugin com.android.library to v8.13.2 2025-12-19 11:26:34 +00:00
Michachatz
ba34829de0 Merge pull request #17 from Michatec/renovate/com.android.library-8.x
Update plugin com.android.library to v8.13.2
2025-12-19 12:21:19 +01:00
Michachatz
d797c07656 Merge branch 'main' into renovate/com.android.library-8.x 2025-12-19 12:20:53 +01:00
Michachatz
f9114ebfc9 Merge pull request #16 from Michatec/renovate/com.android.application-8.x
Update plugin com.android.application to v8.13.2
2025-12-19 12:19:40 +01:00
Michachatz
7781868c38 Merge pull request #11 from Michatec/renovate/androidx.media3-media3-exoplayer-hls-1.x
Update dependency androidx.media3:media3-exoplayer-hls to v1.9.0
2025-12-19 12:19:25 +01:00
Michachatz
c9c303df6e Merge pull request #9 from Michatec/renovate/androidx.media3-media3-datasource-okhttp-1.x
Update dependency androidx.media3:media3-datasource-okhttp to v1.9.0
2025-12-19 12:19:11 +01:00
Michachatz
34971d4ea4 Merge pull request #6 from Michatec/renovate/androidx.navigation-navigation-ui-ktx-2.x
Update dependency androidx.navigation:navigation-ui-ktx to v2.9.6
2025-12-19 12:18:57 +01:00
Michachatz
aa86fee1df Merge pull request #7 from Michatec/renovate/com.google.code.gson-gson-2.x
Update dependency com.google.code.gson:gson to v2.13.2
2025-12-19 12:18:42 +01:00
Michachatz
282e83acae Merge pull request #18 from Michatec/renovate/kotlin-monorepo
Update plugin org.jetbrains.kotlin.android to v2.3.0
2025-12-19 12:18:27 +01:00
renovate[bot]
2fa6f9f368 Update dependency androidx.media3:media3-exoplayer-hls to v1.9.0 2025-12-19 11:18:25 +00:00
renovate[bot]
1abcc04c72 Update dependency androidx.media3:media3-datasource-okhttp to v1.9.0 2025-12-19 11:18:22 +00:00
renovate[bot]
a478aef494 Update dependency com.google.code.gson:gson to v2.13.2 2025-12-19 11:18:19 +00:00
renovate[bot]
68f0829a2f Update dependency androidx.navigation:navigation-ui-ktx to v2.9.6 2025-12-19 11:18:17 +00:00
Michachatz
4dfcb13e6c Merge pull request #19 from Michatec/renovate/actions-cache-5.x
Update actions/cache action to v5
2025-12-19 12:18:12 +01:00
Michachatz
e8fae6571c Merge pull request #20 from Michatec/renovate/actions-checkout-6.x
Update actions/checkout action to v6
2025-12-19 12:17:45 +01:00
Michachatz
f1b1275e9d Merge pull request #21 from Michatec/renovate/actions-setup-java-5.x
Update actions/setup-java action to v5
2025-12-19 12:17:33 +01:00
Michachatz
3741b7ec97 Merge pull request #22 from Michatec/renovate/major-github-artifact-actions
Update GitHub Artifact Actions (major)
2025-12-19 12:17:15 +01:00
Michachatz
bc1b3e5835 Merge pull request #15 from Michatec/renovate/gradle-8.x
Update Gradle to v8.14.3
2025-12-19 12:16:52 +01:00
renovate[bot]
d850df3b4e Update GitHub Artifact Actions 2025-12-19 11:16:31 +00:00
renovate[bot]
17851e36b8 Update actions/setup-java action to v5 2025-12-19 11:16:27 +00:00
renovate[bot]
a8e7ea6ea9 Update actions/checkout action to v6 2025-12-19 11:16:24 +00:00
Michachatz
abdf9f7fb6 Merge pull request #8 from Michatec/renovate/androidx.activity-activity-ktx-1.x
Update dependency androidx.activity:activity-ktx to v1.12.2
2025-12-19 12:16:23 +01:00
renovate[bot]
8edfb975a8 Update actions/cache action to v5 2025-12-19 11:16:21 +00:00
renovate[bot]
b3882dd97b Update plugin org.jetbrains.kotlin.android to v2.3.0 2025-12-19 11:16:15 +00:00
renovate[bot]
18c7c5e261 Update plugin com.android.library to v8.13.2 2025-12-19 11:16:12 +00:00
renovate[bot]
41db8e6446 Update plugin com.android.application to v8.13.2 2025-12-19 11:16:09 +00:00
renovate[bot]
fdd0eb02c9 Update Gradle to v8.14.3 2025-12-19 11:16:05 +00:00
Michachatz
bc10527af0 Merge pull request #10 from Michatec/renovate/androidx.media3-media3-exoplayer-1.x
Update dependency androidx.media3:media3-exoplayer to v1.9.0
2025-12-19 12:16:00 +01:00
Michachatz
c44d51bc53 Merge pull request #12 from Michatec/renovate/androidx.media3-media3-session-1.x
Update dependency androidx.media3:media3-session to v1.9.0
2025-12-19 12:15:20 +01:00
Michachatz
4068c5363c Merge pull request #13 from Michatec/renovate/androidx.work-work-runtime-ktx-2.x
Update dependency androidx.work:work-runtime-ktx to v2.11.0
2025-12-19 12:15:03 +01:00
Michachatz
26619b6ead Merge pull request #14 from Michatec/renovate/com.google.android.material-material-1.x
Update dependency com.google.android.material:material to v1.13.0
2025-12-19 12:14:08 +01:00
renovate[bot]
cc174c7d15 Update dependency com.google.android.material:material to v1.13.0 2025-12-19 11:13:28 +00:00
renovate[bot]
a5281ca0ec Update dependency androidx.work:work-runtime-ktx to v2.11.0 2025-12-19 11:13:25 +00:00
renovate[bot]
0365952276 Update dependency androidx.media3:media3-session to v1.9.0 2025-12-19 11:13:21 +00:00
renovate[bot]
e327cd036f Update dependency androidx.media3:media3-exoplayer to v1.9.0 2025-12-19 11:13:14 +00:00
renovate[bot]
45cb807ee2 Update dependency androidx.activity:activity-ktx to v1.12.2 2025-12-19 11:13:06 +00:00
Michachatz
b18b1803b7 Merge pull request #3 from Michatec/renovate/androidx.navigation-navigation-fragment-ktx-2.x
Update dependency androidx.navigation:navigation-fragment-ktx to v2.9.6
2025-12-19 12:07:21 +01:00
Michachatz
cda4970c5d Merge pull request #2 from Michatec/renovate/androidx.media-media-1.x
Update dependency androidx.media:media to v1.7.1
2025-12-19 12:05:54 +01:00
renovate[bot]
209f26cca8 Update dependency androidx.navigation:navigation-fragment-ktx to v2.9.6 2025-12-19 11:02:21 +00:00
renovate[bot]
1ff6c4e791 Update dependency androidx.media:media to v1.7.1 2025-12-19 11:02:18 +00:00
Michachatz
1bb6794ced Merge pull request #1 from Michatec/renovate/configure
Configure Renovate
2025-12-19 12:01:42 +01:00
renovate[bot]
147e308711 Add renovate.json 2025-12-12 07:50:21 +00:00
Michatec
26cb5cda08 Fix Version name
- and my mistake.
2025-06-11 18:00:12 +02:00
Michatec
6a74e64e87 Versionscode Bug Fixed 2025-06-11 17:52:16 +02:00
Michatec
efa03f7529 New version coming 13 2025-06-11 17:43:36 +02:00
Michatec
0a56971fa2 Some Bugfixes and Improvments
- Update the libary gson.
- Deleted some unuseful Code.
- added some locals to locales config.
2025-06-11 17:36:47 +02:00
Michachatz
5ecbede8b5 Update gradle-publish.yml 2025-06-09 14:51:51 +02:00
Michachatz
f99b1fc54b Update gradle-publish.yml 2025-06-09 14:37:46 +02:00
Michachatz
c2b28fd6ec Update build.gradle
- Deleted
2025-06-09 13:50:08 +02:00
Michachatz
b8fedbf832 Update build.gradle 2025-06-09 13:44:31 +02:00
Michachatz
890c91d4e3 Update gradle-publish.yml 2025-06-09 13:43:49 +02:00
Michachatz
41785d03f0 Update gradle-publish.yml 2025-06-09 13:38:22 +02:00
Michachatz
0c1f59d98d Update gradle-publish.yml 2025-06-09 13:28:17 +02:00
Michachatz
43adf31b6d Update gradle-publish.yml 2025-06-09 12:28:47 +02:00
Michachatz
4bb8df555c Update gradle-publish.yml 2025-06-09 12:26:34 +02:00
Michachatz
a649daf387 Update gradle-publish.yml 2025-06-09 12:19:29 +02:00
Michachatz
ed098aa8a7 Create gradle-publish.yml 2025-06-09 12:14:25 +02:00
Michatec
66943767ed Fix French Translation
Fix some bugs with the French Translation.
2025-05-22 19:46:01 +02:00
Michatec
9aeaae0127 Fix some Translation bugs 2025-05-22 19:39:51 +02:00
Michatec
97427f77ec Add French Tranlation
Add French Translation
2025-05-22 19:29:19 +02:00
Michatec
aff78032dd Add Danish Translation
Add Danish Translation.
2025-05-22 19:27:12 +02:00
Michatec
4367ef52ec Add japanese Translation
Add japanese Translation.
2025-05-22 19:22:58 +02:00
Michatec
88420b2cbf Update the libary
- Google Material
- Androidx ktx, media3, navigiation, work runtime
- Kotlin
- new version coming "Purple"
- some bug fixes
2025-05-22 19:08:24 +02:00
Michachatz
53b38cb986 Update Transistor Link 2025-04-27 23:52:41 +02:00
Michachatz
4cd17c5d2d Update README.md 2025-04-27 23:47:00 +02:00
76 changed files with 2187 additions and 905 deletions

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

75
.github/workflows/gradle-publish.yml vendored Normal file
View File

@@ -0,0 +1,75 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build and publish APK
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
ANDROID_HOME: /usr/local/lib/android/sdk/
APK_PATH: app/build/outputs/apk/release/Radio.apk
APKSIGNER: /usr/local/lib/android/sdk/build-tools/34.0.0/apksigner
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JDK
uses: actions/setup-java@v5
with:
java-version: 17
distribution: adopt
cache: gradle
- name: Cache Android SDK
#id: cache-android-sdk
uses: actions/cache@v5
with:
path: ${{ env.ANDROID_HOME }}
key: ${{ runner.os }}-android-sdk
- name: Setup Android SDK
## It is not necessary to check for cache hit as it
## will not download Android SDK again
#if: steps.cache-android-sdk.outputs.cache-hit != 'true'
uses: android-actions/setup-android@v4
with:
packages: ''
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build unsigned APK
run: ./gradlew --no-daemon assembleRelease
- name: Check APK path
run: ls -R app/build/outputs/apk
- name: Zipalign APK
run: |
/usr/local/lib/android/sdk/build-tools/34.0.0/zipalign -v -p 4 ${{ env.APK_PATH }} app-release-aligned.apk
- name: Sign APK
env:
SIGN_CERT: ${{ secrets.SIGN_CERT }}
SIGN_KEY: ${{ secrets.SIGN_KEY }}
run: |
echo "$SIGN_CERT" | base64 -d > cert.der
echo "$SIGN_KEY" | base64 -d > key.der
${{ env.APKSIGNER }} sign --key key.der --cert cert.der app-release-aligned.apk
rm cert.der key.der
mv app-release-aligned.apk app-release.apk
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: app-release
path: app-release.apk

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@
/.idea /.idea
/build /build
/captures /captures
/gradle/gradle-daemon-jvm.properties
/.kotlin

View File

@@ -1,7 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
===================== =====================
Copyright (c) 2025 - Michatec Copyright (c) 2026 - Michatec
-------------------------------- --------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@@ -3,6 +3,7 @@
### About Radio ### About Radio
**Radio is an application with a minimalist approach to listening to radio over the Internet.** <br> **Radio is an application with a minimalist approach to listening to radio over the Internet.** <br>
**Radio only offers a very basic search option, and it imports audio streaming links when you tap them in a web browser.** <br> **Radio only offers a very basic search option, and it imports audio streaming links when you tap them in a web browser.** <br>
**Radio now also supports Android TV (Beta).** <br>
**Pull request are welcome at any time.**<br> **Pull request are welcome at any time.**<br>
**Radio is free software. It is released under the [MIT open source license](https://opensource.org/licenses/MIT).** **Radio is free software. It is released under the [MIT open source license](https://opensource.org/licenses/MIT).**
@@ -10,10 +11,23 @@
---------------------------------------- ----------------------------------------
<details>
<summary>❗Warning</summary>
<br>
<p>
Google has announced that, starting in 2026/2027, all apps on certified Android devices will require the developer to submit personal identity details directly to Google.
Since the developers of this app do not agree to this requirement, this app will no longer work on certified Android devices after that time.
</p>
<a href="https://github.com/woheller69/FreeDroidWarn"> More Information</a>
</details>
----------------------------------------
<details> <details>
<summary>⚙️ Install Radio</summary> <summary>⚙️ Install Radio</summary>
<br> <br>
<a href="https://github.com/michatec/Radio/releases/latest"><img src="https://user-images.githubusercontent.com/15986930/229208526-e5a63be5-0d0b-48ab-a222-9f2f2faf0ee4.png" height="80px"></a> <a href="https://github.com/michatec/Radio/releases/latest"><img src="https://user-images.githubusercontent.com/15986930/229208526-e5a63be5-0d0b-48ab-a222-9f2f2faf0ee4.png" alt="Preview" height="80px"></a>
</details> </details>
---------------------------------------- ----------------------------------------
@@ -57,10 +71,26 @@ You can help out the radio-browser.info community by [adding the missing station
---------------------------------------- ----------------------------------------
<details>
<summary>📺 Android TV Controls</summary>
<br>
When **Edit Stations** is enabled:
- Press **← (Left)** on the remote to open the detailed station editing area
- Press **2** or **Back** to close the editing area
**General TV** Controls:
- Press **0** or **DEL** to remove the selected radio station
- Press **1** or **SPACE** to make the selected radio station favourite
</details>
----------------------------------------
<details> <details>
<summary>📜️ Credit</summary> <summary>📜️ Credit</summary>
Base app Michatec. Base app Michatec & [TRANSISTOR](https://codeberg.org/y20k/transistor).
</details> </details>
<div align="right"> <div align="right">

View File

@@ -1,19 +1,27 @@
apply plugin: 'com.android.application' plugins {
apply plugin: 'kotlin-android' alias libs.plugins.android.application
apply plugin: 'kotlin-parcelize' id 'kotlin-parcelize'
}
androidComponents {
onVariants(selector().all()) { variant ->
variant.outputs.forEach { output ->
output.outputFileName.set("Radio.apk")
}
}
}
android { android {
namespace 'com.michatec.radio' namespace 'com.michatec.radio'
compileSdk 34 compileSdk 36
defaultConfig { defaultConfig {
applicationId 'com.michatec.radio' applicationId 'com.michatec.radio'
minSdk 23 minSdk 28
targetSdk 34 targetSdk 36
versionCode 128 versionCode 144
versionName '12.8' versionName '14.4'
resourceConfigurations += ['en', 'de', 'el', 'nl', 'pl', 'ru','uk'] resourceConfigurations += ['en', 'de', 'el', 'nl', 'pl', 'ru','uk', 'ja', 'da', 'fr']
setProperty('archivesBaseName', 'Radio_' + versionName)
} }
compileOptions { compileOptions {
@@ -47,22 +55,27 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
// Google Stuff // // Google Stuff //
implementation 'com.google.android.material:material:1.10.0' implementation libs.material
implementation 'com.google.code.gson:gson:2.10.1' implementation libs.gson
// AndroidX Stuff // // AndroidX Stuff //
implementation 'androidx.activity:activity-ktx:1.8.1' implementation libs.core.ktx
implementation 'androidx.palette:palette-ktx:1.0.0' implementation libs.activity.ktx
implementation 'androidx.preference:preference-ktx:1.2.1' implementation libs.palette.ktx
implementation 'androidx.media:media:1.7.0' implementation libs.preference.ktx
implementation 'androidx.media3:media3-exoplayer:1.2.0' implementation libs.media
implementation 'androidx.media3:media3-exoplayer-hls:1.2.0' implementation libs.media3.exoplayer
implementation 'androidx.media3:media3-session:1.2.0' implementation libs.media3.exoplayer.hls
implementation 'androidx.media3:media3-datasource-okhttp:1.2.0' implementation libs.media3.session
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5' implementation libs.media3.datasource.okhttp
implementation 'androidx.navigation:navigation-ui-ktx:2.7.5' implementation libs.navigation.fragment.ktx
implementation 'androidx.work:work-runtime-ktx:2.9.0' implementation libs.navigation.ui.ktx
implementation libs.work.runtime.ktx
implementation libs.leanback
implementation libs.freedroidwarn
// Volley HTTP request // // Volley HTTP request //
implementation 'com.android.volley:volley:1.2.1' implementation libs.volley
implementation libs.material3
} }

View File

@@ -1,6 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
@@ -10,6 +17,7 @@
<application <application
android:name=".Radio" android:name=".Radio"
android:allowBackup="true" android:allowBackup="true"
android:banner="@mipmap/ic_launcher"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
@@ -21,7 +29,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:targetApi="tiramisu"> tools:targetApi="33">
<!-- ANDROID AUTO SUPPORT --> <!-- ANDROID AUTO SUPPORT -->
<!-- https://developer.android.com/training/auto/audio/ --> <!-- https://developer.android.com/training/auto/audio/ -->
@@ -32,17 +40,19 @@
android:name="com.google.android.gms.car.notification.SmallIcon" android:name="com.google.android.gms.car.notification.SmallIcon"
android:resource="@mipmap/ic_launcher" /> android:resource="@mipmap/ic_launcher" />
<!-- Main activity for radio station playback on phone --> <!-- Main activity for radio station playback on phone and TV -->
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:windowSoftInputMode="adjustPan" android:windowSoftInputMode="adjustPan"
android:theme="@style/SplashTheme"
android:exported="true"> android:exported="true">
<!-- react to main intents --> <!-- react to main intents -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter> </intent-filter>
<!-- react to be recognized as a music player --> <!-- react to be recognized as a music player -->
@@ -58,7 +68,8 @@
</intent-filter> </intent-filter>
<!-- react to playlist-links based on file extension --> <!-- react to playlist-links based on file extension -->
<intent-filter> <!-- This is intended as an App Link for specific extensions -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
@@ -66,14 +77,16 @@
<data android:scheme="http" /> <data android:scheme="http" />
<data android:scheme="https" /> <data android:scheme="https" />
<data android:host="*" /> <data android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern=".*\\.m3u" /> <data android:pathPattern=".*\\.m3u" />
<data android:pathPattern=".*\\.m3u8" /> <data android:pathPattern=".*\\.m3u8" />
<data android:pathPattern=".*\\.pls" /> <data android:pathPattern=".*\\.pls" />
</intent-filter> </intent-filter>
<!-- react to playlist-links based on mimetype --> <!-- react to playlist-links based on mimetype -->
<intent-filter> <!-- Note: MIME types prevent strict App Link verification, but are kept as requested -->
<intent-filter android:autoVerify="false">
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
@@ -81,7 +94,8 @@
<data android:scheme="http" /> <data android:scheme="http" />
<data android:scheme="https" /> <data android:scheme="https" />
<data android:host="*" /> <data android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:mimeType="audio/x-scpls" /> <data android:mimeType="audio/x-scpls" />
<data android:mimeType="audio/mpegurl" /> <data android:mimeType="audio/mpegurl" />
<data android:mimeType="audio/x-mpegurl" /> <data android:mimeType="audio/x-mpegurl" />

View File

@@ -1,17 +1,3 @@
/*
* Keys.kt
* Implements the keys used throughout the app
* This object hosts all keys used to control Radio state
*
* This file is part of
* TRANSISTOR - Radio App for Android
*
* Copyright (c) 2015-22 - Y20K.org
* Licensed under the MIT-License
* http://opensource.org/licenses/MIT
*/
package com.michatec.radio package com.michatec.radio
import java.util.* import java.util.*
@@ -60,7 +46,6 @@ object Keys {
// preferences // preferences
const val PREF_RADIO_BROWSER_API: String = "RADIO_BROWSER_API" const val PREF_RADIO_BROWSER_API: String = "RADIO_BROWSER_API"
const val PREF_ONE_TIME_HOUSEKEEPING_NECESSARY: String = "ONE_TIME_HOUSEKEEPING_NECESSARY_VERSIONCODE_95" // increment to current app version code to trigger housekeeping that runs only once
const val PREF_THEME_SELECTION: String = "THEME_SELECTION" const val PREF_THEME_SELECTION: String = "THEME_SELECTION"
const val PREF_LAST_UPDATE_COLLECTION: String = "LAST_UPDATE_COLLECTION" const val PREF_LAST_UPDATE_COLLECTION: String = "LAST_UPDATE_COLLECTION"
const val PREF_COLLECTION_SIZE: String = "COLLECTION_SIZE" const val PREF_COLLECTION_SIZE: String = "COLLECTION_SIZE"
@@ -79,7 +64,6 @@ object Keys {
// default const values // default const values
const val DEFAULT_SIZE_OF_METADATA_HISTORY: Int = 25 const val DEFAULT_SIZE_OF_METADATA_HISTORY: Int = 25
const val DEFAULT_MAX_LENGTH_OF_METADATA_ENTRY: Int = 127 const val DEFAULT_MAX_LENGTH_OF_METADATA_ENTRY: Int = 127
const val DEFAULT_DOWNLOAD_OVER_MOBILE: Boolean = false
const val ACTIVE_DOWNLOADS_EMPTY: String = "zero" const val ACTIVE_DOWNLOADS_EMPTY: String = "zero"
const val DEFAULT_MAX_RECONNECTION_COUNT: Int = 30 const val DEFAULT_MAX_RECONNECTION_COUNT: Int = 30
const val LARGE_BUFFER_SIZE_MULTIPLIER: Int = 8 const val LARGE_BUFFER_SIZE_MULTIPLIER: Int = 8
@@ -138,7 +122,7 @@ object Keys {
const val FOLDER_AUDIO: String = "audio" const val FOLDER_AUDIO: String = "audio"
const val FOLDER_IMAGES: String = "images" const val FOLDER_IMAGES: String = "images"
const val FOLDER_TEMP: String = "temp" const val FOLDER_TEMP: String = "temp"
const val URLRADIO_LEGACY_FOLDER_COLLECTION: String = "Collection" const val RADIO_LEGACY_FOLDER_COLLECTION: String = "Collection"
// file names and extensions // file names and extensions
const val COLLECTION_FILE: String = "collection.json" const val COLLECTION_FILE: String = "collection.json"
@@ -150,9 +134,6 @@ object Keys {
const val RADIO_BROWSER_API_BASE: String = "all.api.radio-browser.info" const val RADIO_BROWSER_API_BASE: String = "all.api.radio-browser.info"
const val RADIO_BROWSER_API_DEFAULT: String = "de1.api.radio-browser.info" const val RADIO_BROWSER_API_DEFAULT: String = "de1.api.radio-browser.info"
// locations
const val LOCATION_DEFAULT_STATION_IMAGE: String = "android.resource://com.michatec.radio/drawable/ic_default_station_image_24dp"
// sizes (in dp) // sizes (in dp)
const val SIZE_STATION_IMAGE_CARD: Int = 72 const val SIZE_STATION_IMAGE_CARD: Int = 72
const val SIZE_STATION_IMAGE_MAXIMUM: Int = 640 const val SIZE_STATION_IMAGE_MAXIMUM: Int = 640

View File

@@ -15,7 +15,11 @@
package com.michatec.radio package com.michatec.radio
import android.content.SharedPreferences import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.navigation.fragment.NavHostFragment import androidx.navigation.fragment.NavHostFragment
@@ -24,9 +28,8 @@ import androidx.navigation.ui.NavigationUI
import androidx.navigation.ui.navigateUp import androidx.navigation.ui.navigateUp
import com.michatec.radio.helpers.AppThemeHelper import com.michatec.radio.helpers.AppThemeHelper
import com.michatec.radio.helpers.FileHelper import com.michatec.radio.helpers.FileHelper
import com.michatec.radio.helpers.ImportHelper
import com.michatec.radio.helpers.PreferencesHelper import com.michatec.radio.helpers.PreferencesHelper
import org.woheller69.freeDroidWarn.FreeDroidWarn
/* /*
* MainActivity class * MainActivity class
@@ -39,19 +42,11 @@ class MainActivity : AppCompatActivity() {
/* Overrides onCreate from AppCompatActivity */ /* Overrides onCreate from AppCompatActivity */
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
// house-keeping: determine if edit stations is enabled by default todo: remove in 2023 // Free Android
if (PreferencesHelper.isHouseKeepingNecessary()) { FreeDroidWarn.showWarningOnUpgrade(this, BuildConfig.VERSION_CODE)
// house-keeping 1: remove hard coded default image
ImportHelper.removeDefaultStationImageUris(this)
// house-keeping 2: if existing user detected, enable Edit Stations by default
if (PreferencesHelper.loadCollectionSize() != -1) {
// existing user detected - enable Edit Stations by default
PreferencesHelper.saveEditStationsEnabled(true)
}
PreferencesHelper.saveHouseKeepingNecessaryState()
}
// set up views // set up views
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
@@ -68,11 +63,30 @@ class MainActivity : AppCompatActivity() {
NavigationUI.setupWithNavController(toolbar, navController, appBarConfiguration) NavigationUI.setupWithNavController(toolbar, navController, appBarConfiguration)
supportActionBar?.hide() supportActionBar?.hide()
// TV-specific loading logic
if (packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
Handler(Looper.getMainLooper()).postDelayed({
findViewById<View>(R.id.loading_layout)?.visibility = View.GONE
}, 1500)
} else {
findViewById<View>(R.id.loading_layout)?.visibility = View.GONE
}
// register listener for changes in shared preferences // register listener for changes in shared preferences
PreferencesHelper.registerPreferenceChangeListener(sharedPreferenceChangeListener) PreferencesHelper.registerPreferenceChangeListener(sharedPreferenceChangeListener)
} }
/* Overrides onResume from AppCompatActivity */
override fun onResume() {
try {
super.onResume()
} catch (_: ClassCastException) {
// Do nothing
}
}
/* Overrides onSupportNavigateUp from AppCompatActivity */ /* Overrides onSupportNavigateUp from AppCompatActivity */
override fun onSupportNavigateUp(): Boolean { override fun onSupportNavigateUp(): Boolean {
// Taken from: https://developer.android.com/guide/navigation/navigation-ui#action_bar // Taken from: https://developer.android.com/guide/navigation/navigation-ui#action_bar

View File

@@ -32,6 +32,7 @@ import androidx.activity.OnBackPressedCallback
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.PickVisualMediaRequest import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.OptIn
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.net.toUri import androidx.core.net.toUri
@@ -40,6 +41,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.media3.common.MediaItem import androidx.media3.common.MediaItem
import androidx.media3.common.PlaybackException import androidx.media3.common.PlaybackException
import androidx.media3.common.Player import androidx.media3.common.Player
import androidx.media3.common.util.UnstableApi
import androidx.media3.session.MediaController import androidx.media3.session.MediaController
import androidx.media3.session.SessionResult import androidx.media3.session.SessionResult
import androidx.media3.session.SessionToken import androidx.media3.session.SessionToken
@@ -180,8 +182,7 @@ class PlayerFragment : Fragment(),
(activity as AppCompatActivity).supportActionBar?.hide() (activity as AppCompatActivity).supportActionBar?.hide()
// set the same background color of the player sheet for the navigation bar // set the same background color of the player sheet for the navigation bar
(activity as AppCompatActivity).window.navigationBarColor = ContextCompat.getColor(requireActivity(), R.color.player_sheet_background) requireActivity().window.navigationBarColor = ContextCompat.getColor(requireActivity(), R.color.player_sheet_background)
// associate the ItemTouchHelper with the RecyclerView // associate the ItemTouchHelper with the RecyclerView
itemTouchHelper = ItemTouchHelper(ItemTouchHelperCallback()) itemTouchHelper = ItemTouchHelper(ItemTouchHelperCallback())
itemTouchHelper?.attachToRecyclerView(layout.recyclerView) itemTouchHelper?.attachToRecyclerView(layout.recyclerView)
@@ -209,14 +210,14 @@ class PlayerFragment : Fragment(),
} }
override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
val fromPosition = viewHolder.adapterPosition val fromPosition = viewHolder.bindingAdapterPosition
val toPosition = target.adapterPosition val toPosition = target.bindingAdapterPosition
collectionAdapter.onItemMove(fromPosition, toPosition) collectionAdapter.onItemMove(fromPosition, toPosition)
return true return true
} }
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
val position = viewHolder.adapterPosition val position = viewHolder.bindingAdapterPosition
collectionAdapter.onItemDismiss(position) collectionAdapter.onItemDismiss(position)
} }
@@ -264,7 +265,7 @@ class PlayerFragment : Fragment(),
// handle navigation arguments // handle navigation arguments
handleNavigationArguments() handleNavigationArguments()
// // handle start intent - if started via tap on rss link // // handle start intent - if started via tap on rss link
// handleStartIntent() handleStartIntent()
// start watching for changes in shared preferences // start watching for changes in shared preferences
PreferencesHelper.registerPreferenceChangeListener(this as SharedPreferences.OnSharedPreferenceChangeListener) PreferencesHelper.registerPreferenceChangeListener(this as SharedPreferences.OnSharedPreferenceChangeListener)
} }
@@ -395,6 +396,7 @@ class PlayerFragment : Fragment(),
/* Initializes the MediaController - handles connection to PlayerService under the hood */ /* Initializes the MediaController - handles connection to PlayerService under the hood */
@OptIn(UnstableApi::class)
private fun initializeController() { private fun initializeController() {
controllerFuture = MediaController.Builder( controllerFuture = MediaController.Builder(
activity as Context, activity as Context,
@@ -432,15 +434,15 @@ class PlayerFragment : Fragment(),
val swipeToDeleteHandler = object : UiHelper.SwipeToDeleteCallback(activity as Context) { val swipeToDeleteHandler = object : UiHelper.SwipeToDeleteCallback(activity as Context) {
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
// ask user // ask user
val adapterPosition: Int = viewHolder.adapterPosition val bindingAdapterPosition: Int = viewHolder.bindingAdapterPosition
val dialogMessage = val dialogMessage =
"${getString(R.string.dialog_yes_no_message_remove_station)}\n\n- ${collection.stations[adapterPosition].name}" "${getString(R.string.dialog_yes_no_message_remove_station)}\n\n- ${collection.stations[bindingAdapterPosition].name}"
YesNoDialog(this@PlayerFragment as YesNoDialog.YesNoDialogListener).show( YesNoDialog(this@PlayerFragment as YesNoDialog.YesNoDialogListener).show(
context = activity as Context, context = activity as Context,
type = Keys.DIALOG_REMOVE_STATION, type = Keys.DIALOG_REMOVE_STATION,
messageString = dialogMessage, messageString = dialogMessage,
yesButton = R.string.dialog_yes_no_positive_button_remove_station, yesButton = R.string.dialog_yes_no_positive_button_remove_station,
payload = adapterPosition payload = bindingAdapterPosition
) )
} }
} }
@@ -452,15 +454,15 @@ class PlayerFragment : Fragment(),
object : UiHelper.SwipeToMarkStarredCallback(activity as Context) { object : UiHelper.SwipeToMarkStarredCallback(activity as Context) {
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
// mark card starred // mark card starred
val adapterPosition: Int = viewHolder.adapterPosition val bindingAdapterPosition: Int = viewHolder.bindingAdapterPosition
collectionAdapter.toggleStarredStation(activity as Context, adapterPosition) collectionAdapter.toggleStarredStation(activity as Context, bindingAdapterPosition)
} }
} }
val swipeToMarkStarredItemTouchHelper = ItemTouchHelper(swipeToMarkStarredHandler) val swipeToMarkStarredItemTouchHelper = ItemTouchHelper(swipeToMarkStarredHandler)
swipeToMarkStarredItemTouchHelper.attachToRecyclerView(layout.recyclerView) swipeToMarkStarredItemTouchHelper.attachToRecyclerView(layout.recyclerView)
// set up sleep timer start button // set up sleep timer start button
layout.sheetSleepTimerStartButtonView.setOnClickListener { layout.sheetSleepTimerStartButtonView?.setOnClickListener {
when (controller?.isPlaying) { when (controller?.isPlaying) {
true -> { true -> {
val timePicker = MaterialTimePicker.Builder() val timePicker = MaterialTimePicker.Builder()
@@ -490,29 +492,29 @@ class PlayerFragment : Fragment(),
} }
// set up sleep timer cancel button // set up sleep timer cancel button
layout.sheetSleepTimerCancelButtonView.setOnClickListener { layout.sheetSleepTimerCancelButtonView?.setOnClickListener {
playerState.sleepTimerRunning = false playerState.sleepTimerRunning = false
controller?.cancelSleepTimer() controller?.cancelSleepTimer()
togglePeriodicSleepTimerUpdateRequest() togglePeriodicSleepTimerUpdateRequest()
} }
// set up TV station navigation
layout.playerPrevButtonView?.setOnClickListener {
val currentPosition = CollectionHelper.getStationPosition(collection, playerState.stationUuid)
if (currentPosition > 0) {
val prevStation = collection.stations[currentPosition - 1]
onPlayButtonTapped(prevStation.uuid)
}
}
layout.playerNextButtonView?.setOnClickListener {
val currentPosition = CollectionHelper.getStationPosition(collection, playerState.stationUuid)
if (currentPosition < collection.stations.size - 1) {
val nextStation = collection.stations[currentPosition + 1]
onPlayButtonTapped(nextStation.uuid)
}
} }
}
// /* Sets up the general playback controls - Note: station specific controls and views are updated in updatePlayerViews() */
// // it is probably okay to suppress this warning - the OnTouchListener on the time played view does only toggle the time duration / remaining display
// private fun setupPlaybackControls() {
//
// // main play/pause button
// layout.playButtonView.setOnClickListener {
// onPlayButtonTapped(playerState.stationUuid, playerState.playbackState)
// //onPlayButtonTapped(playerState.stationUuid, playerController.getPlaybackState().state) // todo remove
// }
//
// // register a callback to stay in sync
// playerController.registerCallback(mediaControllerCallback)
// }
/* Sets up the player */ /* Sets up the player */
private fun updatePlayerViews() { private fun updatePlayerViews() {
@@ -549,7 +551,7 @@ class PlayerFragment : Fragment(),
private fun requestSleepTimerUpdate() { private fun requestSleepTimerUpdate() {
val resultFuture: ListenableFuture<SessionResult>? = val resultFuture: ListenableFuture<SessionResult>? =
controller?.requestSleepTimerRemaining() controller?.requestSleepTimerRemaining()
resultFuture?.addListener(Runnable { resultFuture?.addListener({
val timeRemaining: Long = resultFuture.get().extras.getLong(Keys.EXTRA_SLEEP_TIMER_REMAINING) val timeRemaining: Long = resultFuture.get().extras.getLong(Keys.EXTRA_SLEEP_TIMER_REMAINING)
layout.updateSleepTimer(activity as Context, timeRemaining) layout.updateSleepTimer(activity as Context, timeRemaining)
}, MoreExecutors.directExecutor()) }, MoreExecutors.directExecutor())
@@ -559,7 +561,7 @@ class PlayerFragment : Fragment(),
/* Requests an update of the metadata history from the player service */ /* Requests an update of the metadata history from the player service */
private fun requestMetadataUpdate() { private fun requestMetadataUpdate() {
val resultFuture: ListenableFuture<SessionResult>? = controller?.requestMetadataHistory() val resultFuture: ListenableFuture<SessionResult>? = controller?.requestMetadataHistory()
resultFuture?.addListener(Runnable { resultFuture?.addListener({
val metadata: ArrayList<String>? = resultFuture.get().extras.getStringArrayList(Keys.EXTRA_METADATA_HISTORY) val metadata: ArrayList<String>? = resultFuture.get().extras.getStringArrayList(Keys.EXTRA_METADATA_HISTORY)
layout.updateMetadata(metadata?.toMutableList()) layout.updateMetadata(metadata?.toMutableList())
}, MoreExecutors.directExecutor()) }, MoreExecutors.directExecutor())
@@ -588,7 +590,7 @@ class PlayerFragment : Fragment(),
/* Handles ACTION_SHOW_PLAYER request from notification */ /* Handles ACTION_SHOW_PLAYER request from notification */
private fun handleShowPlayer() { private fun handleShowPlayer() {
Log.i(TAG, "Tap on notification registered.") Log.i(TAG, "Tap on notification registered.")
// todo implement layout.showPlayer(requireActivity())
} }
@@ -650,16 +652,16 @@ class PlayerFragment : Fragment(),
collectionViewModel.collectionLiveData.observe(this) { collectionViewModel.collectionLiveData.observe(this) {
// update collection // update collection
collection = it collection = it
//// // updates current station in player views // updates current station in player views
//// playerState = PreferencesHelper.loadPlayerState() playerState = PreferencesHelper.loadPlayerState()
// // get station // // get station
// val station: Station = CollectionHelper.getStation(collection, playerState.stationUuid) val station: Station = CollectionHelper.getStation(collection, playerState.stationUuid)
// // update player views // // update player views
// layout.updatePlayerViews(activity as Context, station, playerState.isPlaying) layout.updatePlayerViews(activity as Context, station, playerState.isPlaying)
//// // handle start intent // handle start intent
//// handleStartIntent() handleStartIntent()
//// // handle navigation arguments // handle navigation arguments
//// handleNavigationArguments() handleNavigationArguments()
} }
collectionViewModel.collectionSizeLiveData.observe(this) { collectionViewModel.collectionSizeLiveData.observe(this) {
// size of collection changed // size of collection changed
@@ -754,6 +756,7 @@ class PlayerFragment : Fragment(),
layout.showBufferingIndicator(buffering = false) layout.showBufferingIndicator(buffering = false)
} else { } else {
// playback is paused or stopped // playback is paused or stopped
layout.updateSleepTimer(activity as Context, 0L)
// check if buffering (playback is not active but playWhenReady is true) // check if buffering (playback is not active but playWhenReady is true)
if (controller?.playWhenReady == true) { if (controller?.playWhenReady == true) {
// playback is buffering, show the buffering indicator // playback is buffering, show the buffering indicator
@@ -801,7 +804,7 @@ class PlayerFragment : Fragment(),
.setAction(R.string.snackbar_show) { .setAction(R.string.snackbar_show) {
val releaseurl = getString(R.string.snackbar_url_app_home_page) val releaseurl = getString(R.string.snackbar_url_app_home_page)
val i = Intent(Intent.ACTION_VIEW) val i = Intent(Intent.ACTION_VIEW)
i.data = Uri.parse(releaseurl) i.data = releaseurl.toUri()
// Not sure that does anything // Not sure that does anything
i.putExtra("SOURCE", "SELF") i.putExtra("SOURCE", "SELF")
startActivity(i) startActivity(i)
@@ -820,9 +823,4 @@ class PlayerFragment : Fragment(),
request.tag = TAG request.tag = TAG
queue.add(request) queue.add(request)
} }
/*
* End of declaration
*/
} }

View File

@@ -104,7 +104,7 @@ class PlayerService : MediaLibraryService() {
/* Overrides onTaskRemoved from Service */ /* Overrides onTaskRemoved from Service */
override fun onTaskRemoved(rootIntent: Intent) { override fun onTaskRemoved(rootIntent: Intent?) {
if (!player.playWhenReady) { if (!player.playWhenReady) {
stopSelf() stopSelf()
} }
@@ -210,12 +210,9 @@ class PlayerService : MediaLibraryService() {
/* Cancels sleep timer */ /* Cancels sleep timer */
private fun cancelSleepTimer() { private fun cancelSleepTimer() {
if (this::sleepTimer.isInitialized) { if (this::sleepTimer.isInitialized) {
if (manuallyCancelledSleepTimer) {
sleepTimerTimeRemaining = 0L
sleepTimer.cancel() sleepTimer.cancel()
} }
manuallyCancelledSleepTimer = false sleepTimerTimeRemaining = 0L
}
// store timer state // store timer state
PreferencesHelper.saveSleepTimerRunning(isRunning = false) PreferencesHelper.saveSleepTimerRunning(isRunning = false)
} }
@@ -280,19 +277,8 @@ class PlayerService : MediaLibraryService() {
val updatedMediaItems: List<MediaItem> = val updatedMediaItems: List<MediaItem> =
mediaItems.map { mediaItem -> mediaItems.map { mediaItem ->
CollectionHelper.getItem(this@PlayerService, collection, mediaItem.mediaId) CollectionHelper.getItem(this@PlayerService, collection, mediaItem.mediaId)
// if (mediaItem.requestMetadata.searchQuery != null)
// getMediaItemFromSearchQuery(mediaItem.requestMetadata.searchQuery!!)
// else MediaItemTree.getItem(mediaItem.mediaId) ?: mediaItem
} }
return Futures.immediateFuture(updatedMediaItems) return Futures.immediateFuture(updatedMediaItems)
// val updatedMediaItems = mediaItems.map { mediaItem ->
// mediaItem.buildUpon().apply {
// setUri(mediaItem.requestMetadata.mediaUri)
// }.build()
// }
// return Futures.immediateFuture(updatedMediaItems)
} }
@@ -397,75 +383,6 @@ class PlayerService : MediaLibraryService() {
return super.onCustomCommand(session, controller, customCommand, args) return super.onCustomCommand(session, controller, customCommand, args)
} }
override fun onPlayerCommandRequest(
session: MediaSession,
controller: MediaSession.ControllerInfo,
playerCommand: Int
): Int {
// playerCommand = one of COMMAND_PLAY_PAUSE, COMMAND_PREPARE, COMMAND_STOP, COMMAND_SEEK_TO_DEFAULT_POSITION, COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM, COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM, COMMAND_SEEK_TO_PREVIOUS, COMMAND_SEEK_TO_NEXT_MEDIA_ITEM, COMMAND_SEEK_TO_NEXT, COMMAND_SEEK_TO_MEDIA_ITEM, COMMAND_SEEK_BACK, COMMAND_SEEK_FORWARD, COMMAND_SET_SPEED_AND_PITCH, COMMAND_SET_SHUFFLE_MODE, COMMAND_SET_REPEAT_MODE, COMMAND_GET_CURRENT_MEDIA_ITEM, COMMAND_GET_TIMELINE, COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_SET_MEDIA_ITEMS_METADATA, COMMAND_CHANGE_MEDIA_ITEMS, COMMAND_GET_AUDIO_ATTRIBUTES, COMMAND_GET_VOLUME, COMMAND_GET_DEVICE_VOLUME, COMMAND_SET_VOLUME, COMMAND_SET_DEVICE_VOLUME, COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_SET_VIDEO_SURFACE, COMMAND_GET_TEXT, COMMAND_SET_TRACK_SELECTION_PARAMETERS or COMMAND_GET_TRACK_INFOS. */
// emulate headphone buttons
// start/pause: adb shell input keyevent 85
// next: adb shell input keyevent 87
// prev: adb shell input keyevent 88
when (playerCommand) {
Player.COMMAND_SEEK_TO_NEXT -> {
player.addMediaItem(
CollectionHelper.getNextMediaItem(
this@PlayerService,
collection,
player.currentMediaItem?.mediaId ?: String()
)
)
player.prepare()
player.play()
return SessionResult.RESULT_SUCCESS
}
Player.COMMAND_SEEK_TO_PREVIOUS -> {
player.addMediaItem(
CollectionHelper.getPreviousMediaItem(
this@PlayerService,
collection,
player.currentMediaItem?.mediaId ?: String()
)
)
player.prepare()
player.play()
return SessionResult.RESULT_SUCCESS
}
Player.COMMAND_PREPARE -> {
return if (playLastStation) {
// special case: system requested media resumption (see also onGetLibraryRoot)
player.addMediaItem(CollectionHelper.getRecent(this@PlayerService, collection))
player.prepare()
playLastStation = false
SessionResult.RESULT_SUCCESS
} else {
super.onPlayerCommandRequest(session, controller, playerCommand)
}
}
Player.COMMAND_PLAY_PAUSE -> {
return if (player.isPlaying) {
super.onPlayerCommandRequest(session, controller, playerCommand)
} else {
// seek to the start of the "live window"
player.seekTo(0)
SessionResult.RESULT_SUCCESS
}
}
// Player.COMMAND_PLAY_PAUSE -> {
// // override pause with stop, to prevent unnecessary buffering
// if (player.isPlaying) {
// player.stop()
// return SessionResult.RESULT_INFO_SKIPPED
// } else {
// return super.onPlayerCommandRequest(session, controller, playerCommand)
// }
// }
else -> {
return super.onPlayerCommandRequest(session, controller, playerCommand)
}
}
}
} }
@@ -480,21 +397,21 @@ class PlayerService : MediaLibraryService() {
customLayout: ImmutableList<CommandButton>, customLayout: ImmutableList<CommandButton>,
showPauseButton: Boolean showPauseButton: Boolean
): ImmutableList<CommandButton> { ): ImmutableList<CommandButton> {
val seekToPreviousCommandButton = CommandButton.Builder().apply { val seekToPreviousCommandButton = CommandButton.Builder(CommandButton.ICON_UNDEFINED)
setPlayerCommand(Player.COMMAND_SEEK_TO_PREVIOUS) .setPlayerCommand(Player.COMMAND_SEEK_TO_PREVIOUS)
setIconResId(R.drawable.ic_notification_skip_to_previous_36dp) .setCustomIconResId(R.drawable.ic_notification_skip_to_previous_36dp)
setEnabled(true) .setEnabled(true)
}.build() .build()
val playCommandButton = CommandButton.Builder().apply { val playCommandButton = CommandButton.Builder(CommandButton.ICON_UNDEFINED)
setPlayerCommand(Player.COMMAND_PLAY_PAUSE) .setPlayerCommand(Player.COMMAND_PLAY_PAUSE)
setIconResId(if (player.isPlaying) R.drawable.ic_notification_stop_36dp else R.drawable.ic_notification_play_36dp) .setCustomIconResId(if (player.isPlaying) R.drawable.ic_notification_stop_36dp else R.drawable.ic_notification_play_36dp)
setEnabled(true) .setEnabled(true)
}.build() .build()
val seekToNextCommandButton = CommandButton.Builder().apply { val seekToNextCommandButton = CommandButton.Builder(CommandButton.ICON_UNDEFINED)
setPlayerCommand(Player.COMMAND_SEEK_TO_NEXT) .setPlayerCommand(Player.COMMAND_SEEK_TO_NEXT)
setIconResId(R.drawable.ic_notification_skip_to_next_36dp) .setCustomIconResId(R.drawable.ic_notification_skip_to_next_36dp)
setEnabled(true) .setEnabled(true)
}.build() .build()
val commandButtons: MutableList<CommandButton> = mutableListOf( val commandButtons: MutableList<CommandButton> = mutableListOf(
seekToPreviousCommandButton, seekToPreviousCommandButton,
playCommandButton, playCommandButton,
@@ -544,19 +461,19 @@ class PlayerService : MediaLibraryService() {
when (player.playbackState) { when (player.playbackState) {
// player is able to immediately play from its current position // player is able to immediately play from its current position
Player.STATE_READY -> { Player.STATE_READY -> {
// todo stopSelf()
} }
// buffering - data needs to be loaded // buffering - data needs to be loaded
Player.STATE_BUFFERING -> { Player.STATE_BUFFERING -> {
// todo stopSelf()
} }
// player finished playing all media // player finished playing all media
Player.STATE_ENDED -> { Player.STATE_ENDED -> {
// todo stopSelf()
} }
// initial state or player is stopped or playback failed // initial state or player is stopped or playback failed
Player.STATE_IDLE -> { Player.STATE_IDLE -> {
// todo stopSelf()
} }
} }
} }
@@ -567,15 +484,10 @@ class PlayerService : MediaLibraryService() {
if (!playWhenReady) { if (!playWhenReady) {
when (reason) { when (reason) {
Player.PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM -> { Player.PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM -> {
// playback reached end: stop / end playback stopSelf()
} }
else -> { else -> {
// playback has been paused by user or OS: update media session and save state stopSelf()
// PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST or
// PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS or
// PLAY_WHEN_READY_CHANGE_REASON_AUDIO_BECOMING_NOISY or
// PLAY_WHEN_READY_CHANGE_REASON_REMOTE
// handlePlaybackChange(PlaybackStateCompat.STATE_PAUSED)
} }
} }
} }
@@ -585,7 +497,10 @@ class PlayerService : MediaLibraryService() {
override fun onPlayerError(error: PlaybackException) { override fun onPlayerError(error: PlaybackException) {
super.onPlayerError(error) super.onPlayerError(error)
Log.d(TAG, "PlayerError occurred: ${error.errorCodeName}") Log.d(TAG, "PlayerError occurred: ${error.errorCodeName}")
// todo: test if playback needs to be restarted if (error.errorCode == PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_FAILED || error.errorCode == PlaybackException.ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT) {
player.prepare()
player.play()
}
} }
@@ -636,22 +551,6 @@ class PlayerService : MediaLibraryService() {
} }
/*
* Defines the listener for changes in shared preferences
*/
private val sharedPreferenceChangeListener =
SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
when (key) {
Keys.PREF_LARGE_BUFFER_SIZE -> {
bufferSizeMultiplier = PreferencesHelper.loadBufferSizeMultiplier()
if (!player.isPlaying && !player.isLoading) {
initializePlayer()
}
}
}
}
/* /*
* Custom AnalyticsListener that enables AudioFX equalizer integration * Custom AnalyticsListener that enables AudioFX equalizer integration
*/ */
@@ -667,7 +566,6 @@ class PlayerService : MediaLibraryService() {
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, packageName) intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, packageName)
intent.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC) intent.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC)
sendBroadcast(intent) sendBroadcast(intent)
// note: remember to broadcast AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION, when not needed anymore
} }
} }
} }

View File

@@ -25,8 +25,6 @@ import com.michatec.radio.helpers.PreferencesHelper.initPreferences
*/ */
class Radio : Application() { class Radio : Application() {
/* Define log tag */
private val TAG: String = Radio::class.java.simpleName
/* Implements onCreate */ /* Implements onCreate */
override fun onCreate() { override fun onCreate() {
@@ -36,10 +34,4 @@ class Radio : Application() {
AppThemeHelper.setTheme(PreferencesHelper.loadThemeSelection()) AppThemeHelper.setTheme(PreferencesHelper.loadThemeSelection())
} }
/* Implements onTerminate */
override fun onTerminate() {
super.onTerminate()
}
} }

View File

@@ -1,17 +1,3 @@
/*
* SettingsFragment.kt
* Implements the SettingsFragment fragment
* A SettingsFragment displays the user accessible settings of the app
*
* This file is part of
* TRANSISTOR - Radio App for Android
*
* Copyright (c) 2015-22 - Y20K.org
* Licensed under the MIT-License
* http://opensource.org/licenses/MIT
*/
package com.michatec.radio package com.michatec.radio
import android.app.Activity import android.app.Activity
@@ -27,10 +13,7 @@ import android.view.View
import androidx.activity.result.ActivityResult import androidx.activity.result.ActivityResult
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.content.ContextCompat
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.core.os.bundleOf
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import androidx.preference.* import androidx.preference.*
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
@@ -62,20 +45,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
(activity as AppCompatActivity).supportActionBar?.show() (activity as AppCompatActivity).supportActionBar?.show()
(activity as AppCompatActivity).supportActionBar?.setDisplayHomeAsUpEnabled(true) (activity as AppCompatActivity).supportActionBar?.setDisplayHomeAsUpEnabled(true)
(activity as AppCompatActivity).supportActionBar?.title = getString(R.string.fragment_settings_title) (activity as AppCompatActivity).supportActionBar?.title = getString(R.string.fragment_settings_title)
requireActivity().window.navigationBarColor = getColor(requireContext(), android.R.attr.colorBackground)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// above Android Oreo
(activity as AppCompatActivity).window.navigationBarColor = getColor(requireContext(), android.R.attr.colorBackground)
} else {
val nightMode = AppCompatDelegate.getDefaultNightMode()
if (nightMode == AppCompatDelegate.MODE_NIGHT_YES) {
// night mode is active, set navigation bar color to a suitable color for night mode
(activity as AppCompatActivity).window.navigationBarColor = getColor(requireContext(), android.R.attr.colorBackground)
} else {
// night mode is not active, set navigation bar color to a suitable color for day mode
(activity as AppCompatActivity).window.navigationBarColor = ContextCompat.getColor(requireContext(), android.R.color.black)
}
}
} }
/* Overrides onCreatePreferences from PreferenceFragmentCompat */ /* Overrides onCreatePreferences from PreferenceFragmentCompat */
@@ -108,6 +78,8 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
val index: Int = preference.entryValues.indexOf(newValue) val index: Int = preference.entryValues.indexOf(newValue)
preferenceThemeSelection.summary = preferenceThemeSelection.summary =
"${getString(R.string.pref_theme_selection_summary)} ${preference.entries[index]}" "${getString(R.string.pref_theme_selection_summary)} ${preference.entries[index]}"
AppThemeHelper.setTheme(newValue as String)
return@setOnPreferenceChangeListener true return@setOnPreferenceChangeListener true
} else { } else {
return@setOnPreferenceChangeListener false return@setOnPreferenceChangeListener false
@@ -131,16 +103,21 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
} }
// // set up "Update Stations" preference // set up "Update Stations" preference
// val preferenceUpdateCollection: Preference = Preference(activity as Context) val preferenceUpdateCollection = Preference(activity as Context)
// preferenceUpdateCollection.title = getString(R.string.pref_update_collection_title) preferenceUpdateCollection.title = getString(R.string.pref_update_collection_title)
// preferenceUpdateCollection.setIcon(R.drawable.ic_refresh_24dp) preferenceUpdateCollection.setIcon(R.drawable.ic_refresh_24dp)
// preferenceUpdateCollection.summary = getString(R.string.pref_update_collection_summary) preferenceUpdateCollection.summary = getString(R.string.pref_update_collection_summary)
// preferenceUpdateCollection.setOnPreferenceClickListener { preferenceUpdateCollection.setOnPreferenceClickListener {
// // show dialog // show dialog
// YesNoDialog(this).show(context = activity as Context, type = Keys.DIALOG_UPDATE_COLLECTION, message = R.string.dialog_yes_no_message_update_collection, yesButton = R.string.dialog_yes_no_positive_button_update_collection) YesNoDialog(this).show(
// return@setOnPreferenceClickListener true context = activity as Context,
// } type = Keys.DIALOG_UPDATE_COLLECTION,
message = R.string.dialog_yes_no_message_update_collection,
yesButton = R.string.dialog_yes_no_positive_button_update_collection,
)
return@setOnPreferenceClickListener true
}
// set up "M3U Export" preference // set up "M3U Export" preference
@@ -204,7 +181,8 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
preferenceEnableEditingStreamUri.key = Keys.PREF_EDIT_STREAMS_URIS preferenceEnableEditingStreamUri.key = Keys.PREF_EDIT_STREAMS_URIS
preferenceEnableEditingStreamUri.summaryOn = getString(R.string.pref_edit_station_stream_summary_enabled) preferenceEnableEditingStreamUri.summaryOn = getString(R.string.pref_edit_station_stream_summary_enabled)
preferenceEnableEditingStreamUri.summaryOff = getString(R.string.pref_edit_station_stream_summary_disabled) preferenceEnableEditingStreamUri.summaryOff = getString(R.string.pref_edit_station_stream_summary_disabled)
preferenceEnableEditingStreamUri.setDefaultValue(PreferencesHelper.loadEditStreamUrisEnabled()) preferenceEnableEditingStreamUri.setDefaultValue(PreferencesHelper.loadEditStreamUrisEnabled(context))
preferenceEnableEditingStreamUri.isEnabled = PreferencesHelper.loadEditStreamUrisEnabled(context)
// set up "Edit Stations" preference // set up "Edit Stations" preference
@@ -214,7 +192,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
preferenceEnableEditingGeneral.key = Keys.PREF_EDIT_STATIONS preferenceEnableEditingGeneral.key = Keys.PREF_EDIT_STATIONS
preferenceEnableEditingGeneral.summaryOn = getString(R.string.pref_edit_station_summary_enabled) preferenceEnableEditingGeneral.summaryOn = getString(R.string.pref_edit_station_summary_enabled)
preferenceEnableEditingGeneral.summaryOff = getString(R.string.pref_edit_station_summary_disabled) preferenceEnableEditingGeneral.summaryOff = getString(R.string.pref_edit_station_summary_disabled)
preferenceEnableEditingGeneral.setDefaultValue(PreferencesHelper.loadEditStationsEnabled()) preferenceEnableEditingGeneral.setDefaultValue(PreferencesHelper.loadEditStationsEnabled(context))
preferenceEnableEditingGeneral.setOnPreferenceChangeListener { _, newValue -> preferenceEnableEditingGeneral.setOnPreferenceChangeListener { _, newValue ->
when (newValue) { when (newValue) {
true -> { true -> {
@@ -314,7 +292,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
screen.addPreference(preferenceThemeSelection) screen.addPreference(preferenceThemeSelection)
screen.addPreference(preferenceCategoryMaintenance) screen.addPreference(preferenceCategoryMaintenance)
screen.addPreference(preferenceUpdateStationImages) screen.addPreference(preferenceUpdateStationImages)
// screen.addPreference(preferenceUpdateCollection) screen.addPreference(preferenceUpdateCollection)
screen.addPreference(preferenceCategoryImportExport) screen.addPreference(preferenceCategoryImportExport)
screen.addPreference(preferenceM3uExport) screen.addPreference(preferenceM3uExport)
screen.addPreference(preferencePlsExport) screen.addPreference(preferencePlsExport)
@@ -437,9 +415,9 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
val sourceUri: Uri? = result.data?.data val sourceUri: Uri? = result.data?.data
if (sourceUri != null) { if (sourceUri != null) {
// open and import OPML in player fragment // open and import OPML in player fragment
val bundle: Bundle = bundleOf( val bundle = Bundle().apply {
Keys.ARG_RESTORE_COLLECTION to "$sourceUri" putString(Keys.ARG_RESTORE_COLLECTION, "$sourceUri")
) }
this.findNavController().navigate(R.id.player_destination, bundle) this.findNavController().navigate(R.id.player_destination, bundle)
} }
} }
@@ -455,7 +433,9 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
Snackbar.LENGTH_LONG Snackbar.LENGTH_LONG
).show() ).show()
// update collection in player screen // update collection in player screen
val bundle: Bundle = bundleOf(Keys.ARG_UPDATE_COLLECTION to true) val bundle = Bundle().apply {
putBoolean(Keys.ARG_UPDATE_COLLECTION, true)
}
this.findNavController().navigate(R.id.player_destination, bundle) this.findNavController().navigate(R.id.player_destination, bundle)
} else { } else {
ErrorDialog().show( ErrorDialog().show(
@@ -476,9 +456,9 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
Snackbar.LENGTH_LONG Snackbar.LENGTH_LONG
).show() ).show()
// update collection in player screen // update collection in player screen
val bundle: Bundle = bundleOf( val bundle = Bundle().apply {
Keys.ARG_UPDATE_IMAGES to true putBoolean(Keys.ARG_UPDATE_IMAGES, true)
) }
this.findNavController().navigate(R.id.player_destination, bundle) this.findNavController().navigate(R.id.player_destination, bundle)
} else { } else {
ErrorDialog().show( ErrorDialog().show(
@@ -544,7 +524,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
val dateFormat = SimpleDateFormat("_yyyy-MM-dd'T'HH_mm", Locale.US) val dateFormat = SimpleDateFormat("_yyyy-MM-dd'T'HH_mm", Locale.US)
timeStamp = dateFormat.format(Date()) timeStamp = dateFormat.format(Date())
putExtra(Intent.EXTRA_TITLE, "URL_Radio$timeStamp.zip") putExtra(Intent.EXTRA_TITLE, "Radio$timeStamp.zip")
} }
// file gets saved in the ActivityResult // file gets saved in the ActivityResult
try { try {

View File

@@ -19,11 +19,13 @@ import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import android.view.KeyEvent
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.ImageView import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.cardview.widget.CardView import androidx.cardview.widget.CardView
@@ -61,8 +63,8 @@ class CollectionAdapter(
/* Main class variables */ /* Main class variables */
private lateinit var collectionViewModel: CollectionViewModel private lateinit var collectionViewModel: CollectionViewModel
private var collection: Collection = Collection() private var collection: Collection = Collection()
private var editStationsEnabled: Boolean = PreferencesHelper.loadEditStationsEnabled() private var editStationsEnabled: Boolean = PreferencesHelper.loadEditStationsEnabled(context)
private var editStationStreamsEnabled: Boolean = PreferencesHelper.loadEditStreamUrisEnabled() private var editStationStreamsEnabled: Boolean = PreferencesHelper.loadEditStreamUrisEnabled(context)
private var expandedStationUuid: String = PreferencesHelper.loadStationListStreamUuid() private var expandedStationUuid: String = PreferencesHelper.loadStationListStreamUuid()
private var expandedStationPosition: Int = -1 private var expandedStationPosition: Int = -1
var isExpandedForEdit: Boolean = false var isExpandedForEdit: Boolean = false
@@ -193,6 +195,8 @@ class CollectionAdapter(
setStationImage(stationViewHolder, station) setStationImage(stationViewHolder, station)
setStationButtons(stationViewHolder, station) setStationButtons(stationViewHolder, station)
setEditViews(stationViewHolder, station) setEditViews(stationViewHolder, station)
setPlaybackProgress(stationViewHolder, station)
setDownloadProgress(stationViewHolder, station)
// show / hide edit views // show / hide edit views
when (expandedStationPosition) { when (expandedStationPosition) {
@@ -211,6 +215,8 @@ class CollectionAdapter(
stationViewHolder.stationNameEditView.imeOptions = stationViewHolder.stationNameEditView.imeOptions =
EditorInfo.IME_ACTION_DONE EditorInfo.IME_ACTION_DONE
} }
// Allow internal focus
stationViewHolder.stationCardView.descendantFocusability = ViewGroup.FOCUS_AFTER_DESCENDANTS
} }
// hide edit views // hide edit views
else -> { else -> {
@@ -219,6 +225,8 @@ class CollectionAdapter(
stationViewHolder.stationStarredView.isVisible = station.starred stationViewHolder.stationStarredView.isVisible = station.starred
stationViewHolder.editViews.isGone = true stationViewHolder.editViews.isGone = true
stationViewHolder.stationUriEditView.isGone = true stationViewHolder.stationUriEditView.isGone = true
// Block internal focus
stationViewHolder.stationCardView.descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
} }
} }
} }
@@ -248,6 +256,28 @@ class CollectionAdapter(
} }
/* Sets the playback progress view */
private fun setPlaybackProgress(stationViewHolder: StationViewHolder, station: Station) {
if (station.bufferingProgress > 0) {
stationViewHolder.bufferingProgress.progress = station.bufferingProgress
stationViewHolder.bufferingProgress.isVisible = true
} else {
stationViewHolder.bufferingProgress.isGone = true
}
}
/* Sets the download progress view */
private fun setDownloadProgress(stationViewHolder: StationViewHolder, station: Station) {
if (station.downloadProgress > 0) {
stationViewHolder.downloadProgress.progress = station.downloadProgress
stationViewHolder.downloadProgress.isVisible = true
} else {
stationViewHolder.downloadProgress.isGone = true
}
}
/* Sets the edit views */ /* Sets the edit views */
private fun setEditViews(stationViewHolder: StationViewHolder, station: Station) { private fun setEditViews(stationViewHolder: StationViewHolder, station: Station) {
stationViewHolder.stationNameEditView.setText(station.name, TextView.BufferType.EDITABLE) stationViewHolder.stationNameEditView.setText(station.name, TextView.BufferType.EDITABLE)
@@ -264,12 +294,12 @@ class CollectionAdapter(
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {} override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
}) })
stationViewHolder.cancelButton.setOnClickListener { stationViewHolder.cancelButton.setOnClickListener {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView) UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
} }
stationViewHolder.saveButton.setOnClickListener { stationViewHolder.saveButton.setOnClickListener {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
saveStation( saveStation(
station, station,
@@ -280,15 +310,15 @@ class CollectionAdapter(
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView) UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
} }
stationViewHolder.placeOnHomeScreenButton.setOnClickListener { stationViewHolder.placeOnHomeScreenButton.setOnClickListener {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
ShortcutHelper.placeShortcut(context, station) ShortcutHelper.placeShortcut(context, station)
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView) UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
} }
stationViewHolder.stationImageChangeView.setOnClickListener { stationViewHolder.stationImageChangeView.setOnClickListener {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
collectionAdapterListener.onChangeImageButtonTapped(station.uuid) collectionAdapterListener.onChangeImageButtonTapped(station.uuid)
stationViewHolder.adapterPosition stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView) UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
} }
@@ -296,6 +326,7 @@ class CollectionAdapter(
/* Shows / hides the edit view for a station */ /* Shows / hides the edit view for a station */
@SuppressLint("NotifyDataSetChanged")
private fun toggleEditViews(position: Int, stationUuid: String) { private fun toggleEditViews(position: Int, stationUuid: String) {
when (stationUuid) { when (stationUuid) {
// CASE: this station's edit view is already expanded // CASE: this station's edit view is already expanded
@@ -361,6 +392,7 @@ class CollectionAdapter(
false -> stationViewHolder.playButtonView.visibility = View.INVISIBLE false -> stationViewHolder.playButtonView.visibility = View.INVISIBLE
} }
stationViewHolder.stationCardView.setOnClickListener { stationViewHolder.stationCardView.setOnClickListener {
if (expandedStationPosition == stationViewHolder.bindingAdapterPosition) return@setOnClickListener
collectionAdapterListener.onPlayButtonTapped(station.uuid) collectionAdapterListener.onPlayButtonTapped(station.uuid)
} }
stationViewHolder.playButtonView.setOnClickListener { stationViewHolder.playButtonView.setOnClickListener {
@@ -375,9 +407,41 @@ class CollectionAdapter(
stationViewHolder.stationImageView.setOnClickListener { stationViewHolder.stationImageView.setOnClickListener {
collectionAdapterListener.onPlayButtonTapped(station.uuid) collectionAdapterListener.onPlayButtonTapped(station.uuid)
} }
// TV improvement: Allow opening edit view with DPAD_LEFT
stationViewHolder.stationCardView.setOnKeyListener { _, keyCode, event ->
if (event.action == KeyEvent.ACTION_DOWN) {
when (keyCode) {
KeyEvent.KEYCODE_DPAD_LEFT -> {
if (editStationsEnabled && expandedStationPosition != stationViewHolder.bindingAdapterPosition) {
val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid)
return@setOnKeyListener true
}
}
KeyEvent.KEYCODE_NUMPAD_2, KeyEvent.KEYCODE_2, KeyEvent.KEYCODE_BACK -> {
if (expandedStationPosition == stationViewHolder.bindingAdapterPosition) {
val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid)
return@setOnKeyListener true
}
}
KeyEvent.KEYCODE_NUMPAD_0, KeyEvent.KEYCODE_0, KeyEvent.KEYCODE_DEL -> {
removeStation(context, stationViewHolder.bindingAdapterPosition)
return@setOnKeyListener true
}
KeyEvent.KEYCODE_NUMPAD_1, KeyEvent.KEYCODE_1, KeyEvent.KEYCODE_SPACE -> {
toggleStarredStation(context, stationViewHolder.bindingAdapterPosition)
return@setOnKeyListener true
}
}
}
false
}
stationViewHolder.playButtonView.setOnLongClickListener { stationViewHolder.playButtonView.setOnLongClickListener {
if (editStationsEnabled) { if (editStationsEnabled) {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
return@setOnLongClickListener true return@setOnLongClickListener true
} else { } else {
@@ -386,7 +450,7 @@ class CollectionAdapter(
} }
stationViewHolder.stationNameView.setOnLongClickListener { stationViewHolder.stationNameView.setOnLongClickListener {
if (editStationsEnabled) { if (editStationsEnabled) {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
return@setOnLongClickListener true return@setOnLongClickListener true
} else { } else {
@@ -395,7 +459,7 @@ class CollectionAdapter(
} }
stationViewHolder.stationStarredView.setOnLongClickListener { stationViewHolder.stationStarredView.setOnLongClickListener {
if (editStationsEnabled) { if (editStationsEnabled) {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
return@setOnLongClickListener true return@setOnLongClickListener true
} else { } else {
@@ -404,7 +468,7 @@ class CollectionAdapter(
} }
stationViewHolder.stationImageView.setOnLongClickListener { stationViewHolder.stationImageView.setOnLongClickListener {
if (editStationsEnabled) { if (editStationsEnabled) {
val position: Int = stationViewHolder.adapterPosition val position: Int = stationViewHolder.bindingAdapterPosition
toggleEditViews(position, station.uuid) toggleEditViews(position, station.uuid)
return@setOnLongClickListener true return@setOnLongClickListener true
} else { } else {
@@ -470,24 +534,25 @@ class CollectionAdapter(
} else if (holder is StationViewHolder) { } else if (holder is StationViewHolder) {
// get station from position // get station from position
collection.stations[holder.getAdapterPosition()] val station: Station = collection.stations[holder.bindingAdapterPosition]
for (data in payloads) { for (data in payloads) {
when (data as Int) { when (data as Int) {
Keys.HOLDER_UPDATE_COVER -> { Keys.HOLDER_UPDATE_COVER -> {
// todo implement setStationImage(holder, station)
setStarredIcon(holder, station)
} }
Keys.HOLDER_UPDATE_NAME -> { Keys.HOLDER_UPDATE_NAME -> {
// todo implement setStationName(holder, station)
} }
Keys.HOLDER_UPDATE_PLAYBACK_STATE -> { Keys.HOLDER_UPDATE_PLAYBACK_STATE -> {
// todo implement setStationButtons(holder, station)
} }
Keys.HOLDER_UPDATE_PLAYBACK_PROGRESS -> { Keys.HOLDER_UPDATE_PLAYBACK_PROGRESS -> {
// todo implement setPlaybackProgress(holder, station)
} }
Keys.HOLDER_UPDATE_DOWNLOAD_STATE -> { Keys.HOLDER_UPDATE_DOWNLOAD_STATE -> {
// todo implement setDownloadProgress(holder, station)
} }
} }
} }
@@ -574,21 +639,6 @@ class CollectionAdapter(
} }
// /* Initiates update of a station's information */ // todo move to CollectionHelper
// private fun updateStation(context: Context, station: Station) {
// if (station.radioBrowserStationUuid.isNotEmpty()) {
// // get updated station from radio browser - results are handled by onRadioBrowserSearchResults
// val radioBrowserSearch: RadioBrowserSearch = RadioBrowserSearch(context, this)
// radioBrowserSearch.searchStation(context, station.radioBrowserStationUuid, Keys.SEARCH_TYPE_BY_UUID)
// } else if (station.remoteStationLocation.isNotEmpty()) {
// // download playlist // todo check content type detection is necessary here
// DownloadHelper.downloadPlaylists(context, arrayOf(station.remoteStationLocation))
// } else {
// Log.w(TAG, "Unable to update station: ${station.name}.")
// }
// }
/* Determines if position is last */ /* Determines if position is last */
private fun isPositionFooter(position: Int): Boolean { private fun isPositionFooter(position: Int): Boolean {
return position == collection.stations.size return position == collection.stations.size
@@ -599,7 +649,7 @@ class CollectionAdapter(
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
private fun updateRecyclerView(oldCollection: Collection, newCollection: Collection) { private fun updateRecyclerView(oldCollection: Collection, newCollection: Collection) {
collection = newCollection collection = newCollection
if (oldCollection.stations.size == 0 && newCollection.stations.size > 0) { if (oldCollection.stations.isEmpty() && newCollection.stations.isNotEmpty()) {
// data set has been initialized - redraw the whole list // data set has been initialized - redraw the whole list
notifyDataSetChanged() notifyDataSetChanged()
} else { } else {
@@ -637,9 +687,9 @@ class CollectionAdapter(
SharedPreferences.OnSharedPreferenceChangeListener { _, key -> SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
when (key) { when (key) {
Keys.PREF_EDIT_STATIONS -> editStationsEnabled = Keys.PREF_EDIT_STATIONS -> editStationsEnabled =
PreferencesHelper.loadEditStationsEnabled() PreferencesHelper.loadEditStationsEnabled(context)
Keys.PREF_EDIT_STREAMS_URIS -> editStationStreamsEnabled = Keys.PREF_EDIT_STREAMS_URIS -> editStationStreamsEnabled =
PreferencesHelper.loadEditStreamUrisEnabled() PreferencesHelper.loadEditStreamUrisEnabled(context)
} }
} }
/* /*
@@ -650,7 +700,7 @@ class CollectionAdapter(
/* /*
* Inner class: ViewHolder for the Add New Station action * Inner class: ViewHolder for the Add New Station action
*/ */
private inner class AddNewViewHolder(listItemAddNewLayout: View) : private class AddNewViewHolder(listItemAddNewLayout: View) :
RecyclerView.ViewHolder(listItemAddNewLayout) { RecyclerView.ViewHolder(listItemAddNewLayout) {
val addNewStationView: ExtendedFloatingActionButton = val addNewStationView: ExtendedFloatingActionButton =
listItemAddNewLayout.findViewById(R.id.card_add_new_station) listItemAddNewLayout.findViewById(R.id.card_add_new_station)
@@ -665,12 +715,14 @@ class CollectionAdapter(
/* /*
* Inner class: ViewHolder for a station * Inner class: ViewHolder for a station
*/ */
private inner class StationViewHolder(stationCardLayout: View) : private class StationViewHolder(stationCardLayout: View) :
RecyclerView.ViewHolder(stationCardLayout) { RecyclerView.ViewHolder(stationCardLayout) {
val stationCardView: CardView = stationCardLayout.findViewById(R.id.station_card) val stationCardView: CardView = stationCardLayout.findViewById(R.id.station_card)
val stationImageView: ImageView = stationCardLayout.findViewById(R.id.station_icon) val stationImageView: ImageView = stationCardLayout.findViewById(R.id.station_icon)
val stationNameView: TextView = stationCardLayout.findViewById(R.id.station_name) val stationNameView: TextView = stationCardLayout.findViewById(R.id.station_name)
val stationStarredView: ImageView = stationCardLayout.findViewById(R.id.starred_icon) val stationStarredView: ImageView = stationCardLayout.findViewById(R.id.starred_icon)
val bufferingProgress: ProgressBar = stationCardLayout.findViewById(R.id.buffering_progress)
val downloadProgress: ProgressBar = stationCardLayout.findViewById(R.id.download_progress)
// val menuButtonView: ImageView = stationCardLayout.findViewById(R.id.menu_button) // val menuButtonView: ImageView = stationCardLayout.findViewById(R.id.menu_button)
val playButtonView: ImageView = stationCardLayout.findViewById(R.id.playback_button) val playButtonView: ImageView = stationCardLayout.findViewById(R.id.playback_button)

View File

@@ -48,7 +48,9 @@ data class Station(
@Expose var radioBrowserStationUuid: String = String(), @Expose var radioBrowserStationUuid: String = String(),
@Expose var radioBrowserChangeUuid: String = String(), @Expose var radioBrowserChangeUuid: String = String(),
@Expose var bitrate: Int = 0, @Expose var bitrate: Int = 0,
@Expose var codec: String = String() @Expose var codec: String = String(),
@Expose var bufferingProgress: Int = 0,
@Expose var downloadProgress: Int = 0
) : Parcelable { ) : Parcelable {
@@ -79,6 +81,12 @@ data class Station(
} }
/* Getter for media type */
fun getMediaType(): String {
return streamContent
}
/* Creates a deep copy of a Station */ /* Creates a deep copy of a Station */
fun deepCopy(): Station { fun deepCopy(): Station {
return Station( return Station(
@@ -101,7 +109,9 @@ data class Station(
radioBrowserStationUuid = radioBrowserStationUuid, radioBrowserStationUuid = radioBrowserStationUuid,
radioBrowserChangeUuid = radioBrowserChangeUuid, radioBrowserChangeUuid = radioBrowserChangeUuid,
bitrate = bitrate, bitrate = bitrate,
codec = codec codec = codec,
bufferingProgress = bufferingProgress,
downloadProgress = downloadProgress
) )
} }
} }

View File

@@ -16,7 +16,9 @@ package com.michatec.radio.dialogs
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.Button
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.core.view.isGone
import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@@ -42,13 +44,11 @@ class AddStationDialog (
} }
/* Define log tag */
private val TAG = AddStationDialog::class.java.simpleName
/* Main class variables */ /* Main class variables */
private lateinit var dialog: AlertDialog private lateinit var dialog: AlertDialog
private lateinit var stationSearchResultList: RecyclerView private lateinit var stationSearchResultList: RecyclerView
private var customPositiveButton: Button? = null
private var customNegativeButton: Button? = null
private lateinit var searchResultAdapter: SearchResultAdapter private lateinit var searchResultAdapter: SearchResultAdapter
private var station: Station = Station() private var station: Station = Station()
@@ -77,6 +77,10 @@ class AddStationDialog (
// set up list of search results // set up list of search results
setupRecyclerView(context) setupRecyclerView(context)
// find custom buttons (for TV layout)
customPositiveButton = view.findViewById(R.id.dialog_positive_button)
customNegativeButton = view.findViewById(R.id.dialog_negative_button)
// add okay ("Add") button // add okay ("Add") button
builder.setPositiveButton(R.string.dialog_find_station_button_add) { _, _ -> builder.setPositiveButton(R.string.dialog_find_station_button_add) { _, _ ->
// listen for click on add button // listen for click on add button
@@ -92,6 +96,17 @@ class AddStationDialog (
searchResultAdapter.stopPrePlayback() searchResultAdapter.stopPrePlayback()
} }
// set up custom buttons if they exist (TV layout)
customPositiveButton?.setOnClickListener {
listener.onAddStationDialog(station)
searchResultAdapter.stopPrePlayback()
dialog.dismiss()
}
customNegativeButton?.setOnClickListener {
searchResultAdapter.stopPrePlayback()
dialog.dismiss()
}
// set dialog view // set dialog view
builder.setView(view) builder.setView(view)
@@ -99,9 +114,17 @@ class AddStationDialog (
dialog = builder.create() dialog = builder.create()
dialog.show() dialog.show()
// initially disable "Add" button // handle button visibility and state
if (customPositiveButton != null) {
// hide default buttons if custom ones are used
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isGone = true
dialog.getButton(AlertDialog.BUTTON_NEGATIVE).isGone = true
customPositiveButton?.isEnabled = false
} else {
// initially disable default "Add" button
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
} }
}
/* Sets up list of results (RecyclerView) */ /* Sets up list of results (RecyclerView) */
@@ -121,12 +144,14 @@ class AddStationDialog (
/* Implement activateAddButton to enable the "Add" button */ /* Implement activateAddButton to enable the "Add" button */
override fun activateAddButton() { override fun activateAddButton() {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true
customPositiveButton?.isEnabled = true
} }
/* Implement deactivateAddButton to disable the "Add" button */ /* Implement deactivateAddButton to disable the "Add" button */
override fun deactivateAddButton() { override fun deactivateAddButton() {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
customPositiveButton?.isEnabled = false
} }

View File

@@ -19,6 +19,7 @@ import android.text.method.ScrollingMovementMethod
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
import android.widget.Toast
import androidx.core.view.isGone import androidx.core.view.isGone
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -46,9 +47,9 @@ class ErrorDialog {
// get views // get views
val inflater: LayoutInflater = LayoutInflater.from(context) val inflater: LayoutInflater = LayoutInflater.from(context)
val view: View = inflater.inflate(R.layout.dialog_generic_with_details, null) val view: View = inflater.inflate(R.layout.dialog_generic_with_details, null)
val errorMessageView: TextView = view.findViewById(R.id.dialog_message) as TextView val errorMessageView: TextView = view.findViewById(R.id.dialog_message)
val errorDetailsLinkView: TextView = view.findViewById(R.id.dialog_details_link) as TextView val errorDetailsLinkView: TextView = view.findViewById(R.id.dialog_details_link)
val errorDetailsView: TextView = view.findViewById(R.id.dialog_details) as TextView val errorDetailsView: TextView = view.findViewById(R.id.dialog_details)
// set dialog view // set dialog view
builder.setView(view) builder.setView(view)
@@ -81,8 +82,7 @@ class ErrorDialog {
// add okay button // add okay button
builder.setPositiveButton(R.string.dialog_generic_button_okay) { _, _ -> builder.setPositiveButton(R.string.dialog_generic_button_okay) { _, _ ->
// listen for click on okay button Toast.makeText(context, R.string.dialog_generic_button_okay, Toast.LENGTH_SHORT).show()
// do nothing
} }
// display error dialog // display error dialog

View File

@@ -21,6 +21,7 @@ import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.Button
import android.widget.ProgressBar import android.widget.ProgressBar
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.SearchView import androidx.appcompat.widget.SearchView
@@ -63,6 +64,8 @@ class FindStationDialog (
private lateinit var searchRequestProgressIndicator: ProgressBar private lateinit var searchRequestProgressIndicator: ProgressBar
private lateinit var noSearchResultsTextView: MaterialTextView private lateinit var noSearchResultsTextView: MaterialTextView
private lateinit var stationSearchResultList: RecyclerView private lateinit var stationSearchResultList: RecyclerView
private var customPositiveButton: Button? = null
private var customNegativeButton: Button? = null
private lateinit var searchResultAdapter: SearchResultAdapter private lateinit var searchResultAdapter: SearchResultAdapter
private lateinit var radioBrowserSearch: RadioBrowserSearch private lateinit var radioBrowserSearch: RadioBrowserSearch
private lateinit var directInputCheck: DirectInputCheck private lateinit var directInputCheck: DirectInputCheck
@@ -134,6 +137,10 @@ class FindStationDialog (
// set up list of search results // set up list of search results
setupRecyclerView(context) setupRecyclerView(context)
// find custom buttons (for TV layout)
customPositiveButton = view.findViewById(R.id.dialog_positive_button)
customNegativeButton = view.findViewById(R.id.dialog_negative_button)
// add okay ("Add") button // add okay ("Add") button
builder.setPositiveButton(R.string.dialog_find_station_button_add) { _, _ -> builder.setPositiveButton(R.string.dialog_find_station_button_add) { _, _ ->
// listen for click on add button // listen for click on add button
@@ -152,6 +159,18 @@ class FindStationDialog (
searchResultAdapter.stopPrePlayback() searchResultAdapter.stopPrePlayback()
} }
// set up custom buttons if they exist (TV layout)
customPositiveButton?.setOnClickListener {
listener.onFindStationDialog(station)
searchResultAdapter.stopPrePlayback()
dialog.dismiss()
}
customNegativeButton?.setOnClickListener {
radioBrowserSearch.stopSearchRequest()
searchResultAdapter.stopPrePlayback()
dialog.dismiss()
}
// listen for input // listen for input
stationSearchBoxView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { stationSearchBoxView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextChange(query: String): Boolean { override fun onQueryTextChange(query: String): Boolean {
@@ -174,11 +193,19 @@ class FindStationDialog (
dialog = builder.create() dialog = builder.create()
dialog.show() dialog.show()
// initially disable "Add" button // handle button visibility and state
if (customPositiveButton != null) {
// hide default buttons if custom ones are used
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isGone = true
dialog.getButton(AlertDialog.BUTTON_NEGATIVE).isGone = true
customPositiveButton?.isEnabled = false
} else {
// initially disable default "Add" button
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isAllCaps = true dialog.getButton(AlertDialog.BUTTON_POSITIVE).isAllCaps = true
dialog.getButton(AlertDialog.BUTTON_NEGATIVE).isAllCaps = true dialog.getButton(AlertDialog.BUTTON_NEGATIVE).isAllCaps = true
} }
}
/* Sets up list of results (RecyclerView) */ /* Sets up list of results (RecyclerView) */
@@ -242,12 +269,14 @@ class FindStationDialog (
/* Makes the "Add" button clickable */ /* Makes the "Add" button clickable */
override fun activateAddButton() { override fun activateAddButton() {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true
customPositiveButton?.isEnabled = true
searchRequestProgressIndicator.isGone = true searchRequestProgressIndicator.isGone = true
noSearchResultsTextView.isGone = true noSearchResultsTextView.isGone = true
} }
override fun deactivateAddButton() { override fun deactivateAddButton() {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
customPositiveButton?.isEnabled = false
searchRequestProgressIndicator.isGone = true searchRequestProgressIndicator.isGone = true
noSearchResultsTextView.isGone = true noSearchResultsTextView.isGone = true
} }
@@ -256,6 +285,7 @@ class FindStationDialog (
/* Resets the dialog layout to default state */ /* Resets the dialog layout to default state */
private fun resetLayout(clearAdapter: Boolean = false) { private fun resetLayout(clearAdapter: Boolean = false) {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
customPositiveButton?.isEnabled = false
searchRequestProgressIndicator.isGone = true searchRequestProgressIndicator.isGone = true
noSearchResultsTextView.isGone = true noSearchResultsTextView.isGone = true
searchResultAdapter.resetSelection(clearAdapter) searchResultAdapter.resetSelection(clearAdapter)
@@ -265,6 +295,7 @@ class FindStationDialog (
/* Display the "No Results" error - hide other unneeded views */ /* Display the "No Results" error - hide other unneeded views */
private fun showNoResultsError() { private fun showNoResultsError() {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
customPositiveButton?.isEnabled = false
searchRequestProgressIndicator.isGone = true searchRequestProgressIndicator.isGone = true
noSearchResultsTextView.isVisible = true noSearchResultsTextView.isVisible = true
} }
@@ -273,6 +304,7 @@ class FindStationDialog (
/* Display the "No Results" error - hide other unneeded views */ /* Display the "No Results" error - hide other unneeded views */
private fun showProgressIndicator() { private fun showProgressIndicator() {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false dialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
customPositiveButton?.isEnabled = false
searchRequestProgressIndicator.isVisible = true searchRequestProgressIndicator.isVisible = true
noSearchResultsTextView.isGone = true noSearchResultsTextView.isGone = true
} }

View File

@@ -16,7 +16,6 @@ package com.michatec.radio.extensions
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import androidx.core.os.bundleOf
import androidx.media3.session.MediaController import androidx.media3.session.MediaController
import androidx.media3.session.SessionCommand import androidx.media3.session.SessionCommand
import androidx.media3.session.SessionResult import androidx.media3.session.SessionResult
@@ -71,8 +70,11 @@ fun MediaController.play(context: Context, station: Station) {
/* Starts playback with of a stream url */ /* Starts playback with of a stream url */
fun MediaController.playStreamDirectly(streamUri: String) { fun MediaController.playStreamDirectly(streamUri: String) {
val bundle = Bundle().apply {
putString(Keys.KEY_STREAM_URI, streamUri)
}
sendCustomCommand( sendCustomCommand(
SessionCommand(Keys.CMD_PLAY_STREAM, Bundle.EMPTY), SessionCommand(Keys.CMD_PLAY_STREAM, Bundle.EMPTY),
bundleOf(Pair(Keys.KEY_STREAM_URI, streamUri)) bundle
) )
} }

View File

@@ -15,9 +15,13 @@
package com.michatec.radio.helpers package com.michatec.radio.helpers
import android.util.Log import android.util.Log
import androidx.annotation.OptIn
import androidx.media3.common.Metadata import androidx.media3.common.Metadata
import androidx.media3.common.util.UnstableApi
import androidx.media3.extractor.metadata.icy.IcyHeaders import androidx.media3.extractor.metadata.icy.IcyHeaders
import androidx.media3.extractor.metadata.icy.IcyInfo import androidx.media3.extractor.metadata.icy.IcyInfo
import androidx.media3.extractor.metadata.id3.Id3Frame
import androidx.media3.extractor.metadata.id3.TextInformationFrame
import com.michatec.radio.Keys import com.michatec.radio.Keys
import kotlin.math.min import kotlin.math.min
@@ -33,29 +37,53 @@ object AudioHelper {
/* Extract audio stream metadata */ /* Extract audio stream metadata */
@OptIn(UnstableApi::class)
fun getMetadataString(metadata: Metadata): String { fun getMetadataString(metadata: Metadata): String {
var metadataString = String() var title = ""
var artist = ""
var album = ""
for (i in 0 until metadata.length()) { for (i in 0 until metadata.length()) {
// extract IceCast metadata // extract IceCast metadata
when (val entry = metadata.get(i)) { when (val entry = metadata.get(i)) {
is IcyInfo -> { is IcyInfo -> {
metadataString = entry.title.toString() title = entry.title.toString()
} }
is IcyHeaders -> { is IcyHeaders -> {
Log.i(TAG, "icyHeaders:" + entry.name + " - " + entry.genre) Log.i(TAG, "icyHeaders:" + entry.name + " - " + entry.genre)
} }
is Id3Frame -> {
when (entry) {
is TextInformationFrame -> {
when (entry.id) {
"TIT2" -> title = entry.values.getOrNull(0) ?: "" // Title
"TPE1" -> artist = entry.values.getOrNull(0) ?: "" // Artist
"TALB" -> album = entry.values.getOrNull(0) ?: "" // Album
}
}
else -> {
Log.d(TAG, "Unhandled ID3 frame: ${entry.javaClass.simpleName}")
}
}
}
else -> { else -> {
Log.w(TAG, "Unsupported metadata received (type = ${entry.javaClass.simpleName})") Log.w(TAG, "Unsupported metadata received (type = ${entry.javaClass.simpleName})")
} }
} }
// TODO implement HLS metadata extraction (Id3Frame / PrivFrame) }
// https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/metadata/Metadata.Entry.html // Build metadata string
var metadataString = title
if (artist.isNotEmpty() && title.isNotEmpty()) {
metadataString = "$artist - $title"
}
if (album.isNotEmpty() && metadataString.isNotEmpty()) {
metadataString += " ($album)"
} }
// ensure a max length of the metadata string // ensure a max length of the metadata string
if (metadataString.isNotEmpty()) { if (metadataString.isNotEmpty()) {
metadataString = metadataString.substring(0, min(metadataString.length, Keys.DEFAULT_MAX_LENGTH_OF_METADATA_ENTRY)) metadataString = metadataString.take(min(metadataString.length, Keys.DEFAULT_MAX_LENGTH_OF_METADATA_ENTRY))
} }
return metadataString return metadataString
} }

View File

@@ -288,32 +288,6 @@ object CollectionHelper {
} }
/* Gets MediaIem for next station within collection */
fun getNextMediaItem(context: Context, collection: Collection, stationUuid: String): MediaItem {
val currentStationPosition: Int = getStationPosition(collection, stationUuid)
return if (collection.stations.isEmpty() || currentStationPosition == -1) {
buildMediaItem(context, Station())
} else if (currentStationPosition < collection.stations.size -1) {
buildMediaItem(context, collection.stations[currentStationPosition + 1])
} else {
buildMediaItem(context, collection.stations.first())
}
}
/* Gets MediaIem for previous station within collection */
fun getPreviousMediaItem(context: Context, collection: Collection, stationUuid: String): MediaItem {
val currentStationPosition: Int = getStationPosition(collection, stationUuid)
return if (collection.stations.isEmpty() || currentStationPosition == -1) {
buildMediaItem(context, Station())
} else if (currentStationPosition > 0) {
buildMediaItem(context, collection.stations[currentStationPosition - 1])
} else {
buildMediaItem(context, collection.stations.last())
}
}
/* Get the position from collection for given UUID */ /* Get the position from collection for given UUID */
fun getStationPosition(collection: Collection, stationUuid: String): Int { fun getStationPosition(collection: Collection, stationUuid: String): Int {
collection.stations.forEachIndexed { stationId, station -> collection.stations.forEachIndexed { stationId, station ->
@@ -561,7 +535,7 @@ object CollectionHelper {
fun exportCollectionM3u(context: Context, collection: Collection) { fun exportCollectionM3u(context: Context, collection: Collection) {
Log.v(TAG, "Exporting collection of stations as M3U") Log.v(TAG, "Exporting collection of stations as M3U")
// export collection as M3U - launch = fire & forget (no return value from save collection) // export collection as M3U - launch = fire & forget (no return value from save collection)
if (collection.stations.size > 0) { if (collection.stations.isNotEmpty()) {
CoroutineScope(IO).launch { CoroutineScope(IO).launch {
FileHelper.backupCollectionAsM3uSuspended( FileHelper.backupCollectionAsM3uSuspended(
context, context,
@@ -603,7 +577,7 @@ object CollectionHelper {
fun exportCollectionPls(context: Context, collection: Collection) { fun exportCollectionPls(context: Context, collection: Collection) {
Log.v(TAG, "Exporting collection of stations as PLS") Log.v(TAG, "Exporting collection of stations as PLS")
// export collection as PLS - launch = fire & forget (no return value from save collection) // export collection as PLS - launch = fire & forget (no return value from save collection)
if (collection.stations.size > 0) { if (collection.stations.isNotEmpty()) {
CoroutineScope(IO).launch { CoroutineScope(IO).launch {
FileHelper.backupCollectionAsPlsSuspended( FileHelper.backupCollectionAsPlsSuspended(
context, context,
@@ -670,51 +644,8 @@ object CollectionHelper {
LocalBroadcastManager.getInstance(context).sendBroadcast(collectionChangedIntent) LocalBroadcastManager.getInstance(context).sendBroadcast(collectionChangedIntent)
} }
// /* Creates MediaMetadata for a single station - used in media session*/
// fun buildStationMediaMetadata(context: Context, station: Station, metadata: String): MediaMetadataCompat {
// return MediaMetadataCompat.Builder().apply {
// putString(MediaMetadataCompat.METADATA_KEY_ARTIST, station.name)
// putString(MediaMetadataCompat.METADATA_KEY_TITLE, metadata)
// putString(MediaMetadataCompat.METADATA_KEY_ALBUM, context.getString(R.string.app_name))
// putString(MediaMetadataCompat.METADATA_KEY_MEDIA_URI, station.getStreamUri())
// putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, ImageHelper.getScaledStationImage(context, station.image, Keys.SIZE_COVER_LOCK_SCREEN))
// //putString(MediaMetadataCompat.METADATA_KEY_ALBUM_ART_URI, station.image)
// }.build()
// }
//
//
// /* Creates MediaItem for a station - used by collection provider */
// fun buildStationMediaMetaItem(context: Context, station: Station): MediaBrowserCompat.MediaItem {
// val mediaDescriptionBuilder = MediaDescriptionCompat.Builder()
// mediaDescriptionBuilder.setMediaId(station.uuid)
// mediaDescriptionBuilder.setTitle(station.name)
// mediaDescriptionBuilder.setIconBitmap(ImageHelper.getScaledStationImage(context, station.image, Keys.SIZE_COVER_LOCK_SCREEN))
// // mediaDescriptionBuilder.setIconUri(station.image.toUri())
// return MediaBrowserCompat.MediaItem(mediaDescriptionBuilder.build(), MediaBrowserCompat.MediaItem.FLAG_PLAYABLE)
// }
//
//
// /* Creates description for a station - used in MediaSessionConnector */
// fun buildStationMediaDescription(context: Context, station: Station, metadata: String): MediaDescriptionCompat {
// val coverBitmap: Bitmap = ImageHelper.getScaledStationImage(context, station.image, Keys.SIZE_COVER_LOCK_SCREEN)
// val extras: Bundle = Bundle()
// extras.putParcelable(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, coverBitmap)
// extras.putParcelable(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, coverBitmap)
// return MediaDescriptionCompat.Builder().apply {
// setMediaId(station.uuid)
// setIconBitmap(coverBitmap)
// setIconUri(station.image.toUri())
// setTitle(metadata)
// setSubtitle(station.name)
// setExtras(extras)
// }.build()
// }
/* Creates a MediaItem with MediaMetadata for a single radio station - used to prepare player */ /* Creates a MediaItem with MediaMetadata for a single radio station - used to prepare player */
fun buildMediaItem(context: Context, station: Station): MediaItem { fun buildMediaItem(context: Context, station: Station): MediaItem {
// todo implement HLS MediaItems
// put uri in RequestMetadata - credit: https://stackoverflow.com/a/70103460 // put uri in RequestMetadata - credit: https://stackoverflow.com/a/70103460
val requestMetadata = MediaItem.RequestMetadata.Builder().apply { val requestMetadata = MediaItem.RequestMetadata.Builder().apply {
setMediaUri(station.getStreamUri().toUri()) setMediaUri(station.getStreamUri().toUri())
@@ -739,7 +670,7 @@ object CollectionHelper {
setMediaId(station.uuid) setMediaId(station.uuid)
setRequestMetadata(requestMetadata) setRequestMetadata(requestMetadata)
setMediaMetadata(mediaMetadata) setMediaMetadata(mediaMetadata)
//setMimeType(station.getMediaType()) setMimeType(station.getMediaType())
setUri(station.getStreamUri().toUri()) setUri(station.getStreamUri().toUri())
}.build() }.build()
} }

View File

@@ -33,7 +33,6 @@ import kotlinx.coroutines.Dispatchers.IO
import java.io.* import java.io.*
import java.util.* import java.util.*
import kotlin.coroutines.resume import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
/* /*
@@ -246,7 +245,7 @@ object FileHelper {
File(activity.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_M3U_FILE) File(activity.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_M3U_FILE)
if (!m3uFile.exists()) { if (!m3uFile.exists()) {
m3uFile = File( m3uFile = File(
activity.getExternalFilesDir(Keys.URLRADIO_LEGACY_FOLDER_COLLECTION), activity.getExternalFilesDir(Keys.RADIO_LEGACY_FOLDER_COLLECTION),
Keys.COLLECTION_M3U_FILE Keys.COLLECTION_M3U_FILE
) )
} }
@@ -270,7 +269,7 @@ object FileHelper {
File(activity.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_PLS_FILE) File(activity.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_PLS_FILE)
if (!plsFile.exists()) { if (!plsFile.exists()) {
plsFile = File( plsFile = File(
activity.getExternalFilesDir(Keys.URLRADIO_LEGACY_FOLDER_COLLECTION), activity.getExternalFilesDir(Keys.RADIO_LEGACY_FOLDER_COLLECTION),
Keys.COLLECTION_PLS_FILE Keys.COLLECTION_PLS_FILE
) )
} }
@@ -292,7 +291,7 @@ object FileHelper {
collection: Collection, collection: Collection,
lastUpdate: Date lastUpdate: Date
) { ) {
return suspendCoroutine { cont -> return suspendCancellableCoroutine { cont ->
cont.resume(saveCollection(context, collection, lastUpdate)) cont.resume(saveCollection(context, collection, lastUpdate))
} }
} }
@@ -311,7 +310,7 @@ object FileHelper {
originalFileUri: Uri, originalFileUri: Uri,
targetFileUri: Uri targetFileUri: Uri
): Boolean { ): Boolean {
return suspendCoroutine { cont -> return suspendCancellableCoroutine { cont ->
cont.resume(copyFile(context, originalFileUri, targetFileUri)) cont.resume(copyFile(context, originalFileUri, targetFileUri))
} }
} }
@@ -319,7 +318,7 @@ object FileHelper {
/* Suspend function: Exports collection of stations as M3U file - local backup copy */ /* Suspend function: Exports collection of stations as M3U file - local backup copy */
suspend fun backupCollectionAsM3uSuspended(context: Context, collection: Collection) { suspend fun backupCollectionAsM3uSuspended(context: Context, collection: Collection) {
return suspendCoroutine { cont -> return suspendCancellableCoroutine { cont ->
Log.v(TAG, "Backing up collection as M3U - Thread: ${Thread.currentThread().name}") Log.v(TAG, "Backing up collection as M3U - Thread: ${Thread.currentThread().name}")
// create M3U string // create M3U string
val m3uString: String = CollectionHelper.createM3uString(collection) val m3uString: String = CollectionHelper.createM3uString(collection)
@@ -338,7 +337,7 @@ object FileHelper {
/* Suspend function: Exports collection of stations as PLS file - local backup copy */ /* Suspend function: Exports collection of stations as PLS file - local backup copy */
suspend fun backupCollectionAsPlsSuspended(context: Context, collection: Collection) { suspend fun backupCollectionAsPlsSuspended(context: Context, collection: Collection) {
return suspendCoroutine { cont -> return suspendCancellableCoroutine { cont ->
Log.v(TAG, "Backing up collection as PLS - Thread: ${Thread.currentThread().name}") Log.v(TAG, "Backing up collection as PLS - Thread: ${Thread.currentThread().name}")
// create PLS string // create PLS string
val plsString: String = CollectionHelper.createPlsString(collection) val plsString: String = CollectionHelper.createPlsString(collection)
@@ -417,16 +416,14 @@ object FileHelper {
/* Reads InputStream from file uri and returns it as String */ /* Reads InputStream from file uri and returns it as String */
private fun readTextFileFromFile(context: Context): String { private fun readTextFileFromFile(context: Context): String {
// todo read https://commonsware.com/blog/2016/03/15/how-consume-content-uri.html
// https://developer.android.com/training/secure-file-sharing/retrieve-info
// check if file exists // check if file exists
val file = File(context.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_FILE) val file = File(context.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_FILE)
if (!file.exists() || !file.canRead()) { if (!file.exists() || !file.canRead()) {
return String() return String()
} }
// read until last line reached // read until last line reached
val stream: InputStream = file.inputStream() val uri = Uri.fromFile(file)
val stream: InputStream = context.contentResolver.openInputStream(uri) ?: return String()
val reader = BufferedReader(InputStreamReader(stream)) val reader = BufferedReader(InputStreamReader(stream))
val builder: StringBuilder = StringBuilder() val builder: StringBuilder = StringBuilder()
reader.forEachLine { reader.forEachLine {

View File

@@ -25,6 +25,7 @@ import com.michatec.radio.R
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.io.IOException import java.io.IOException
import java.io.InputStream import java.io.InputStream
import androidx.core.graphics.createBitmap
/* /*
@@ -98,7 +99,7 @@ object ImageHelper {
} }
// create empty bitmap and canvas // create empty bitmap and canvas
val outputImage: Bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888) val outputImage: Bitmap = createBitmap(size, size, Bitmap.Config.ARGB_8888)
val imageCanvas = Canvas(outputImage) val imageCanvas = Canvas(outputImage)
// draw square background // draw square background

View File

@@ -1,42 +0,0 @@
/*
* ImportHelper.kt
* Implements the ImportHelper object
* A ImportHelper provides methods for integrating station files from Radio v3
*
* This file is part of
* TRANSISTOR - Radio App for Android
*
* Copyright (c) 2015-22 - Y20K.org
* Licensed under the MIT-License
* http://opensource.org/licenses/MIT
*/
package com.michatec.radio.helpers
import android.content.Context
import com.michatec.radio.Keys
import com.michatec.radio.core.Collection
/*
* ImportHelper object
*/
object ImportHelper {
/* */
fun removeDefaultStationImageUris(context: Context) {
val collection: Collection = FileHelper.readCollection(context)
collection.stations.forEach { station ->
if (station.image == Keys.LOCATION_DEFAULT_STATION_IMAGE) {
station.image = String()
}
if (station.smallImage == Keys.LOCATION_DEFAULT_STATION_IMAGE) {
station.smallImage = String()
}
}
CollectionHelper.saveCollection(context, collection, async = false)
}
}

View File

@@ -19,13 +19,13 @@ import android.net.ConnectivityManager
import android.net.Network import android.net.Network
import android.util.Log import android.util.Log
import com.michatec.radio.Keys import com.michatec.radio.Keys
import kotlinx.coroutines.suspendCancellableCoroutine
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.InetAddress import java.net.InetAddress
import java.net.URL import java.net.URL
import java.net.UnknownHostException import java.net.UnknownHostException
import java.util.* import java.util.*
import kotlin.coroutines.resume import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
/* /*
@@ -105,7 +105,7 @@ object NetworkHelper {
/* Suspend function: Detects content type (mime type) from given URL string - async using coroutine */ /* Suspend function: Detects content type (mime type) from given URL string - async using coroutine */
suspend fun detectContentTypeSuspended(urlString: String): ContentType { suspend fun detectContentTypeSuspended(urlString: String): ContentType {
return suspendCoroutine { cont -> return suspendCancellableCoroutine { cont ->
cont.resume(detectContentType(urlString)) cont.resume(detectContentType(urlString))
} }
} }
@@ -113,14 +113,14 @@ object NetworkHelper {
/* Suspend function: Gets a random radio-browser.info api address - async using coroutine */ /* Suspend function: Gets a random radio-browser.info api address - async using coroutine */
suspend fun getRadioBrowserServerSuspended(): String { suspend fun getRadioBrowserServerSuspended(): String {
return suspendCoroutine { cont -> return suspendCancellableCoroutine { cont ->
val serverAddress: String = try { val serverAddress: String = try {
// get all available radio browser servers // get all available radio browser servers
val serverAddressList: Array<InetAddress> = val serverAddressList: Array<InetAddress> =
InetAddress.getAllByName(Keys.RADIO_BROWSER_API_BASE) InetAddress.getAllByName(Keys.RADIO_BROWSER_API_BASE)
// select a random address // select a random address
serverAddressList[Random().nextInt(serverAddressList.size)].canonicalHostName serverAddressList[Random().nextInt(serverAddressList.size)].canonicalHostName
} catch (e: UnknownHostException) { } catch (_: UnknownHostException) {
Keys.RADIO_BROWSER_API_DEFAULT Keys.RADIO_BROWSER_API_DEFAULT
} }
PreferencesHelper.saveRadioBrowserApiAddress(serverAddress) PreferencesHelper.saveRadioBrowserApiAddress(serverAddress)

View File

@@ -16,6 +16,7 @@ package com.michatec.radio.helpers
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.util.Log import android.util.Log
import androidx.core.content.edit import androidx.core.content.edit
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
@@ -213,20 +214,6 @@ object PreferencesHelper {
} }
/* Checks if housekeeping work needs to be done - used usually in DownloadWorker "REQUEST_UPDATE_COLLECTION" */
fun isHouseKeepingNecessary(): Boolean {
return sharedPreferences.getBoolean(Keys.PREF_ONE_TIME_HOUSEKEEPING_NECESSARY, true)
}
/* Saves state of housekeeping */
fun saveHouseKeepingNecessaryState(state: Boolean = false) {
sharedPreferences.edit {
putBoolean(Keys.PREF_ONE_TIME_HOUSEKEEPING_NECESSARY, state)
}
}
/* Load currently selected app theme */ /* Load currently selected app theme */
fun loadThemeSelection(): String { fun loadThemeSelection(): String {
return sharedPreferences.getString( return sharedPreferences.getString(
@@ -237,22 +224,15 @@ object PreferencesHelper {
/* Loads value of the option: Edit Stations */ /* Loads value of the option: Edit Stations */
fun loadEditStationsEnabled(): Boolean { fun loadEditStationsEnabled(context: Context): Boolean {
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STATIONS, true) val defaultValue = !context.packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STATIONS, defaultValue)
} }
/* Saves value of the option: Edit Stations (only needed for migration) */
fun saveEditStationsEnabled(enabled: Boolean = false) {
sharedPreferences.edit {
putBoolean(Keys.PREF_EDIT_STATIONS, enabled)
}
}
/* Loads value of the option: Edit Station Streams */ /* Loads value of the option: Edit Station Streams */
fun loadEditStreamUrisEnabled(): Boolean { fun loadEditStreamUrisEnabled(context: Context): Boolean {
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STREAMS_URIS, true) val defaultValue = !context.packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STREAMS_URIS, defaultValue)
} }
@@ -276,7 +256,7 @@ object PreferencesHelper {
fun downloadOverMobile(): Boolean { fun downloadOverMobile(): Boolean {
return sharedPreferences.getBoolean( return sharedPreferences.getBoolean(
Keys.PREF_DOWNLOAD_OVER_MOBILE, Keys.PREF_DOWNLOAD_OVER_MOBILE,
Keys.DEFAULT_DOWNLOAD_OVER_MOBILE false
) )
} }

View File

@@ -17,7 +17,6 @@ package com.michatec.radio.helpers
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Bitmap import android.graphics.Bitmap
import android.os.Build
import android.widget.Toast import android.widget.Toast
import androidx.core.content.pm.ShortcutInfoCompat import androidx.core.content.pm.ShortcutInfoCompat
import androidx.core.content.pm.ShortcutManagerCompat import androidx.core.content.pm.ShortcutManagerCompat
@@ -73,8 +72,8 @@ object ShortcutHelper {
): IconCompat { ): IconCompat {
val stationImageBitmap: Bitmap = val stationImageBitmap: Bitmap =
ImageHelper.getScaledStationImage(context, stationImage.toUri(), 192) ImageHelper.getScaledStationImage(context, stationImage.toUri(), 192)
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
IconCompat.createWithAdaptiveBitmap( return IconCompat.createWithAdaptiveBitmap(
ImageHelper.createSquareImage( ImageHelper.createSquareImage(
context, context,
stationImageBitmap, stationImageBitmap,
@@ -83,17 +82,5 @@ object ShortcutHelper {
true true
) )
) )
} else {
IconCompat.createWithAdaptiveBitmap(
ImageHelper.createSquareImage(
context,
stationImageBitmap,
stationImageColor,
192,
false
)
)
} }
} }
}

View File

@@ -1,17 +1,3 @@
/*
* UiHelper.kt
* Implements the UiHelper object
* A UiHelper provides helper methods for User Interface related tasks
*
* This file is part of
* TRANSISTOR - Radio App for Android
*
* Copyright (c) 2015-22 - Y20K.org
* Licensed under the MIT-License
* http://opensource.org/licenses/MIT
*/
package com.michatec.radio.helpers package com.michatec.radio.helpers
import android.content.Context import android.content.Context

View File

@@ -129,7 +129,7 @@ class RadioBrowserSearch(private var radioBrowserSearchListener: RadioBrowserSea
/* Listens for (positive) server responses to search requests */ /* Listens for (positive) server responses to search requests */
private val responseListener: Response.Listener<JSONArray> = Response.Listener<JSONArray> { response -> private val responseListener: Response.Listener<JSONArray> = Response.Listener { response ->
if (response != null) { if (response != null) {
radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString())) radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString()))
} }

View File

@@ -18,7 +18,6 @@ import android.content.Context
import android.media.AudioAttributes import android.media.AudioAttributes
import android.media.AudioFocusRequest import android.media.AudioFocusRequest
import android.media.AudioManager import android.media.AudioManager
import android.os.Build
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@@ -106,7 +105,7 @@ class SearchResultAdapter(
} }
// mark selected if necessary // mark selected if necessary
val isSelected = selectedPosition == holder.adapterPosition val isSelected = selectedPosition == holder.bindingAdapterPosition
searchResultViewHolder.searchResultLayout.isSelected = isSelected searchResultViewHolder.searchResultLayout.isSelected = isSelected
// toggle text scrolling (marquee) if necessary // toggle text scrolling (marquee) if necessary
@@ -121,7 +120,7 @@ class SearchResultAdapter(
searchResultViewHolder.searchResultLayout.setOnClickListener { searchResultViewHolder.searchResultLayout.setOnClickListener {
// move marked position // move marked position
val previousSelectedPosition = selectedPosition val previousSelectedPosition = selectedPosition
selectedPosition = holder.adapterPosition selectedPosition = holder.bindingAdapterPosition
notifyItemChanged(previousSelectedPosition) notifyItemChanged(previousSelectedPosition)
notifyItemChanged(selectedPosition) notifyItemChanged(selectedPosition)
@@ -133,7 +132,7 @@ class SearchResultAdapter(
resetSelection(false) resetSelection(false)
} else { } else {
// get the selected station from searchResults // get the selected station from searchResults
val selectedStation = searchResults[holder.adapterPosition] val selectedStation = searchResults[holder.bindingAdapterPosition]
// perform pre-playback here // perform pre-playback here
performPrePlayback(searchResultViewHolder.searchResultLayout.context, selectedStation.getStreamUri()) performPrePlayback(searchResultViewHolder.searchResultLayout.context, selectedStation.getStreamUri())
// hand over station // hand over station
@@ -209,7 +208,6 @@ class SearchResultAdapter(
// stop radio playback when one is active // stop radio playback when one is active
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val audioAttributes = AudioAttributes.Builder() val audioAttributes = AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_MEDIA) .setUsage(AudioAttributes.USAGE_MEDIA)
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
@@ -220,11 +218,6 @@ class SearchResultAdapter(
.build() .build()
audioManager.requestAudioFocus(focusRequest) audioManager.requestAudioFocus(focusRequest)
} else {
@Suppress("DEPRECATION")
// For older versions where AudioFocusRequest is not available
audioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT)
}
} }
@@ -246,7 +239,7 @@ class SearchResultAdapter(
/* /*
* Inner class: ViewHolder for a radio station search result * Inner class: ViewHolder for a radio station search result
*/ */
private inner class SearchResultViewHolder(var searchResultLayout: View) : private class SearchResultViewHolder(var searchResultLayout: View) :
RecyclerView.ViewHolder(searchResultLayout) { RecyclerView.ViewHolder(searchResultLayout) {
val nameView: MaterialTextView = searchResultLayout.findViewById(R.id.station_name) val nameView: MaterialTextView = searchResultLayout.findViewById(R.id.station_name)
val streamView: MaterialTextView = searchResultLayout.findViewById(R.id.station_url) val streamView: MaterialTextView = searchResultLayout.findViewById(R.id.station_url)

View File

@@ -1,23 +1,11 @@
/*
* LayoutHolder.kt
* Implements the LayoutHolder class
* A LayoutHolder hold references to the main views
*
* This file is part of
* TRANSISTOR - Radio App for Android
*
* Copyright (c) 2015-22 - Y20K.org
* Licensed under the MIT-License
* http://opensource.org/licenses/MIT
*/
package com.michatec.radio.ui package com.michatec.radio.ui
import android.annotation.SuppressLint
import android.content.ClipData import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.drawable.AnimatedVectorDrawable import android.graphics.drawable.AnimatedVectorDrawable
import android.os.Build import android.os.Build
import android.view.View import android.view.View
@@ -53,30 +41,32 @@ data class LayoutHolder(var rootView: View) {
/* Main class variables */ /* Main class variables */
var recyclerView: RecyclerView = rootView.findViewById(R.id.station_list) var recyclerView: RecyclerView = rootView.findViewById(R.id.station_list)
val layoutManager: LinearLayoutManager val layoutManager: LinearLayoutManager
private var bottomSheet: ConstraintLayout = rootView.findViewById(R.id.bottom_sheet) private var bottomSheet: ConstraintLayout? = rootView.findViewById(R.id.bottom_sheet)
//private var sheetMetadataViews: Group //private var sheetMetadataViews: Group
private var sleepTimerRunningViews: Group = rootView.findViewById(R.id.sleep_timer_running_views) private var sleepTimerRunningViews: Group? = rootView.findViewById(R.id.sleep_timer_running_views)
private var downloadProgressIndicator: ProgressBar = rootView.findViewById(R.id.download_progress_indicator) private var downloadProgressIndicator: ProgressBar? = rootView.findViewById(R.id.download_progress_indicator)
private var stationImageView: ImageView = rootView.findViewById(R.id.station_icon) private var stationImageView: ImageView? = rootView.findViewById(R.id.station_icon)
private var stationNameView: TextView = rootView.findViewById(R.id.player_station_name) private var stationNameView: TextView? = rootView.findViewById(R.id.player_station_name)
private var metadataView: TextView = rootView.findViewById(R.id.player_station_metadata) private var metadataView: TextView? = rootView.findViewById(R.id.player_station_metadata)
var playButtonView: ImageButton = rootView.findViewById(R.id.player_play_button) var playButtonView: ImageButton = rootView.findViewById(R.id.player_play_button)
var playerPrevButtonView: ImageButton? = rootView.findViewById(R.id.player_prev_button)
var playerNextButtonView: ImageButton? = rootView.findViewById(R.id.player_next_button)
private var bufferingIndicator: ProgressBar = rootView.findViewById(R.id.player_buffering_indicator) private var bufferingIndicator: ProgressBar = rootView.findViewById(R.id.player_buffering_indicator)
private var sheetStreamingLinkHeadline: TextView = rootView.findViewById(R.id.sheet_streaming_link_headline) private var sheetStreamingLinkHeadline: TextView? = rootView.findViewById(R.id.sheet_streaming_link_headline)
private var sheetStreamingLinkView: TextView = rootView.findViewById(R.id.sheet_streaming_link) private var sheetStreamingLinkView: TextView? = rootView.findViewById(R.id.sheet_streaming_link)
private var sheetMetadataHistoryHeadline: TextView = rootView.findViewById(R.id.sheet_metadata_headline) private var sheetMetadataHistoryHeadline: TextView? = rootView.findViewById(R.id.sheet_metadata_headline)
private var sheetMetadataHistoryView: TextView = rootView.findViewById(R.id.sheet_metadata_history) private var sheetMetadataHistoryView: TextView? = rootView.findViewById(R.id.sheet_metadata_history)
private var sheetNextMetadataView: ImageButton = rootView.findViewById(R.id.sheet_next_metadata_button) private var sheetNextMetadataView: ImageButton? = rootView.findViewById(R.id.sheet_next_metadata_button)
private var sheetPreviousMetadataView: ImageButton = rootView.findViewById(R.id.sheet_previous_metadata_button) private var sheetPreviousMetadataView: ImageButton? = rootView.findViewById(R.id.sheet_previous_metadata_button)
private var sheetCopyMetadataButtonView: ImageButton = rootView.findViewById(R.id.copy_station_metadata_button) private var sheetCopyMetadataButtonView: ImageButton? = rootView.findViewById(R.id.copy_station_metadata_button)
private var sheetShareLinkButtonView: ImageView = rootView.findViewById(R.id.sheet_share_link_button) private var sheetShareLinkButtonView: ImageView? = rootView.findViewById(R.id.sheet_share_link_button)
private var sheetBitrateView: TextView = rootView.findViewById(R.id.sheet_bitrate_view) private var sheetBitrateView: TextView? = rootView.findViewById(R.id.sheet_bitrate_view)
var sheetSleepTimerStartButtonView: ImageButton = rootView.findViewById(R.id.sleep_timer_start_button) var sheetSleepTimerStartButtonView: ImageButton? = rootView.findViewById(R.id.sleep_timer_start_button)
var sheetSleepTimerCancelButtonView: ImageButton = rootView.findViewById(R.id.sleep_timer_cancel_button) var sheetSleepTimerCancelButtonView: ImageButton? = rootView.findViewById(R.id.sleep_timer_cancel_button)
private var sheetSleepTimerRemainingTimeView: TextView = rootView.findViewById(R.id.sleep_timer_remaining_time) private var sheetSleepTimerRemainingTimeView: TextView = rootView.findViewById(R.id.sleep_timer_remaining_time)
private var onboardingLayout: ConstraintLayout = rootView.findViewById(R.id.onboarding_layout) private var onboardingLayout: ConstraintLayout = rootView.findViewById(R.id.onboarding_layout)
private var bottomSheetBehavior: BottomSheetBehavior<ConstraintLayout> = BottomSheetBehavior.from(bottomSheet) private var bottomSheetBehavior: BottomSheetBehavior<ConstraintLayout>? = bottomSheet?.let { BottomSheetBehavior.from(it) }
private var metadataHistory: MutableList<String> private var metadataHistory: MutableList<String>
private var metadataHistoryPosition: Int private var metadataHistoryPosition: Int
private var isBuffering: Boolean private var isBuffering: Boolean
@@ -96,31 +86,31 @@ data class LayoutHolder(var rootView: View) {
recyclerView.itemAnimator = DefaultItemAnimator() recyclerView.itemAnimator = DefaultItemAnimator()
// set up metadata history next and previous buttons // set up metadata history next and previous buttons
sheetPreviousMetadataView.setOnClickListener { sheetPreviousMetadataView?.setOnClickListener {
if (metadataHistory.isNotEmpty()) { if (metadataHistory.isNotEmpty()) {
if (metadataHistoryPosition > 0) { if (metadataHistoryPosition > 0) {
metadataHistoryPosition -= 1 metadataHistoryPosition -= 1
} else { } else {
metadataHistoryPosition = metadataHistory.size - 1 metadataHistoryPosition = metadataHistory.size - 1
} }
sheetMetadataHistoryView.text = metadataHistory[metadataHistoryPosition] sheetMetadataHistoryView?.text = metadataHistory[metadataHistoryPosition]
} }
} }
sheetNextMetadataView.setOnClickListener { sheetNextMetadataView?.setOnClickListener {
if (metadataHistory.isNotEmpty()) { if (metadataHistory.isNotEmpty()) {
if (metadataHistoryPosition < metadataHistory.size - 1) { if (metadataHistoryPosition < metadataHistory.size - 1) {
metadataHistoryPosition += 1 metadataHistoryPosition += 1
} else { } else {
metadataHistoryPosition = 0 metadataHistoryPosition = 0
} }
sheetMetadataHistoryView.text = metadataHistory[metadataHistoryPosition] sheetMetadataHistoryView?.text = metadataHistory[metadataHistoryPosition]
} }
} }
sheetMetadataHistoryView.setOnLongClickListener { sheetMetadataHistoryView?.setOnLongClickListener {
copyMetadataHistoryToClipboard() copyMetadataHistoryToClipboard()
return@setOnLongClickListener true return@setOnLongClickListener true
} }
sheetMetadataHistoryHeadline.setOnLongClickListener { sheetMetadataHistoryHeadline?.setOnLongClickListener {
copyMetadataHistoryToClipboard() copyMetadataHistoryToClipboard()
return@setOnLongClickListener true return@setOnLongClickListener true
} }
@@ -131,45 +121,54 @@ data class LayoutHolder(var rootView: View) {
/* Updates the player views */ /* Updates the player views */
@SuppressLint("DefaultLocale")
fun updatePlayerViews(context: Context, station: Station, isPlaying: Boolean) { fun updatePlayerViews(context: Context, station: Station, isPlaying: Boolean) {
// set default metadata views, when playback has stopped // set default metadata views, when playback has stopped
if (!isPlaying) { if (!isPlaying) {
metadataView.text = station.name metadataView?.text = station.name
sheetMetadataHistoryView.text = station.name sheetMetadataHistoryView?.text = station.name
// sheetMetadataHistoryView.isSelected = true // sheetMetadataHistoryView.isSelected = true
} }
// update name // update name
stationNameView.text = station.name stationNameView?.text = station.name
// toggle text scrolling (marquee) if necessary // toggle text scrolling (marquee) if necessary
stationNameView.isSelected = isPlaying stationNameView?.isSelected = isPlaying
// reduce the shadow left and right because of scrolling (Marquee) // reduce the shadow left and right because of scrolling (Marquee)
stationNameView.setFadingEdgeLength(8) stationNameView?.setFadingEdgeLength(8)
// update cover // update cover
if (station.imageColor != -1) { if (station.imageColor != -1) {
stationImageView.setBackgroundColor(station.imageColor) stationImageView?.setBackgroundColor(station.imageColor)
} }
stationImageView.setImageBitmap(ImageHelper.getStationImage(context, station.smallImage)) stationImageView?.setImageBitmap(ImageHelper.getStationImage(context, station.smallImage))
stationImageView.contentDescription = "${context.getString(R.string.descr_player_station_image)}: ${station.name}" stationImageView?.contentDescription = "${context.getString(R.string.descr_player_station_image)}: ${station.name}"
// update streaming link // update streaming link
sheetStreamingLinkView.text = station.getStreamUri() sheetStreamingLinkView?.text = station.getStreamUri()
val bitrateText: CharSequence = if (station.codec.isNotEmpty()) { val bitrateText: CharSequence = if (station.codec.isNotEmpty()) {
if (station.bitrate == 0) { if (station.bitrate == 0) {
// show only the codec when the bitrate is at "0" from radio-browser.info API // show only the codec when the bitrate is at "0" from radio-browser.info API
station.codec station.codec
} else { } else {
val kiloBytesPerSecond = station.bitrate / 8F
val dataRateString = if (kiloBytesPerSecond >= 1000) {
String.format("%.2f mb/s", kiloBytesPerSecond / 1000F)
} else {
String.format("%.0f kb/s", kiloBytesPerSecond)
}
// show the bitrate and codec if the result is available in the radio-browser.info API // show the bitrate and codec if the result is available in the radio-browser.info API
buildString { buildString {
append(station.codec) append(station.codec)
append(" | ") append(" | ")
append(station.bitrate) append(station.bitrate)
append("kbps") append("kbps")
append(" | ")
append(dataRateString)
} }
} }
} else { } else {
@@ -178,50 +177,50 @@ data class LayoutHolder(var rootView: View) {
} }
// update bitrate // update bitrate
sheetBitrateView.text = bitrateText sheetBitrateView?.text = bitrateText
// update click listeners // update click listeners
sheetStreamingLinkHeadline.setOnClickListener { sheetStreamingLinkHeadline?.setOnClickListener {
copyToClipboard( copyToClipboard(
context, context,
sheetStreamingLinkView.text sheetStreamingLinkView?.text ?: ""
) )
} }
sheetStreamingLinkView.setOnClickListener { sheetStreamingLinkView?.setOnClickListener {
copyToClipboard( copyToClipboard(
context, context,
sheetStreamingLinkView.text sheetStreamingLinkView?.text ?: ""
) )
} }
sheetMetadataHistoryHeadline.setOnClickListener { sheetMetadataHistoryHeadline?.setOnClickListener {
copyToClipboard( copyToClipboard(
context, context,
sheetMetadataHistoryView.text sheetMetadataHistoryView?.text ?: ""
) )
} }
sheetMetadataHistoryView.setOnClickListener { sheetMetadataHistoryView?.setOnClickListener {
copyToClipboard( copyToClipboard(
context, context,
sheetMetadataHistoryView.text sheetMetadataHistoryView?.text ?: ""
) )
} }
sheetCopyMetadataButtonView.setOnClickListener { sheetCopyMetadataButtonView?.setOnClickListener {
copyToClipboard( copyToClipboard(
context, context,
sheetMetadataHistoryView.text sheetMetadataHistoryView?.text ?: ""
) )
} }
sheetBitrateView.setOnClickListener { sheetBitrateView?.setOnClickListener {
copyToClipboard( copyToClipboard(
context, context,
sheetBitrateView.text sheetBitrateView?.text ?: ""
) )
} }
sheetShareLinkButtonView.setOnClickListener { sheetShareLinkButtonView?.setOnClickListener {
val share = Intent.createChooser(Intent().apply { val share = Intent.createChooser(Intent().apply {
action = Intent.ACTION_SEND action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TITLE, stationNameView.text) putExtra(Intent.EXTRA_TITLE, stationNameView?.text)
putExtra(Intent.EXTRA_TEXT, sheetStreamingLinkView.text) putExtra(Intent.EXTRA_TEXT, sheetStreamingLinkView?.text ?: "")
type = "text/plain" type = "text/plain"
}, null) }, null)
context.startActivity(share) context.startActivity(share)
@@ -254,11 +253,11 @@ data class LayoutHolder(var rootView: View) {
fun updateMetadata(metadataHistoryList: MutableList<String>?) { fun updateMetadata(metadataHistoryList: MutableList<String>?) {
if (!metadataHistoryList.isNullOrEmpty()) { if (!metadataHistoryList.isNullOrEmpty()) {
metadataHistory = metadataHistoryList metadataHistory = metadataHistoryList
if (metadataHistory.last() != metadataView.text) { if (metadataHistory.last() != metadataView?.text) {
metadataHistoryPosition = metadataHistory.size - 1 metadataHistoryPosition = metadataHistory.size - 1
val metadataString = metadataHistory[metadataHistoryPosition] val metadataString = metadataHistory[metadataHistoryPosition]
metadataView.text = metadataString metadataView?.text = metadataString
sheetMetadataHistoryView.text = metadataString sheetMetadataHistoryView?.text = metadataString
} }
} }
} }
@@ -268,14 +267,16 @@ data class LayoutHolder(var rootView: View) {
fun updateSleepTimer(context: Context, timeRemaining: Long = 0L) { fun updateSleepTimer(context: Context, timeRemaining: Long = 0L) {
when (timeRemaining) { when (timeRemaining) {
0L -> { 0L -> {
sleepTimerRunningViews.isGone = true sleepTimerRunningViews?.isGone = true
sheetSleepTimerRemainingTimeView.isVisible = false
} }
else -> { else -> {
sleepTimerRunningViews.isVisible = true sleepTimerRunningViews?.isVisible = true
sheetSleepTimerRemainingTimeView.isVisible = true
val sleepTimerTimeRemaining = DateTimeHelper.convertToHoursMinutesSeconds(timeRemaining) val sleepTimerTimeRemaining = DateTimeHelper.convertToHoursMinutesSeconds(timeRemaining)
sheetSleepTimerRemainingTimeView.text = sleepTimerTimeRemaining sheetSleepTimerRemainingTimeView.text = sleepTimerTimeRemaining
sheetSleepTimerRemainingTimeView.contentDescription = "${context.getString(R.string.descr_expanded_player_sleep_timer_remaining_time)}: $sleepTimerTimeRemaining" sheetSleepTimerRemainingTimeView.contentDescription = "${context.getString(R.string.descr_expanded_player_sleep_timer_remaining_time)}: $sleepTimerTimeRemaining"
stationNameView.isSelected = false stationNameView?.isSelected = false
} }
} }
} }
@@ -287,11 +288,11 @@ data class LayoutHolder(var rootView: View) {
playButtonView.setImageResource(R.drawable.ic_audio_waves_animated) playButtonView.setImageResource(R.drawable.ic_audio_waves_animated)
val animatedVectorDrawable = playButtonView.drawable as? AnimatedVectorDrawable val animatedVectorDrawable = playButtonView.drawable as? AnimatedVectorDrawable
animatedVectorDrawable?.start() animatedVectorDrawable?.start()
sheetSleepTimerStartButtonView.isVisible = true sheetSleepTimerStartButtonView?.isVisible = true
// bufferingIndicator.isVisible = false // bufferingIndicator.isVisible = false
} else { } else {
playButtonView.setImageResource(R.drawable.ic_player_play_symbol_42dp) playButtonView.setImageResource(R.drawable.ic_player_play_symbol_42dp)
sheetSleepTimerStartButtonView.isVisible = false sheetSleepTimerStartButtonView?.isVisible = false
// bufferingIndicator.isVisible = isBuffering // bufferingIndicator.isVisible = isBuffering
} }
} }
@@ -303,23 +304,11 @@ data class LayoutHolder(var rootView: View) {
isBuffering = buffering isBuffering = buffering
} }
/* Toggles visibility of player depending on playback state - hiding it when playback is stopped (not paused or playing) */
// fun togglePlayerVisibility(context: Context, playbackState: Int): Boolean {
// when (playbackState) {
// PlaybackStateCompat.STATE_STOPPED -> return hidePlayer(context)
// PlaybackStateCompat.STATE_NONE -> return hidePlayer(context)
// PlaybackStateCompat.STATE_ERROR -> return hidePlayer(context)
// else -> return showPlayer(context)
// }
// }
/* Toggles visibility of the download progress indicator */ /* Toggles visibility of the download progress indicator */
fun toggleDownloadProgressIndicator() { fun toggleDownloadProgressIndicator() {
when (PreferencesHelper.loadActiveDownloads()) { when (PreferencesHelper.loadActiveDownloads()) {
Keys.ACTIVE_DOWNLOADS_EMPTY -> downloadProgressIndicator.isGone = true Keys.ACTIVE_DOWNLOADS_EMPTY -> downloadProgressIndicator?.isGone = true
else -> downloadProgressIndicator.isVisible = true else -> downloadProgressIndicator?.isVisible = true
} }
} }
@@ -340,27 +329,27 @@ data class LayoutHolder(var rootView: View) {
/* Initiates the rotation animation of the play button */ /* Initiates the rotation animation of the play button */
fun animatePlaybackButtonStateTransition(context: Context, isPlaying: Boolean) { fun animatePlaybackButtonStateTransition(context: Context, isPlaying: Boolean) {
when (isPlaying) { if (context.packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
true -> { // TV: Toggle play button immediately for snappier feel
val rotateClockwise = AnimationUtils.loadAnimation(context, R.anim.rotate_clockwise_slow) togglePlayButton(isPlaying)
rotateClockwise.setAnimationListener(createAnimationListener(true)) } else {
playButtonView.startAnimation(rotateClockwise) // Handy/Tablet: Rotate the play button
} val rotateAnimation = AnimationUtils.loadAnimation(context, if (isPlaying) R.anim.rotate_clockwise_slow else R.anim.rotate_counterclockwise_fast)
false -> { rotateAnimation.setAnimationListener(createAnimationListener(isPlaying))
val rotateCounterClockwise = AnimationUtils.loadAnimation(context, R.anim.rotate_counterclockwise_fast) playButtonView.startAnimation(rotateAnimation)
rotateCounterClockwise.setAnimationListener(createAnimationListener(false))
playButtonView.startAnimation(rotateCounterClockwise)
}
} }
} }
/* Shows player */ /* Shows player */
fun showPlayer(context: Context): Boolean { fun showPlayer(context: Context): Boolean {
if (bottomSheetBehavior != null) {
UiHelper.setViewMargins(context, recyclerView, 0, 0, 0, Keys.BOTTOM_SHEET_PEEK_HEIGHT) UiHelper.setViewMargins(context, recyclerView, 0, 0, 0, Keys.BOTTOM_SHEET_PEEK_HEIGHT)
if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_HIDDEN && onboardingLayout.visibility == View.GONE) { if (bottomSheetBehavior?.state == BottomSheetBehavior.STATE_HIDDEN && onboardingLayout.isGone) {
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED bottomSheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
}
} else {
UiHelper.setViewMargins(context, recyclerView, 0, 0, 0, 0)
} }
return true return true
} }
@@ -369,15 +358,15 @@ data class LayoutHolder(var rootView: View) {
/* Hides player */ /* Hides player */
private fun hidePlayer(context: Context): Boolean { private fun hidePlayer(context: Context): Boolean {
UiHelper.setViewMargins(context, recyclerView, 0, 0, 0, 0) UiHelper.setViewMargins(context, recyclerView, 0, 0, 0, 0)
bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN bottomSheetBehavior?.state = BottomSheetBehavior.STATE_HIDDEN
return true return true
} }
/* Minimizes player sheet if expanded */ /* Minimizes player sheet if expanded */
fun minimizePlayerIfExpanded(): Boolean { fun minimizePlayerIfExpanded(): Boolean {
return if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_EXPANDED) { return if (bottomSheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED bottomSheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
true true
} else { } else {
false false
@@ -390,7 +379,7 @@ data class LayoutHolder(var rootView: View) {
return object : Animation.AnimationListener { return object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {} override fun onAnimationStart(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) { override fun onAnimationEnd(animation: Animation) {
// set up button symbol and playback indicator afterwards // set up button symbol and playback indicator afterward
togglePlayButton(isPlaying) togglePlayButton(isPlaying)
} }
@@ -401,9 +390,10 @@ data class LayoutHolder(var rootView: View) {
/* Sets up the player (BottomSheet) */ /* Sets up the player (BottomSheet) */
private fun setupBottomSheet() { private fun setupBottomSheet() {
if (bottomSheetBehavior != null) {
// show / hide the small player // show / hide the small player
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED bottomSheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
bottomSheetBehavior.addBottomSheetCallback(object : bottomSheetBehavior?.addBottomSheetCallback(object :
BottomSheetBehavior.BottomSheetCallback() { BottomSheetBehavior.BottomSheetCallback() {
override fun onSlide(view: View, slideOffset: Float) { override fun onSlide(view: View, slideOffset: Float) {
} }
@@ -420,19 +410,20 @@ data class LayoutHolder(var rootView: View) {
} }
}) })
// toggle collapsed state on tap // toggle collapsed state on tap
bottomSheet.setOnClickListener { toggleBottomSheetState() } bottomSheet?.setOnClickListener { toggleBottomSheetState() }
stationImageView.setOnClickListener { toggleBottomSheetState() } stationImageView?.setOnClickListener { toggleBottomSheetState() }
stationNameView.setOnClickListener { toggleBottomSheetState() } stationNameView?.setOnClickListener { toggleBottomSheetState() }
metadataView.setOnClickListener { toggleBottomSheetState() } metadataView?.setOnClickListener { toggleBottomSheetState() }
}
} }
/* Toggle expanded/collapsed state of bottom sheet */ /* Toggle expanded/collapsed state of bottom sheet */
private fun toggleBottomSheetState() { private fun toggleBottomSheetState() {
when (bottomSheetBehavior.state) { when (bottomSheetBehavior?.state) {
BottomSheetBehavior.STATE_COLLAPSED -> bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED -> bottomSheetBehavior?.state =
BottomSheetBehavior.STATE_EXPANDED BottomSheetBehavior.STATE_EXPANDED
else -> bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED else -> bottomSheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
} }
} }
@@ -440,7 +431,7 @@ data class LayoutHolder(var rootView: View) {
/* /*
* Inner class: Custom LinearLayoutManager * Inner class: Custom LinearLayoutManager
*/ */
private inner class CustomLayoutManager(context: Context) : private class CustomLayoutManager(context: Context) :
LinearLayoutManager(context, VERTICAL, false) { LinearLayoutManager(context, VERTICAL, false) {
override fun supportsPredictiveItemAnimations(): Boolean { override fun supportsPredictiveItemAnimations(): Boolean {
return true return true

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/list_card_stroke_focused" android:state_focused="true" />
<item android:color="@color/list_card_stroke_background" />
</selector>

View File

@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/icon_default"
android:pathData="m11.999,2.623c-5.54,0 -9.999,4.462 -9.999,10.001 -0,1.878 0.529,3.721 1.528,5.313l8.336,-10.778c0.06,-0.077 0.209,-0.077 0.27,0l3.482,4.502h-2.494l0.054,0.199h2.594l0.736,0.949h-3.062l0.086,0.311h3.217l0.647,0.836h-3.631l0.113,0.402h3.827l0.579,0.745h-4.198l0.137,0.49h4.438l0.508,0.655h-4.764l0.152,0.542h5.031l0.468,0.606h-5.33l0.152,0.542h5.598c0.998,-1.592 1.528,-3.435 1.528,-5.313 0,-5.54 -4.462,-10.001 -10.001,-10.001zM15.044,18.543 L15.196,19.085h4.438c0.145,-0.171 0.294,-0.361 0.428,-0.542zM15.365,19.69 L15.515,20.232h2.969c0.194,-0.166 0.405,-0.357 0.594,-0.542zM15.684,20.838 L15.836,21.377h1.003c0.296,-0.17 0.571,-0.343 0.868,-0.539z" />
</vector>

View File

@@ -0,0 +1,17 @@
<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="@color/icon_default"
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4
7.58,4 4,7.58 4,12h2
c0,-3.31 2.69,-6 6,-6
1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z
M6.35,17.65C7.8,19.1 9.79,20 12,20
c4.42,0 8,-3.58 8,-8h-2
c0,3.31 -2.69,6 -6,6
-1.66,0 -3.14,-0.69 -4.22,-1.78L11,13H4v7l2.35,-2.35z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/search_result_background_selected" android:state_focused="true" />
<item android:drawable="@android:color/transparent" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/list_card_stroke_focused" android:state_focused="true" />
<item android:color="@color/list_card_stroke_background" />
</selector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="#80FFFFFF" />
<corners android:radius="8dp" />
<stroke android:width="3dp" android:color="@color/default_neutral_white" />
</shape>
</item>
<item android:drawable="@android:color/transparent" />
</selector>

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- View is "selected" --> <!-- View is "selected" or "focused" (for TV) -->
<item android:drawable="@drawable/shape_search_result_item_selected" android:state_selected="true" /> <item android:drawable="@drawable/shape_search_result_item_selected" android:state_selected="true" />
<item android:drawable="@drawable/shape_search_result_item_selected" android:state_focused="true" />
<!-- Default state. --> <!-- Default state. -->
<item android:drawable="@drawable/shape_search_result_item" /> <item android:drawable="@drawable/shape_search_result_item" />

View File

@@ -1,8 +1,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"> android:shape="oval">
<stroke <stroke
android:width="2dp" android:width="4dp"
android:color="@color/default_neutral_lighter" /> android:color="@color/default_neutral_white" />
<size <size
android:width="56dp" android:width="56dp"
android:height="56dp" /> android:height="56dp" />

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splashBackgroundColor" />
<item
android:width="160dp"
android:height="160dp"
android:gravity="center">
<bitmap
android:gravity="center"
android:src="@mipmap/ic_launcher" />
</item>
</layer-list>

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_player_sheet_background"
android:padding="24dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/station_icon"
android:layout_width="120dp"
android:layout_height="120dp"
android:background="@drawable/shape_cover_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/RoundedCorners"
app:srcCompat="@drawable/ic_default_station_image_72dp" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/player_station_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium"
android:textColor="@color/player_sheet_text_main"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/player_play_button"
app:layout_constraintStart_toEndOf="@+id/station_icon"
app:layout_constraintTop_toTopOf="@+id/station_icon"
tools:text="Station Name" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/player_station_metadata"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
android:textColor="@color/player_sheet_text_main"
app:layout_constraintEnd_toEndOf="@+id/player_station_name"
app:layout_constraintStart_toStartOf="@+id/player_station_name"
app:layout_constraintTop_toBottomOf="@+id/player_station_name"
tools:text="Metadata Info" />
<ImageButton
android:id="@+id/player_play_button"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@drawable/selector_play_button"
android:focusable="true"
android:scaleType="center"
app:layout_constraintBottom_toBottomOf="@+id/station_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/station_icon"
app:srcCompat="@drawable/ic_player_play_symbol_42dp" />
<LinearLayout
android:id="@+id/detailed_controls_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@+id/station_icon">
<ImageButton
android:id="@+id/sheet_previous_metadata_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
app:srcCompat="@drawable/ic_chevron_left_24dp" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/sheet_metadata_history"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="16dp"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
android:textColor="@color/player_sheet_text_main"
tools:text="Metadata History" />
<ImageButton
android:id="@+id/sheet_next_metadata_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
app:srcCompat="@drawable/ic_chevron_right_24dp" />
<ImageButton
android:id="@+id/copy_station_metadata_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
app:srcCompat="@drawable/ic_copy_content_24dp" />
<ImageButton
android:id="@+id/sleep_timer_start_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
app:srcCompat="@drawable/ic_sleep_timer_24dp" />
<ImageButton
android:id="@+id/sleep_timer_cancel_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="8dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
android:visibility="gone"
app:srcCompat="@drawable/ic_clear_24dp" />
</LinearLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/sleep_timer_remaining_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.Material3.LabelLarge"
android:textColor="@color/player_sheet_text_main"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/detailed_controls_row"
tools:text="15:00" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="1000dp"
android:layout_height="500dp"
android:padding="16dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/station_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.7" />
<LinearLayout
android:id="@+id/dialog_button_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/dialog_positive_button"
style="@style/Widget.Material3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_find_station_button_add" />
<Button
android:id="@+id/dialog_negative_button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/dialog_generic_button_cancel" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="1000dp"
android:layout_height="500dp"
android:padding="16dp">
<androidx.appcompat.widget.SearchView
android:id="@+id/station_search_box_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:iconifiedByDefault="false"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:queryHint="@string/dialog_find_station_hint" />
<ProgressBar
android:id="@+id/search_request_progress_indicator"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/station_search_box_view"
app:layout_constraintStart_toStartOf="@+id/station_search_box_view"
app:layout_constraintTop_toBottomOf="@+id/station_search_box_view" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/no_results_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dialog_find_station_no_results"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/search_request_progress_indicator" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/station_search_result_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:clipToPadding="false"
android:paddingBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_results_text_view" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.7" />
<!-- Right side: Actions -->
<LinearLayout
android:id="@+id/dialog_button_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/dialog_positive_button"
style="@style/Widget.Material3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_find_station_button_add" />
<Button
android:id="@+id/dialog_negative_button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/dialog_generic_button_cancel" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="800dp"
android:layout_height="wrap_content"
android:padding="24dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/dialog_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dialog_error_message_default"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
android:textColor="@color/text_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/dialog_error_message_default" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/dialog_details_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:focusable="true"
android:clickable="true"
android:background="?attr/selectableItemBackground"
android:padding="8dp"
android:text="@string/dialog_generic_details_button"
android:textAppearance="@style/TextAppearance.Material3.LabelLarge"
android:textColor="@color/text_default"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dialog_message"
tools:text="@string/dialog_generic_details_button" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/dialog_details"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:focusable="true"
android:clickable="true"
android:scrollbars="vertical"
android:text="@string/dialog_opml_import_details_default"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
android:textColor="@color/text_default"
android:textIsSelectable="true"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dialog_details_link"
tools:text="@string/dialog_opml_import_details_default" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:focusable="true"
android:clickable="true"
android:nextFocusRight="@+id/dialog_positive_button"
android:background="@drawable/selector_search_result_item">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/station_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
android:textColor="@color/text_default"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Station Name" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/station_url"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="marquee"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
android:textColor="@color/text_lightweight"
app:layout_constraintEnd_toEndOf="@+id/station_name"
app:layout_constraintStart_toStartOf="@+id/station_name"
app:layout_constraintTop_toBottomOf="@+id/station_name"
tools:text="http://stream.url" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/station_bitrate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.Material3.LabelLarge"
android:textColor="@color/text_lightweight"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/station_url"
app:layout_constraintStart_toStartOf="@+id/station_url"
app:layout_constraintTop_toBottomOf="@+id/station_url"
tools:text="128 kbps" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@@ -0,0 +1,206 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/station_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:clipToPadding="false"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<include
layout="@layout/element_onboarding"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:background="@color/player_sheet_background"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/player_ui"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="24dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/station_icon"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_marginTop="16dp"
android:background="@drawable/shape_cover_small"
android:contentDescription="@string/descr_player_station_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/RoundedCorners"
app:srcCompat="@drawable/ic_default_station_image_72dp" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/player_station_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium"
android:textColor="@color/player_sheet_text_main"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/station_icon"
tools:text="Station Name" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/player_station_metadata"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:singleLine="true"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
android:textColor="@color/player_sheet_text_main"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/player_station_name"
tools:text="Artist - Title" />
<LinearLayout
android:id="@+id/controls_row"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/player_station_metadata">
<ImageButton
android:id="@+id/player_prev_button"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginEnd="16dp"
android:background="@drawable/selector_generic_button_focus"
android:contentDescription="@string/descr_expanded_player_metadata_previous_button"
android:focusable="true"
android:padding="12dp"
app:srcCompat="@drawable/ic_chevron_left_24dp" />
<ImageButton
android:id="@+id/player_play_button"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@drawable/selector_play_button"
android:contentDescription="@string/descr_player_playback_button"
android:focusable="true"
android:scaleType="center"
app:srcCompat="@drawable/ic_player_play_symbol_42dp" />
<ImageButton
android:id="@+id/player_next_button"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginStart="16dp"
android:background="@drawable/selector_generic_button_focus"
android:contentDescription="@string/descr_expanded_player_metadata_next_button"
android:focusable="true"
android:padding="12dp"
app:srcCompat="@drawable/ic_chevron_right_24dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/secondary_controls_row"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/controls_row">
<ImageButton
android:id="@+id/copy_station_metadata_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="12dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
android:padding="8dp"
app:srcCompat="@drawable/ic_copy_content_24dp"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/sleep_timer_start_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="12dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
android:padding="8dp"
app:srcCompat="@drawable/ic_sleep_timer_24dp"
tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/sleep_timer_cancel_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/selector_generic_button_focus"
android:focusable="true"
android:padding="8dp"
android:visibility="gone"
app:srcCompat="@drawable/ic_clear_24dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<ProgressBar
android:id="@+id/player_buffering_indicator"
style="?android:attr/progressBarStyleLarge"
android:layout_width="96dp"
android:layout_height="96dp"
android:indeterminateTint="@color/player_button_buffering"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@+id/controls_row"
app:layout_constraintEnd_toEndOf="@+id/controls_row"
app:layout_constraintStart_toStartOf="@+id/controls_row"
app:layout_constraintTop_toTopOf="@+id/controls_row" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/sleep_timer_remaining_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
android:textColor="@color/player_sheet_text_main"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/secondary_controls_row"
tools:text="15:00" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</LinearLayout>

View File

@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity"> tools:context=".MainActivity">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
@@ -28,4 +29,49 @@
app:layout_constraintTop_toBottomOf="@+id/main_toolbar" app:layout_constraintTop_toBottomOf="@+id/main_toolbar"
app:navGraph="@navigation/nav_graph_main" /> app:navGraph="@navigation/nav_graph_main" />
<!-- SPLASH / LOADING SCREEN -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/loading_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/splashBackgroundColor"
android:elevation="10dp"
android:visibility="visible">
<ImageView
android:id="@+id/loading_logo"
android:layout_width="160dp"
android:layout_height="160dp"
android:contentDescription="@string/icon_launcher"
android:src="@mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/loading"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
android:textColor="@color/default_neutral_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loading_logo" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:indeterminate="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loading_logo"
android:visibility="invisible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -12,6 +12,8 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="24dp" android:layout_marginBottom="24dp"
android:focusable="true"
android:clickable="true"
android:stateListAnimator="@null" android:stateListAnimator="@null"
app:backgroundTint="@color/list_card_background" app:backgroundTint="@color/list_card_background"
app:icon="@drawable/ic_add_24dp" app:icon="@drawable/ic_add_24dp"
@@ -28,6 +30,8 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="24dp" android:layout_marginBottom="24dp"
android:focusable="true"
android:clickable="true"
android:stateListAnimator="@null" android:stateListAnimator="@null"
app:backgroundTint="@color/list_card_background" app:backgroundTint="@color/list_card_background"
app:icon="@drawable/ic_settings_24dp" app:icon="@drawable/ic_settings_24dp"

View File

@@ -31,6 +31,21 @@
app:shapeAppearanceOverlay="@style/RoundedCorners" app:shapeAppearanceOverlay="@style/RoundedCorners"
app:srcCompat="@drawable/ic_default_station_image_72dp" /> app:srcCompat="@drawable/ic_default_station_image_72dp" />
<ProgressBar
android:id="@+id/download_progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:progressTint="@color/player_button_background"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/station_icon"
app:layout_constraintStart_toStartOf="@+id/station_icon"
app:layout_constraintTop_toTopOf="@+id/station_icon"
tools:visibility="visible" />
<com.google.android.material.imageview.ShapeableImageView <com.google.android.material.imageview.ShapeableImageView
android:id="@+id/change_image_view" android:id="@+id/change_image_view"
android:layout_width="0dp" android:layout_width="0dp"
@@ -155,6 +170,21 @@
app:layout_constraintEnd_toStartOf="@+id/save_button" app:layout_constraintEnd_toStartOf="@+id/save_button"
app:layout_constraintTop_toTopOf="@+id/save_button" /> app:layout_constraintTop_toTopOf="@+id/save_button" />
<ProgressBar
android:id="@+id/buffering_progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:progressTint="@color/player_button_background"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/default_edit_views" android:id="@+id/default_edit_views"
android:layout_width="0dp" android:layout_width="0dp"

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Appnavn -->
<!-- Tilgængelighedsbeskrivelser -->
<string name="descr_app_icon">App-ikon i form af en gammel radio</string>
<string name="descr_card_small_play_button">Afspil/Stop</string>
<string name="descr_card_starred_station">Favoritstation</string>
<string name="descr_card_station_image_change">Skift stationsbillede</string>
<string name="descr_card_station_image">Stationsbillede</string>
<string name="descr_expanded_player_metadata_copy_button">Kopiér oplysninger om den aktuelle afspilning</string>
<string name="descr_expanded_player_metadata_next_button">Næste metadataelement, der afspilles nu</string>
<string name="descr_expanded_player_metadata_previous_button">Forrige metadataelement, der afspilles</string>
<string name="descr_expanded_player_sleep_timer_cancel_button">Annuller soveur</string>
<string name="descr_expanded_player_sleep_timer_remaining_time">Resterende tid på soveuret</string>
<string name="descr_expanded_player_sleep_timer_start_button">Start soveur</string>
<string name="descr_player_playback_button">Afspil/Pause</string>
<string name="descr_player_station_image">Stationsbillede</string>
<!-- Dialoger -->
<string name="dialog_add_station_title">Tilføj station</string>
<string name="dialog_edit_station_name">Stationsnavn</string>
<string name="dialog_edit_stream_uri">Streamadresse</string>
<string name="dialog_error_message_default">Der opstod en fejl</string>
<string name="dialog_error_message_no_network">Opret forbindelse til internettet.</string>
<string name="dialog_error_title_no_network">Offline</string>
<string name="dialog_find_station_button_add">Tilføj</string>
<string name="dialog_find_station_hint">Navn eller streamadresse</string>
<string name="dialog_find_station_no_results">Ingen resultater fundet.</string>
<string name="dialog_find_station_title">Find station</string>
<string name="dialog_generic_button_cancel">Annuller</string>
<string name="dialog_generic_button_okay">OK</string>
<string name="dialog_generic_details_button">Vis detaljer</string>
<string name="dialog_opml_import_details_default">Ingen detaljer tilgængelige</string>
<string name="dialog_restore_collection_replace_existing">Vil du erstatte din nuværende stationssamling med den fra backup\'en?</string>
<string name="dialog_yes_no_message_remove_station">Fjern denne station?</string>
<string name="dialog_yes_no_message_update_station_images">Download den nyeste version af alle stationsbilleder?</string>
<string name="dialog_yes_no_positive_button_default">Ja</string>
<string name="dialog_yes_no_positive_button_remove_station">Fjern</string>
<string name="dialog_yes_no_positive_button_update_covers">Opdater</string>
<!-- Fragment -->
<string name="fragment_settings_title">Indstillinger</string>
<!-- Notifikation -->
<string name="notification_now_playing_channel_name">Afspilningskontrol</string>
<string name="notification_play">Afspil</string>
<string name="notification_stop">Stop</string>
<string name="notification_skip_to_previous">Forrige</string>
<string name="notification_skip_to_next">Næste</string>
<!-- Onboarding -->
<string name="onboarding_app_description">Fordyb dig i lyden du elsker!</string>
<string name="onboarding_app_get_started">Kom i gang</string>
<!-- Afspiller -->
<string name="player_sheet_h2_station_metadata">Spiller nu</string>
<string name="player_sheet_h2_stream_url">Streamadresse</string>
<!-- Indstillinger -->
<string name="pref_advanced_title">Avanceret</string>
<string name="pref_app_version_summary">Version</string>
<string name="pref_app_version_title">App-version</string>
<string name="pref_backup_import_export_title">Importer &amp; eksporter</string>
<string name="pref_buffer_size_summary_disabled">Standardbufferstørrelse bruges til at afspille radiostreams.</string>
<string name="pref_buffer_size_summary_enabled">Større buffer aktiveret. Det kan tage længere tid at starte afspilningen.</string>
<string name="pref_buffer_size_title">Brug større buffer</string>
<string name="pref_edit_station_stream_summary_disabled">Redigering af stream-links er deaktiveret.</string>
<string name="pref_edit_station_stream_summary_enabled">Redigering af stream-links er aktiveret. Sørg for at angive en korrekt streamadresse.</string>
<string name="pref_edit_station_summary_disabled">Redigering af stationsoplysninger er deaktiveret.</string>
<string name="pref_edit_station_summary_enabled">Redigering er aktiveret. Langt tryk for at redigere.</string>
<string name="pref_edit_station_title">Rediger station</string>
<string name="pref_general_title">Generelt</string>
<string name="pref_license_title">Denne app er open source</string>
<string name="pref_license_summary">Licenseret under MIT-licensen</string>
<string name="pref_links_title">Links</string>
<string name="pref_m3u_export_summary">Gem stationer som M3U-playlister til brug i andre afspillere.</string>
<string name="pref_m3u_export_title">Eksportér M3U-playliste</string>
<string name="pref_maintenance_title">Vedligeholdelse</string>
<string name="pref_pls_export_summary">Gem stationer som PLS-playlister til brug i andre afspillere.</string>
<string name="pref_pls_export_title">Eksportér PLS-playliste</string>
<string name="pref_station_export_summary">Gem hele stationssamlingen inkl. billeder på enheden.</string>
<string name="pref_station_export_title">Eksportér stationer</string>
<string name="pref_station_restore_summary">Gendan stationssamling fra backup. Eksisterende stationer erstattes.</string>
<string name="pref_station_restore_title">Importer stationer</string>
<string name="pref_theme_selection_mode_dark">Mørkt tema</string>
<string name="pref_theme_selection_mode_device_default">Systemstandard</string>
<string name="pref_theme_selection_mode_light">Lyst tema</string>
<string name="pref_theme_selection_summary">Aktuelt:</string>
<string name="pref_theme_selection_title">App-tema</string>
<string name="pref_update_station_images_summary">Download nyeste stationsbilleder.</string>
<string name="pref_update_station_images_title">Opdater stationsbilleder</string>
<!-- App-genveje -->
<string name="shortcut_last_station_disabled_message">Genvej til seneste station er deaktiveret.</string>
<string name="shortcut_last_station_long_label">Afspil seneste station</string>
<string name="shortcut_last_station_short_label">Seneste station</string>
<!-- Toasts -->
<string name="toastalert_failed_picking_media">Valg af billede mislykkedes.</string>
<string name="toastmessage_backed_up">blev sikkerhedskopieret.</string>
<string name="toastmessage_connection_failed">Forbindelse kunne ikke oprettes eller gendannes.</string>
<string name="toastmessage_copied_to_clipboard">Kopieret til udklipsholder</string>
<string name="toastmessage_error_download_error">Fejl under download</string>
<string name="toastmessage_error_restart_playback_failed">Kunne ikke starte eller genstarte afspilning</string>
<string name="toastmessage_install_file_helper">Installer en filhåndtering</string>
<string name="toastmessage_preview_playback_failed">Forhåndsvisning kunne ikke afspilles.</string>
<string name="toastmessage_preview_playback_started">Forhåndsvisning startet.</string>
<string name="toastmessage_restored">Stationer blev gendannet.</string>
<string name="toastmessage_save_m3u">Stationer gemt som M3U…</string>
<string name="toastmessage_save_pls">Stationer gemt som PLS…</string>
<string name="toastmessage_shortcut_created">Genvej tilføjet til startskærmen</string>
<string name="toastmessage_shortcut_not_created">Kunne ikke tilføje genvej. Enheden forhindrer det.</string>
<string name="toastmessage_sleep_timer_unable_to_start">Start afspilning først</string>
<string name="toastmessage_station_duplicate">Denne station findes allerede</string>
<string name="toastmessage_station_not_valid">Denne station findes ikke</string>
<string name="toastmessage_updating_collection">Opdaterer alle stationer</string>
<string name="toastmessage_updating_station_images">Opdaterer alle stationsbilleder</string>
<!-- Snackbars -->
<string name="snackbar_show">Vis</string>
<string name="snackbar_update_available">er tilgængelig!</string>
</resources>

View File

@@ -51,6 +51,10 @@
<string name="player_sheet_h2_station_metadata">Momentan läuft</string> <string name="player_sheet_h2_station_metadata">Momentan läuft</string>
<string name="player_sheet_h2_stream_url">Streaming-Adresse</string> <string name="player_sheet_h2_stream_url">Streaming-Adresse</string>
<!-- Settings --> <!-- Settings -->
<string name="pref_update_collection_title">Senderinformationnen aktualisieren</string>
<string name="pref_update_collection_summary">Die neueste Version aller Senderinformationen herunterladen.</string>
<string name="dialog_yes_no_message_update_collection">Die neueste Version aller Senderinformationen herunterladen?</string>
<string name="dialog_yes_no_positive_button_update_collection">Aktualisieren</string>
<string name="pref_advanced_title">Erweitert</string> <string name="pref_advanced_title">Erweitert</string>
<string name="pref_app_version_summary">Version</string> <string name="pref_app_version_summary">Version</string>
<string name="pref_app_version_title">App-Version</string> <string name="pref_app_version_title">App-Version</string>

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Nom de l'application -->
<!-- Descriptions d'accessibilité -->
<string name="descr_app_icon">Icône de lapplication en forme dancienne radio</string>
<string name="descr_card_small_play_button">Démarrer/Arrêter</string>
<string name="descr_card_starred_station">Station favorite</string>
<string name="descr_card_station_image_change">Changer limage de la station</string>
<string name="descr_card_station_image">Image de la station</string>
<string name="descr_expanded_player_metadata_copy_button">Copier les informations de lecture actuelles</string>
<string name="descr_expanded_player_metadata_next_button">Entrée suivante des métadonnées en cours de lecture</string>
<string name="descr_expanded_player_metadata_previous_button">Entrée précédente des métadonnées en cours de lecture</string>
<string name="descr_expanded_player_sleep_timer_cancel_button">Annuler la minuterie de sommeil</string>
<string name="descr_expanded_player_sleep_timer_remaining_time">Temps restant de la minuterie de sommeil</string>
<string name="descr_expanded_player_sleep_timer_start_button">Démarrer la minuterie de sommeil</string>
<string name="descr_player_playback_button">Lecture/Pause</string>
<string name="descr_player_station_image">Image de la station</string>
<!-- Dialogues -->
<string name="dialog_add_station_title">Ajouter une station</string>
<string name="dialog_edit_station_name">Nom de la station</string>
<string name="dialog_edit_stream_uri">Adresse du flux</string>
<string name="dialog_error_message_default">Une erreur est survenue</string>
<string name="dialog_error_message_no_network">Connectez-vous à Internet.</string>
<string name="dialog_error_title_no_network">Hors ligne</string>
<string name="dialog_find_station_button_add">Ajouter</string>
<string name="dialog_find_station_hint">Nom ou adresse du flux</string>
<string name="dialog_find_station_no_results">Aucun résultat trouvé.</string>
<string name="dialog_find_station_title">Trouver une station</string>
<string name="dialog_generic_button_cancel">Annuler</string>
<string name="dialog_generic_button_okay">OK</string>
<string name="dialog_generic_details_button">Afficher les détails</string>
<string name="dialog_opml_import_details_default">Aucun détail disponible</string>
<string name="dialog_restore_collection_replace_existing">Voulez-vous remplacer votre collection actuelle de stations par celle de la sauvegarde ?</string>
<string name="dialog_yes_no_message_remove_station">Supprimer cette station ?</string>
<string name="dialog_yes_no_message_update_station_images">Télécharger la dernière version de toutes les images des stations ?</string>
<string name="dialog_yes_no_positive_button_default">Oui</string>
<string name="dialog_yes_no_positive_button_remove_station">Supprimer</string>
<string name="dialog_yes_no_positive_button_update_covers">Mettre à jour</string>
<!-- Fragment -->
<string name="fragment_settings_title">Paramètres</string>
<!-- Notification -->
<string name="notification_now_playing_channel_name">Contrôle de lecture</string>
<string name="notification_play">Lecture</string>
<string name="notification_stop">Arrêt</string>
<string name="notification_skip_to_previous">Précédent</string>
<string name="notification_skip_to_next">Suivant</string>
<!-- Onboarding -->
<string name="onboarding_app_description">Plongez dans le son de votre choix !</string>
<string name="onboarding_app_get_started">Commencer maintenant</string>
<!-- Lecteur -->
<string name="player_sheet_h2_station_metadata">En cours de lecture</string>
<string name="player_sheet_h2_stream_url">Adresse du flux</string>
<!-- Paramètres -->
<string name="pref_advanced_title">Avancé</string>
<string name="pref_app_version_summary">Version</string>
<string name="pref_app_version_title">Version de lapplication</string>
<string name="pref_backup_import_export_title">Importer &amp; Exporter</string>
<string name="pref_buffer_size_summary_disabled">La taille de tampon standard est utilisée pour la lecture du flux radio.</string>
<string name="pref_buffer_size_summary_enabled">Taille de tampon plus grande activée. La lecture peut prendre plus de temps à démarrer.</string>
<string name="pref_buffer_size_title">Utiliser un tampon plus grand</string>
<string name="pref_edit_station_stream_summary_disabled">La modification des liens de streaming est désactivée.</string>
<string name="pref_edit_station_stream_summary_enabled">La modification des liens de streaming est activée. Assurez-vous dentrer une adresse de flux correcte.</string>
<string name="pref_edit_station_summary_disabled">La modification des informations de la station est désactivée.</string>
<string name="pref_edit_station_summary_enabled">La modification est activée. Maintenez appuyé pour éditer.</string>
<string name="pref_edit_station_title">Modifier la station</string>
<string name="pref_general_title">Général</string>
<string name="pref_license_title">Cette application est Open Source</string>
<string name="pref_license_summary">Sous licence MIT</string>
<string name="pref_links_title">Liens</string>
<string name="pref_m3u_export_summary">Enregistrez les stations dans un fichier de playlist M3U pouvant être importé dans dautres lecteurs.</string>
<string name="pref_m3u_export_title">Exporter la playlist M3U</string>
<string name="pref_maintenance_title">Maintenance</string>
<string name="pref_pls_export_summary">Enregistrez les stations dans un fichier de playlist PLS pouvant être importé dans dautres lecteurs.</string>
<string name="pref_pls_export_title">Exporter la playlist PLS</string>
<string name="pref_station_export_summary">Sauvegardez toute la collection de stations, y compris les images, sur lappareil.</string>
<string name="pref_station_export_title">Exporter les stations</string>
<string name="pref_station_restore_summary">Restaurer la collection de stations depuis la sauvegarde. Les stations existantes seront remplacées.</string>
<string name="pref_station_restore_title">Importer les stations</string>
<string name="pref_theme_selection_mode_dark">Thème sombre</string>
<string name="pref_theme_selection_mode_device_default">Par défaut du système</string>
<string name="pref_theme_selection_mode_light">Thème clair</string>
<string name="pref_theme_selection_summary">Actuel :</string>
<string name="pref_theme_selection_title">Thème de lapplication</string>
<string name="pref_update_station_images_summary">Télécharger la dernière version de toutes les images des stations.</string>
<string name="pref_update_station_images_title">Mettre à jour les images des stations</string>
<!-- Raccourcis de l'app -->
<string name="shortcut_last_station_disabled_message">Raccourci pour lire la dernière station désactivé.</string>
<string name="shortcut_last_station_long_label">Lire la dernière station</string>
<string name="shortcut_last_station_short_label">Dernière station</string>
<!-- Toasts -->
<string name="toastalert_failed_picking_media">Sélection dimage échouée.</string>
<string name="toastmessage_backed_up">a été sauvegardé avec succès.</string>
<string name="toastmessage_connection_failed">La connexion na pas pu être établie ou restaurée.</string>
<string name="toastmessage_copied_to_clipboard">Copié dans le presse-papiers</string>
<string name="toastmessage_error_download_error">Erreur lors du téléchargement</string>
<string name="toastmessage_error_restart_playback_failed">La lecture na pas pu être démarrée ou redémarrée</string>
<string name="toastmessage_install_file_helper">Veuillez installer un gestionnaire de fichiers</string>
<string name="toastmessage_preview_playback_failed">Lecture de prévisualisation impossible.</string>
<string name="toastmessage_preview_playback_started">Lecture de prévisualisation démarrée.</string>
<string name="toastmessage_restored">Stations restaurées avec succès.</string>
<string name="toastmessage_save_m3u">Stations enregistrées au format M3U…</string>
<string name="toastmessage_save_pls">Stations enregistrées au format PLS…</string>
<string name="toastmessage_shortcut_created">Raccourci ajouté à lécran daccueil</string>
<string name="toastmessage_shortcut_not_created">Impossible dajouter le raccourci. Lappareil lempêche.</string>
<string name="toastmessage_sleep_timer_unable_to_start">Veuillez démarrer la lecture dabord</string>
<string name="toastmessage_station_duplicate">Cette station existe déjà</string>
<string name="toastmessage_station_not_valid">Cette station nexiste pas</string>
<string name="toastmessage_updating_collection">Mise à jour de toutes les stations</string>
<string name="toastmessage_updating_station_images">Mise à jour de toutes les images des stations</string>
<!-- Snackbars -->
<string name="snackbar_show">Afficher</string>
<string name="snackbar_update_available">est disponible !</string>
</resources>

View File

@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- アプリ名 -->
<!-- アクセシビリティの説明 -->
<string name="descr_app_icon">昔のラジオの形をしたアプリアイコン</string>
<string name="descr_card_small_play_button">再生/停止</string>
<string name="descr_card_starred_station">お気に入りの局</string>
<string name="descr_card_station_image_change">局の画像を変更</string>
<string name="descr_card_station_image">局の画像</string>
<string name="descr_expanded_player_metadata_copy_button">現在再生中の情報をコピー</string>
<string name="descr_expanded_player_metadata_next_button">次の再生中のメタデータ項目</string>
<string name="descr_expanded_player_metadata_previous_button">前の再生中のメタデータ項目</string>
<string name="descr_expanded_player_sleep_timer_cancel_button">スリープタイマーをキャンセル</string>
<string name="descr_expanded_player_sleep_timer_remaining_time">スリープタイマーの残り時間</string>
<string name="descr_expanded_player_sleep_timer_start_button">スリープタイマーを開始</string>
<string name="descr_player_playback_button">再生/一時停止</string>
<string name="descr_player_station_image">局の画像</string>
<!-- ダイアログ -->
<string name="dialog_add_station_title">局を追加</string>
<string name="dialog_edit_station_name">局名</string>
<string name="dialog_edit_stream_uri">ストリームアドレス</string>
<string name="dialog_error_message_default">エラーが発生しました</string>
<string name="dialog_error_message_no_network">インターネットに接続してください。</string>
<string name="dialog_error_title_no_network">オフライン</string>
<string name="dialog_find_station_button_add">追加</string>
<string name="dialog_find_station_hint">名前またはストリームアドレス</string>
<string name="dialog_find_station_no_results">結果が見つかりませんでした。</string>
<string name="dialog_find_station_title">局を検索</string>
<string name="dialog_generic_button_cancel">キャンセル</string>
<string name="dialog_generic_button_okay">OK</string>
<string name="dialog_generic_details_button">詳細を表示</string>
<string name="dialog_opml_import_details_default">詳細情報はありません</string>
<string name="dialog_restore_collection_replace_existing">現在の局のコレクションをバックアップからのものに置き換えますか?</string>
<string name="dialog_yes_no_message_remove_station">この局を削除しますか?</string>
<string name="dialog_yes_no_message_update_station_images">すべての局の画像を最新に更新しますか?</string>
<string name="dialog_yes_no_positive_button_default">はい</string>
<string name="dialog_yes_no_positive_button_remove_station">削除</string>
<string name="dialog_yes_no_positive_button_update_covers">更新</string>
<!-- フラグメント -->
<string name="fragment_settings_title">設定</string>
<!-- 通知 -->
<string name="notification_now_playing_channel_name">再生コントロール</string>
<string name="notification_play">再生</string>
<string name="notification_stop">停止</string>
<string name="notification_skip_to_previous">前へ</string>
<string name="notification_skip_to_next">次へ</string>
<!-- オンボーディング -->
<string name="onboarding_app_description">お気に入りのサウンドの世界に飛び込もう!</string>
<string name="onboarding_app_get_started">今すぐ始める</string>
<!-- プレイヤー -->
<string name="player_sheet_h2_station_metadata">現在再生中</string>
<string name="player_sheet_h2_stream_url">ストリーミングアドレス</string>
<!-- 設定 -->
<string name="pref_advanced_title">詳細設定</string>
<string name="pref_app_version_summary">バージョン</string>
<string name="pref_app_version_title">アプリバージョン</string>
<string name="pref_backup_import_export_title">インポートとエクスポート</string>
<string name="pref_buffer_size_summary_disabled">ラジオストリーム再生には標準のバッファサイズが使用されます。</string>
<string name="pref_buffer_size_summary_enabled">大きなバッファを使用すると、再生の開始に時間がかかることがあります。</string>
<string name="pref_buffer_size_title">大きなバッファを使用</string>
<string name="pref_edit_station_stream_summary_disabled">ストリームリンクの編集は無効です。</string>
<string name="pref_edit_station_stream_summary_enabled">ストリームリンクの編集は有効です。正しいURLを入力してください。</string>
<string name="pref_edit_station_summary_disabled">局情報の編集は無効です。</string>
<string name="pref_edit_station_summary_enabled">局情報の編集は有効です。長押しで編集モードに入ります。</string>
<string name="pref_edit_station_title">局を編集</string>
<string name="pref_general_title">一般</string>
<string name="pref_license_title">このアプリはオープンソースです</string>
<string name="pref_license_summary">MITライセンスで提供されています</string>
<string name="pref_links_title">リンク</string>
<string name="pref_m3u_export_summary">ラジオ局をM3Uプレイリストとして保存し、他のプレイヤーにインポートできます。</string>
<string name="pref_m3u_export_title">M3Uプレイリストをエクスポート</string>
<string name="pref_maintenance_title">メンテナンス</string>
<string name="pref_pls_export_summary">ラジオ局をPLSプレイリストとして保存し、他のプレイヤーにインポートできます。</string>
<string name="pref_pls_export_title">PLSプレイリストをエクスポート</string>
<string name="pref_station_export_summary">局と画像を端末にバックアップとして保存します。</string>
<string name="pref_station_export_title">局をエクスポート</string>
<string name="pref_station_restore_summary">バックアップから局を復元します。現在の局は上書きされます。</string>
<string name="pref_station_restore_title">局をインポート</string>
<string name="pref_theme_selection_mode_dark">ダークテーマ</string>
<string name="pref_theme_selection_mode_device_default">システムデフォルト</string>
<string name="pref_theme_selection_mode_light">ライトテーマ</string>
<string name="pref_theme_selection_summary">現在:</string>
<string name="pref_theme_selection_title">アプリテーマ</string>
<string name="pref_update_station_images_summary">すべての局画像を最新に更新します。</string>
<string name="pref_update_station_images_title">局画像を更新</string>
<!-- ショートカット -->
<string name="shortcut_last_station_disabled_message">最後に再生した局のショートカットは無効になっています。</string>
<string name="shortcut_last_station_long_label">最後の局を再生</string>
<string name="shortcut_last_station_short_label">最後の局</string>
<!-- トーストアラート -->
<string name="toastalert_failed_picking_media">メディアの選択に失敗しました。</string>
<!-- トーストメッセージ -->
<string name="toastmessage_backed_up">正常にバックアップされました。</string>
<string name="toastmessage_connection_failed">接続に失敗しました。</string>
<string name="toastmessage_copied_to_clipboard">クリップボードにコピーしました</string>
<string name="toastmessage_error_download_error">ダウンロードエラー</string>
<string name="toastmessage_error_restart_playback_failed">再生の開始または再開に失敗しました</string>
<string name="toastmessage_install_file_helper">ファイルマネージャーをインストールしてください</string>
<string name="toastmessage_preview_playback_failed">プレビュー再生はできません。</string>
<string name="toastmessage_preview_playback_started">プレビュー再生を開始しました。</string>
<string name="toastmessage_restored">局が正常に復元されました。</string>
<string name="toastmessage_save_m3u">M3U形式で局を保存しました…</string>
<string name="toastmessage_save_pls">PLS形式で局を保存しました…</string>
<string name="toastmessage_shortcut_created">局をホーム画面に追加しました</string>
<string name="toastmessage_shortcut_not_created">局をホーム画面に追加できません。デバイスがショートカットの追加を制限しています。</string>
<string name="toastmessage_sleep_timer_unable_to_start">再生を開始してください</string>
<string name="toastmessage_station_duplicate">この局はすでに存在します</string>
<string name="toastmessage_station_not_valid">この局は存在しません</string>
<string name="toastmessage_updating_collection">すべての局を更新中</string>
<string name="toastmessage_updating_station_images">すべての局画像を更新中</string>
<!-- スナックバー -->
<string name="snackbar_show">表示</string>
<string name="snackbar_update_available">が利用可能です!</string>
</resources>

View File

@@ -11,6 +11,9 @@
<item name="colorOnSurfaceVariant">@android:color/system_accent1_100</item> <item name="colorOnSurfaceVariant">@android:color/system_accent1_100</item>
<item name="android:colorBackground">@android:color/system_neutral1_900</item> <item name="android:colorBackground">@android:color/system_neutral1_900</item>
<item name="android:textColorHighlight">@android:color/system_accent1_500</item> <item name="android:textColorHighlight">@android:color/system_accent1_500</item>
<item name="colorControlHighlight">#33FFFFFF</item>
<item name="android:colorControlHighlight">#33FFFFFF</item>
<item name="android:colorFocusedHighlight">#80FFFFFF</item>
<!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL --> <!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL -->
<item name="elevationOverlayEnabled">false</item> <item name="elevationOverlayEnabled">false</item>
@@ -39,6 +42,7 @@
<item name="colorSurface">@color/player_sheet_background</item> <item name="colorSurface">@color/player_sheet_background</item>
<item name="materialAlertDialogBodyTextStyle">@style/TextAppearance.MaterialComponents.Body1</item> <item name="materialAlertDialogBodyTextStyle">@style/TextAppearance.MaterialComponents.Body1</item>
<item name="android:backgroundDimAmount">0.64</item> <item name="android:backgroundDimAmount">0.64</item>
<item name="colorControlActivated">#FFDAE2FF</item>
</style> </style>
<style name="ThemeOverlay.App.TimePicker" parent="ThemeOverlay.MaterialComponents.TimePicker"> <style name="ThemeOverlay.App.TimePicker" parent="ThemeOverlay.MaterialComponents.TimePicker">
@@ -49,5 +53,12 @@
<item name="android:background">@color/player_sheet_background</item> <item name="android:background">@color/player_sheet_background</item>
<item name="dialogCornerRadius">28dp</item> <item name="dialogCornerRadius">28dp</item>
<item name="checkedTextViewStyle">@style/AlertDialog.TextColor</item> <item name="checkedTextViewStyle">@style/AlertDialog.TextColor</item>
<item name="colorControlActivated">#FFDAE2FF</item>
<item name="colorControlHighlight">#33FFFFFF</item>
<item name="android:colorFocusedHighlight">#80FFFFFF</item>
</style>
<style name="AlertDialog.TextColor" parent="@style/TextAppearance.MaterialComponents.Body1">
<item name="android:textColor">?attr/colorControlNormal</item>
</style> </style>
</resources> </resources>

View File

@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- NIGHT THEME COLORS --> <!-- NIGHT THEME COLORS -->

View File

@@ -7,6 +7,9 @@
<item name="colorAccent">#FFDAE2FF</item> <item name="colorAccent">#FFDAE2FF</item>
<item name="colorOnPrimary">#FF182E60</item> <item name="colorOnPrimary">#FF182E60</item>
<item name="android:textColorHighlight">#FF495D92</item> <item name="android:textColorHighlight">#FF495D92</item>
<item name="colorControlHighlight">#33FFFFFF</item>
<item name="android:colorControlHighlight">#33FFFFFF</item>
<item name="android:colorFocusedHighlight">#80FFFFFF</item>
<!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL --> <!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL -->
<item name="elevationOverlayEnabled">false</item> <item name="elevationOverlayEnabled">false</item>

View File

@@ -98,7 +98,7 @@
<string name="toastmessage_preview_playback_started">Было запущено воспроизведение предварительного просмотра.</string> <string name="toastmessage_preview_playback_started">Было запущено воспроизведение предварительного просмотра.</string>
<string name="toastmessage_restored">Станции были успешно восстановлены.</string> <string name="toastmessage_restored">Станции были успешно восстановлены.</string>
<string name="toastmessage_save_m3u">Сохранение радиостанций как M3U…</string> <string name="toastmessage_save_m3u">Сохранение радиостанций как M3U…</string>
<string name="toastmessage_save_pls">Сохранение радиостанций в формате PLS...</string> <string name="toastmessage_save_pls">Сохранение радиостанций в формате PLS</string>
<string name="toastmessage_shortcut_created">Ярлык создан.</string> <string name="toastmessage_shortcut_created">Ярлык создан.</string>
<string name="toastmessage_shortcut_not_created">Ярлык не создан. Устройство не позволяет создавать ярлыки.</string> <string name="toastmessage_shortcut_not_created">Ярлык не создан. Устройство не позволяет создавать ярлыки.</string>
<string name="toastmessage_sleep_timer_unable_to_start">Пожалуйста, запустите сперва воспроизведение.</string> <string name="toastmessage_sleep_timer_unable_to_start">Пожалуйста, запустите сперва воспроизведение.</string>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:statusBarColor">@color/splashBackgroundColor</item>
<item name="android:navigationBarColor">@color/splashBackgroundColor</item>
</style>
</resources>

View File

@@ -6,6 +6,9 @@
<item name="colorPrimary">#FF495D92</item> <item name="colorPrimary">#FF495D92</item>
<item name="colorAccent">#FF495D92</item> <item name="colorAccent">#FF495D92</item>
<item name="android:textColorHighlight">#FF495D92</item> <item name="android:textColorHighlight">#FF495D92</item>
<item name="colorControlHighlight">#33000000</item>
<item name="android:colorControlHighlight">#33000000</item>
<item name="android:colorFocusedHighlight">#80000000</item>
<!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL --> <!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL -->
<item name="elevationOverlayEnabled">false</item> <item name="elevationOverlayEnabled">false</item>

View File

@@ -11,6 +11,9 @@
<item name="colorOnSurfaceVariant">@android:color/system_accent1_600</item> <item name="colorOnSurfaceVariant">@android:color/system_accent1_600</item>
<item name="android:colorBackground">@android:color/system_neutral2_10</item> <item name="android:colorBackground">@android:color/system_neutral2_10</item>
<item name="android:textColorHighlight">@android:color/system_accent1_200</item> <item name="android:textColorHighlight">@android:color/system_accent1_200</item>
<item name="colorControlHighlight">#22000000</item>
<item name="android:colorControlHighlight">#22000000</item>
<item name="android:colorFocusedHighlight">#66000000</item>
<!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL --> <!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL -->
<item name="elevationOverlayEnabled">false</item> <item name="elevationOverlayEnabled">false</item>
@@ -38,6 +41,8 @@
<item name="colorSurface">@color/list_card_background</item> <item name="colorSurface">@color/list_card_background</item>
<item name="materialAlertDialogBodyTextStyle">@style/TextAppearance.MaterialComponents.Body1</item> <item name="materialAlertDialogBodyTextStyle">@style/TextAppearance.MaterialComponents.Body1</item>
<item name="android:backgroundDimAmount">0.64</item> <item name="android:backgroundDimAmount">0.64</item>
<item name="colorControlHighlight">#22000000</item>
<item name="android:colorFocusedHighlight">#66000000</item>
</style> </style>
<style name="ThemeOverlay.App.TimePicker" parent="ThemeOverlay.MaterialComponents.TimePicker"> <style name="ThemeOverlay.App.TimePicker" parent="ThemeOverlay.MaterialComponents.TimePicker">

View File

@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- DAY THEME COLORS --> <!-- DAY THEME COLORS -->
@@ -16,6 +15,7 @@
<!-- list --> <!-- list -->
<color name="list_card_background">#FFFEFBFF</color> <color name="list_card_background">#FFFEFBFF</color>
<color name="list_card_stroke_background">#FFC0C6DD</color> <color name="list_card_stroke_background">#FFC0C6DD</color>
<color name="list_card_stroke_focused">#FF495D92</color>
<color name="list_card_cover_background">#FFE7E0EC</color> <color name="list_card_cover_background">#FFE7E0EC</color>
<color name="list_card_delete_background">#FFB3261E</color> <color name="list_card_delete_background">#FFB3261E</color>
<color name="list_card_delete_icon">#FFFFFFFF</color> <color name="list_card_delete_icon">#FFFFFFFF</color>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- App Name --> <!-- App Name -->
<string name="app_version_name" translatable="false">\"Sweet\"</string> <string name="app_version_name" translatable="false">\"Red\"</string>
<!-- Accessibility Descriptions --> <!-- Accessibility Descriptions -->
<string name="descr_app_icon">App icon depicting an old radio</string> <string name="descr_app_icon">App icon depicting an old radio</string>
@@ -59,6 +59,10 @@
<string name="player_sheet_h2_stream_url">Streaming link</string> <string name="player_sheet_h2_stream_url">Streaming link</string>
<!-- Settings --> <!-- Settings -->
<string name="pref_update_collection_title">Update Stations</string>
<string name="pref_update_collection_summary">Download latest version of all station.</string>
<string name="dialog_yes_no_message_update_collection">Download latest version of all station?</string>
<string name="dialog_yes_no_positive_button_update_collection">Update</string>
<string name="pref_advanced_title">Advanced</string> <string name="pref_advanced_title">Advanced</string>
<string name="pref_app_version_summary">Version</string> <string name="pref_app_version_summary">Version</string>
<string name="pref_app_version_title">App Version</string> <string name="pref_app_version_title">App Version</string>
@@ -136,4 +140,6 @@
<string name="snackbar_url_app_home_page" translatable="false">https://github.com/michatec/Radio/releases/latest</string> <string name="snackbar_url_app_home_page" translatable="false">https://github.com/michatec/Radio/releases/latest</string>
<string name="snackbar_github_update_check_url" translatable="false">https://api.github.com/repos/michatec/Radio/releases/latest</string> <string name="snackbar_github_update_check_url" translatable="false">https://api.github.com/repos/michatec/Radio/releases/latest</string>
<string name="app_name" translatable="false">Radio</string> <string name="app_name" translatable="false">Radio</string>
<string name="icon_launcher" translatable="false">Icon launcher.</string>
<string name="loading">Loading...</string>
</resources> </resources>

View File

@@ -2,29 +2,24 @@
<resources> <resources>
<style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar"> <style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Set AppCompats colors -->
<item name="colorPrimary">#FF495D92</item> <item name="colorPrimary">#FF495D92</item>
<item name="colorAccent">#FF495D92</item> <item name="colorAccent">#FF495D92</item>
<item name="android:textColorHighlight">#FF495D92</item> <item name="android:textColorHighlight">#FF495D92</item>
<!-- Do not use primary colored elevation overlays to present a visual hierarchy - TOO COLORFUL -->
<item name="elevationOverlayEnabled">false</item> <item name="elevationOverlayEnabled">false</item>
<item name="colorControlActivated">#FFDAE2FF</item>
<!-- Switch Theming -->
<item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat.Material3</item> <item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat.Material3</item>
<!-- Material Alert Dialog Theming -->
<item name="materialAlertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</item> <item name="materialAlertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</item>
<item name="alertDialogTheme">@style/ThemeOverlay.App.AlertDialogTheme</item> <item name="alertDialogTheme">@style/ThemeOverlay.App.AlertDialogTheme</item>
<!-- Material Time Picker Theming -->
<item name="materialTimePickerTheme">@style/ThemeOverlay.App.TimePicker</item> <item name="materialTimePickerTheme">@style/ThemeOverlay.App.TimePicker</item>
<!-- Use "light" Status Bar -->
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="colorControlHighlight">#80000000</item>
<item name="android:colorControlHighlight">#80000000</item>
<item name="android:colorFocusedHighlight">#FF333333</item>
</style> </style>
<style name="SplashTheme" parent="AppTheme" />
<style name="Preference.SwitchPreferenceCompat.Material3" parent="@style/Preference.SwitchPreferenceCompat.Material"> <style name="Preference.SwitchPreferenceCompat.Material3" parent="@style/Preference.SwitchPreferenceCompat.Material">
<item name="widgetLayout">@layout/preference_switch</item> <item name="widgetLayout">@layout/preference_switch</item>
</style> </style>
@@ -38,7 +33,13 @@
<style name="ThemeOverlay.App.AlertDialogTheme" parent="@style/ThemeOverlay.Material3.MaterialAlertDialog"> <style name="ThemeOverlay.App.AlertDialogTheme" parent="@style/ThemeOverlay.Material3.MaterialAlertDialog">
<item name="android:background">@color/list_card_background</item> <item name="android:background">@color/list_card_background</item>
<item name="dialogCornerRadius">28dp</item> <item name="dialogCornerRadius">28dp</item>
<item name="checkedTextViewStyle">@style/AlertDialog.TextColor</item> <!-- TV Fix: Explicitly set accent color for radio buttons/checkboxes -->
<item name="colorAccent">@color/icon_default</item>
<item name="colorControlActivated">@color/icon_default</item>
<item name="android:textColorPrimary">@color/text_default</item>
<item name="android:textColorSecondary">@color/text_lightweight</item>
<item name="colorControlHighlight">#80000000</item>
<item name="android:colorFocusedHighlight">#FF333333</item>
</style> </style>
<style name="ThemeOverlay.App.TimePicker" parent="ThemeOverlay.MaterialComponents.TimePicker"> <style name="ThemeOverlay.App.TimePicker" parent="ThemeOverlay.MaterialComponents.TimePicker">
@@ -46,13 +47,16 @@
</style> </style>
<style name="AlertDialog.TextColor" parent="@style/TextAppearance.MaterialComponents.Body1"> <style name="AlertDialog.TextColor" parent="@style/TextAppearance.MaterialComponents.Body1">
<item name="android:textColor">?attr/colorControlNormal</item> <item name="android:textColor">@color/text_default</item>
</style> </style>
<style name="App.Widget.Material3.CardView.Outlined" parent="@style/Widget.Material3.CardView.Outlined"> <style name="App.Widget.Material3.CardView.Outlined" parent="@style/Widget.Material3.CardView.Outlined">
<item name="strokeColor">@color/list_card_stroke_background</item> <item name="strokeColor">@color/selector_card_station_stroke</item>
<item name="strokeWidth">3dp</item> <item name="strokeWidth">4dp</item>
<item name="cardCornerRadius">24dp</item> <item name="cardCornerRadius">24dp</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:descendantFocusability">afterDescendants</item>
</style> </style>
<style name="App.Widget.MaterialComponents.TextView" parent="@style/Widget.MaterialComponents.TextView"> <style name="App.Widget.MaterialComponents.TextView" parent="@style/Widget.MaterialComponents.TextView">

View File

@@ -17,4 +17,6 @@
<locale android:name="tr" /> <locale android:name="tr" />
<locale android:name="uk" /> <locale android:name="uk" />
<locale android:name="zh-rCN" /> <locale android:name="zh-rCN" />
<locale android:name="da" />
<locale android:name="ja" />
</locale-config> </locale-config>

View File

@@ -2,7 +2,7 @@
<paths> <paths>
<external-files-path <external-files-path
name="my_images" name="my_images"
path="Android/data/com.michatec.urlradio/files/Pictures" /> path="Android/data/com.michatec.radio/files/Pictures" />
<external-path <external-path
name="external_files" name="external_files"
path="." /> path="." />

View File

@@ -10,7 +10,7 @@
android:shortcutShortLabel="@string/shortcut_last_station_short_label"> android:shortcutShortLabel="@string/shortcut_last_station_short_label">
<intent <intent
android:action="com.jamal2367.urlradio.action.START" android:action="com.michatec.radio.action.START"
android:targetClass="com.michatec.radio.MainActivity" android:targetClass="com.michatec.radio.MainActivity"
android:targetPackage="com.michatec.radio"> android:targetPackage="com.michatec.radio">
<extra <extra

View File

@@ -1,11 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins { plugins {
id 'com.android.application' version '8.6.1' apply false alias libs.plugins.android.application apply false
id 'com.android.library' version '8.6.1' apply false alias libs.plugins.android.library apply false
id 'org.jetbrains.kotlin.android' version "1.9.21" apply false alias libs.plugins.jetbrains.kotlin.android apply false
} }
tasks.register('clean', Delete) { tasks.register('clean', Delete) {
delete rootProject.buildDir delete rootProject.buildDir()
} }

View File

@@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1536m
# enables androidx repo # enables androidx repo
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true org.gradle.configuration-cache=true

42
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,42 @@
[versions]
activityKtx = "1.13.0"
agp = "9.1.0"
coreKtx = "1.18.0"
freedroidwarn = "V1.10"
gson = "2.13.2"
kotlin = "2.3.20"
leanback = "1.2.0"
material = "1.13.0"
material3 = "1.4.0"
media = "1.7.1"
media3 = "1.10.0"
navigation = "2.9.7"
paletteKtx = "1.0.0"
preferenceKtx = "1.2.1"
volley = "1.2.1"
workRuntimeKtx = "2.11.2"
[libraries]
activity-ktx = { group = "androidx.activity", name = "activity-ktx", version.ref = "activityKtx" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
freedroidwarn = { group = "com.github.woheller69", name = "FreeDroidWarn", version.ref = "freedroidwarn" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
leanback = { group = "androidx.leanback", name = "leanback", version.ref = "leanback" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
media = { group = "androidx.media", name = "media", version.ref = "media" }
media3-datasource-okhttp = { group = "androidx.media3", name = "media3-datasource-okhttp", version.ref = "media3" }
media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" }
media3-exoplayer-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" }
media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigation" }
navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigation" }
palette-ktx = { group = "androidx.palette", name = "palette-ktx", version.ref = "paletteKtx" }
preference-ktx = { group = "androidx.preference", name = "preference-ktx", version.ref = "preferenceKtx" }
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
work-runtime-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "workRuntimeKtx" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

Binary file not shown.

View File

@@ -1,6 +1,7 @@
#Fri Jan 28 14:15:43 CET 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

310
gradlew vendored
View File

@@ -1,78 +1,128 @@
#!/usr/bin/env sh #!/bin/sh
#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # Gradle start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # This is normally unused
APP_BASE_NAME=`basename "$0"` # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
DEFAULT_JVM_OPTS="" APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -81,92 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC2039,SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC2039,SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=$(save "$@") # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong JAVACMD=$( cygpath --unix "$JAVACMD" )
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")" # Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

75
gradlew.bat vendored
View File

@@ -1,3 +1,21 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@@ -10,24 +28,28 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS= set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@@ -35,48 +57,35 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

7
renovate.json Normal file
View File

@@ -0,0 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

View File

@@ -3,13 +3,19 @@ pluginManagement {
google() google()
mavenCentral() mavenCentral()
gradlePluginPortal() gradlePluginPortal()
maven { url 'https://jitpack.io' }
} }
} }
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}
dependencyResolutionManagement { dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://jitpack.io' }
} }
} }