80 Commits
12.8 ... 14

Author SHA1 Message Date
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
29 changed files with 808 additions and 433 deletions

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

@@ -0,0 +1,92 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build and publish APK
on:
workflow_dispatch:
push:
tags:
- 'b*'
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@v3
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: 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
mv ${{ env.APK_PATH }} app-release.apk
${{ env.APKSIGNER }} sign --key key.der --cert cert.der app-release.apk
rm cert.der key.der
- name: Zipalign APK
run: |
/usr/local/lib/android/sdk/build-tools/34.0.0/zipalign -v -p 4 app-release.apk app-release-aligned.apk
mv app-release-aligned.apk app-release.apk
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: app-release
path: app-release.apk
publish:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: app-release
path: app-release.apk
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "app-release.apk"
draft: true

View File

@@ -60,7 +60,7 @@ You can help out the radio-browser.info community by [adding the missing station
<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' id 'com.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 140
versionName '12.8' versionName '14'
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,24 @@ 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 'com.google.android.material:material:1.13.0'
implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.google.code.gson:gson:2.13.2'
// AndroidX Stuff // // AndroidX Stuff //
implementation 'androidx.activity:activity-ktx:1.8.1' implementation 'androidx.core:core-ktx:1.17.0'
implementation 'androidx.activity:activity-ktx:1.12.2'
implementation 'androidx.palette:palette-ktx:1.0.0' implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.media:media:1.7.0' implementation 'androidx.media:media:1.7.1'
implementation 'androidx.media3:media3-exoplayer:1.2.0' implementation 'androidx.media3:media3-exoplayer:1.9.0'
implementation 'androidx.media3:media3-exoplayer-hls:1.2.0' implementation 'androidx.media3:media3-exoplayer-hls:1.9.0'
implementation 'androidx.media3:media3-session:1.2.0' implementation 'androidx.media3:media3-session:1.9.0'
implementation 'androidx.media3:media3-datasource-okhttp:1.2.0' implementation 'androidx.media3:media3-datasource-okhttp:1.9.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5' implementation 'androidx.navigation:navigation-fragment-ktx:2.9.6'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.5' implementation 'androidx.navigation:navigation-ui-ktx:2.9.6'
implementation 'androidx.work:work-runtime-ktx:2.9.0' implementation 'androidx.work:work-runtime-ktx:2.11.0'
// Volley HTTP request // // Volley HTTP request //
implementation 'com.android.volley:volley:1.2.1' implementation 'com.android.volley:volley:1.2.1'
implementation 'androidx.compose.material3:material3:1.4.0'
} }

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)
} }
@@ -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,8 +454,8 @@ 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)
@@ -498,22 +500,6 @@ class PlayerFragment : Fragment(),
} }
// /* 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() {
// get station // get station
@@ -549,7 +535,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 +545,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 +574,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())
} }
@@ -801,7 +787,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 +806,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()
} }
@@ -397,75 +397,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 +411,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()
setPlayerCommand(Player.COMMAND_SEEK_TO_PREVIOUS) .setPlayerCommand(Player.COMMAND_SEEK_TO_PREVIOUS)
setIconResId(R.drawable.ic_notification_skip_to_previous_36dp) .setIconResId(R.drawable.ic_notification_skip_to_previous_36dp)
setEnabled(true) .setEnabled(true)
}.build() .build()
val playCommandButton = CommandButton.Builder().apply { val playCommandButton = CommandButton.Builder()
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) .setIconResId(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()
setPlayerCommand(Player.COMMAND_SEEK_TO_NEXT) .setPlayerCommand(Player.COMMAND_SEEK_TO_NEXT)
setIconResId(R.drawable.ic_notification_skip_to_next_36dp) .setIconResId(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 +475,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()
} }
} }
} }
@@ -585,7 +516,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 +570,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
*/ */

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() {

View File

@@ -27,8 +27,6 @@ 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.core.os.bundleOf
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
@@ -62,20 +60,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 */
@@ -544,7 +529,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

@@ -264,12 +264,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 +280,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 +296,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
@@ -377,7 +378,7 @@ class CollectionAdapter(
} }
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 +387,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 +396,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 +405,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,7 +471,7 @@ class CollectionAdapter(
} else if (holder is StationViewHolder) { } else if (holder is StationViewHolder) {
// get station from position // get station from position
collection.stations[holder.getAdapterPosition()] collection.stations[holder.bindingAdapterPosition]
for (data in payloads) { for (data in payloads) {
when (data as Int) { when (data as Int) {
@@ -650,7 +651,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,7 +666,7 @@ 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)

View File

@@ -42,10 +42,6 @@ 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

View File

@@ -46,9 +46,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)

View File

@@ -15,7 +15,9 @@
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 com.michatec.radio.Keys import com.michatec.radio.Keys
@@ -33,6 +35,7 @@ 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 metadataString = String()
for (i in 0 until metadata.length()) { for (i in 0 until metadata.length()) {

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,

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

@@ -106,7 +106,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 +121,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 +133,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 +209,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 +219,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)
}
} }

View File

@@ -359,7 +359,7 @@ data class LayoutHolder(var rootView: View) {
/* Shows player */ /* Shows player */
fun showPlayer(context: Context): Boolean { fun showPlayer(context: Context): Boolean {
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
} }
return true return true
@@ -440,7 +440,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

@@ -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

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

@@ -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

@@ -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

@@ -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>

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

@@ -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 id 'com.android.application' version '9.0.0' apply false
id 'com.android.library' version '8.6.1' apply false id 'com.android.library' version '9.0.0' apply false
id 'org.jetbrains.kotlin.android' version "1.9.21" apply false id 'org.jetbrains.kotlin.android' version "2.3.0" 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

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.3.0-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/HEAD/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"
]
}