mirror of
https://github.com/Michatec/Radio.git
synced 2026-04-01 07:56:27 +02:00
Compare commits
83 Commits
13
...
c2cba26c66
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2cba26c66 | ||
|
|
9224e45b18 | ||
|
|
90164d7e6a | ||
|
|
45e208e7a9 | ||
|
|
1d040e3edc | ||
|
|
efe17bc82b | ||
|
|
8b06309c64 | ||
| 669fd4683c | |||
| 26b155a721 | |||
|
|
99f7863749 | ||
|
|
008170811a | ||
|
|
c0072fe54f | ||
| c62c61f2f1 | |||
| 5ca2b9b7ef | |||
|
|
9b5c7e3c04 | ||
|
|
4466654e92 | ||
|
|
b2de7bd534 | ||
|
|
d3dfcb98f9 | ||
|
|
0adb906438 | ||
|
|
49e63d3aaa | ||
|
|
f892a137ce | ||
|
|
364ef3db5d | ||
|
|
e22a5463bd | ||
|
|
51b37d8f7b | ||
|
|
5412f59f61 | ||
|
|
032728626e | ||
|
|
1daa762c07 | ||
|
|
bcc8af8e57 | ||
|
|
c045c03524 | ||
|
|
6e32b17b94 | ||
|
|
81427d3853 | ||
|
|
9b6b1afa68 | ||
|
|
cc631c14c4 | ||
|
|
eb55746a2e | ||
|
|
026b4936f5 | ||
|
|
1719b3079c | ||
|
|
89f08f284d | ||
|
|
ba34829de0 | ||
|
|
d797c07656 | ||
|
|
f9114ebfc9 | ||
|
|
7781868c38 | ||
|
|
c9c303df6e | ||
|
|
34971d4ea4 | ||
|
|
aa86fee1df | ||
|
|
282e83acae | ||
|
|
2fa6f9f368 | ||
|
|
1abcc04c72 | ||
|
|
a478aef494 | ||
|
|
68f0829a2f | ||
|
|
4dfcb13e6c | ||
|
|
e8fae6571c | ||
|
|
f1b1275e9d | ||
|
|
3741b7ec97 | ||
|
|
bc1b3e5835 | ||
|
|
d850df3b4e | ||
|
|
17851e36b8 | ||
|
|
a8e7ea6ea9 | ||
|
|
abdf9f7fb6 | ||
|
|
8edfb975a8 | ||
|
|
b3882dd97b | ||
|
|
18c7c5e261 | ||
|
|
41db8e6446 | ||
|
|
fdd0eb02c9 | ||
|
|
bc10527af0 | ||
|
|
c44d51bc53 | ||
|
|
4068c5363c | ||
|
|
26619b6ead | ||
|
|
cc174c7d15 | ||
|
|
a5281ca0ec | ||
|
|
0365952276 | ||
|
|
e327cd036f | ||
|
|
45cb807ee2 | ||
|
|
b18b1803b7 | ||
|
|
cda4970c5d | ||
|
|
209f26cca8 | ||
|
|
1ff6c4e791 | ||
|
|
1bb6794ced | ||
|
|
147e308711 | ||
|
|
26cb5cda08 | ||
|
|
6a74e64e87 | ||
|
|
efa03f7529 | ||
|
|
0a56971fa2 | ||
|
|
5ecbede8b5 |
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
42
.github/workflows/gradle-publish.yml
vendored
42
.github/workflows/gradle-publish.yml
vendored
@@ -1,13 +1,14 @@
|
||||
# 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-release-unsigned.apk
|
||||
APK_PATH: app/build/outputs/apk/release/Radio.apk
|
||||
APKSIGNER: /usr/local/lib/android/sdk/build-tools/34.0.0/apksigner
|
||||
|
||||
jobs:
|
||||
@@ -17,10 +18,10 @@ jobs:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: adopt
|
||||
@@ -28,7 +29,7 @@ jobs:
|
||||
|
||||
- name: Cache Android SDK
|
||||
#id: cache-android-sdk
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.ANDROID_HOME }}
|
||||
key: ${{ runner.os }}-android-sdk
|
||||
@@ -50,6 +51,10 @@ jobs:
|
||||
- name: Check APK path
|
||||
run: ls -R app/build/outputs/apk
|
||||
|
||||
- name: Zipalign APK
|
||||
run: |
|
||||
/usr/local/lib/android/sdk/build-tools/34.0.0/zipalign -v -p 4 ${{ env.APK_PATH }} app-release-aligned.apk
|
||||
|
||||
- name: Sign APK
|
||||
env:
|
||||
SIGN_CERT: ${{ secrets.SIGN_CERT }}
|
||||
@@ -57,35 +62,12 @@ jobs:
|
||||
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
|
||||
${{ env.APKSIGNER }} sign --key key.der --cert cert.der app-release-aligned.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@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
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@v4
|
||||
with:
|
||||
name: app-release
|
||||
path: app-release.apk
|
||||
|
||||
- name: Create release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "app-release.apk"
|
||||
draft: true
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<details>
|
||||
<summary>⚙️ Install Radio</summary>
|
||||
<br>
|
||||
<a href="https://github.com/michatec/Radio/releases/latest"><img src="https://user-images.githubusercontent.com/15986930/229208526-e5a63be5-0d0b-48ab-a222-9f2f2faf0ee4.png" height="80px"></a>
|
||||
<a href="https://github.com/michatec/Radio/releases/latest"><img src="https://user-images.githubusercontent.com/15986930/229208526-e5a63be5-0d0b-48ab-a222-9f2f2faf0ee4.png" alt="Preview" height="80px"></a>
|
||||
</details>
|
||||
|
||||
----------------------------------------
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-parcelize'
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
onVariants(selector().all()) { variant ->
|
||||
variant.outputs.forEach { output ->
|
||||
output.outputFileName.set("Radio.apk")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.michatec.radio'
|
||||
compileSdk 35
|
||||
compileSdk 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'com.michatec.radio'
|
||||
minSdk 28
|
||||
targetSdk 35
|
||||
versionCode 129
|
||||
versionName '12.9'
|
||||
targetSdk 36
|
||||
versionCode 141
|
||||
versionName '14.1'
|
||||
resourceConfigurations += ['en', 'de', 'el', 'nl', 'pl', 'ru','uk', 'ja', 'da', 'fr']
|
||||
setProperty('archivesBaseName', 'Radio')
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@@ -47,22 +55,24 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
// Google Stuff //
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
implementation 'com.google.android.material:material:1.13.0'
|
||||
implementation 'com.google.code.gson:gson:2.13.2'
|
||||
|
||||
// AndroidX Stuff //
|
||||
implementation 'androidx.activity:activity-ktx:1.10.1'
|
||||
implementation 'androidx.core:core-ktx:1.17.0'
|
||||
implementation 'androidx.activity:activity-ktx:1.12.4'
|
||||
implementation 'androidx.palette:palette-ktx:1.0.0'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.media:media:1.7.0'
|
||||
implementation 'androidx.media3:media3-exoplayer:1.7.1'
|
||||
implementation 'androidx.media3:media3-exoplayer-hls:1.7.1'
|
||||
implementation 'androidx.media3:media3-session:1.7.1'
|
||||
implementation 'androidx.media3:media3-datasource-okhttp:1.7.1'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.9.0'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.9.0'
|
||||
implementation 'androidx.work:work-runtime-ktx:2.10.1'
|
||||
implementation 'androidx.media:media:1.7.1'
|
||||
implementation 'androidx.media3:media3-exoplayer:1.9.2'
|
||||
implementation 'androidx.media3:media3-exoplayer-hls:1.9.2'
|
||||
implementation 'androidx.media3:media3-session:1.9.2'
|
||||
implementation 'androidx.media3:media3-datasource-okhttp:1.9.2'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.9.7'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.9.7'
|
||||
implementation 'androidx.work:work-runtime-ktx:2.11.1'
|
||||
|
||||
// Volley HTTP request //
|
||||
implementation 'com.android.volley:volley:1.2.1'
|
||||
implementation 'androidx.compose.material3:material3:1.4.0'
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</intent-filter>
|
||||
|
||||
<!-- react to playlist-links based on file extension -->
|
||||
<intent-filter>
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
@@ -73,7 +73,7 @@
|
||||
</intent-filter>
|
||||
|
||||
<!-- react to playlist-links based on mimetype -->
|
||||
<intent-filter>
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
@@ -81,7 +81,8 @@
|
||||
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
<data android:host="*" />
|
||||
<data android:host="*"
|
||||
tools:ignore="AppLinkUrlError" />
|
||||
<data android:mimeType="audio/x-scpls" />
|
||||
<data android:mimeType="audio/mpegurl" />
|
||||
<data android:mimeType="audio/x-mpegurl" />
|
||||
|
||||
@@ -60,7 +60,6 @@ object Keys {
|
||||
|
||||
// preferences
|
||||
const val PREF_RADIO_BROWSER_API: String = "RADIO_BROWSER_API"
|
||||
const val PREF_ONE_TIME_HOUSEKEEPING_NECESSARY: String = "ONE_TIME_HOUSEKEEPING_NECESSARY_VERSIONCODE_95" // increment to current app version code to trigger housekeeping that runs only once
|
||||
const val PREF_THEME_SELECTION: String = "THEME_SELECTION"
|
||||
const val PREF_LAST_UPDATE_COLLECTION: String = "LAST_UPDATE_COLLECTION"
|
||||
const val PREF_COLLECTION_SIZE: String = "COLLECTION_SIZE"
|
||||
@@ -138,7 +137,7 @@ object Keys {
|
||||
const val FOLDER_AUDIO: String = "audio"
|
||||
const val FOLDER_IMAGES: String = "images"
|
||||
const val FOLDER_TEMP: String = "temp"
|
||||
const val URLRADIO_LEGACY_FOLDER_COLLECTION: String = "Collection"
|
||||
const val RADIO_LEGACY_FOLDER_COLLECTION: String = "Collection"
|
||||
|
||||
// file names and extensions
|
||||
const val COLLECTION_FILE: String = "collection.json"
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.navigation.ui.NavigationUI
|
||||
import androidx.navigation.ui.navigateUp
|
||||
import com.michatec.radio.helpers.AppThemeHelper
|
||||
import com.michatec.radio.helpers.FileHelper
|
||||
import com.michatec.radio.helpers.ImportHelper
|
||||
import com.michatec.radio.helpers.PreferencesHelper
|
||||
|
||||
|
||||
@@ -41,18 +40,6 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// house-keeping: determine if edit stations is enabled by default todo: remove in 2023
|
||||
if (PreferencesHelper.isHouseKeepingNecessary()) {
|
||||
// house-keeping 1: remove hard coded default image
|
||||
ImportHelper.removeDefaultStationImageUris(this)
|
||||
// house-keeping 2: if existing user detected, enable Edit Stations by default
|
||||
if (PreferencesHelper.loadCollectionSize() != -1) {
|
||||
// existing user detected - enable Edit Stations by default
|
||||
PreferencesHelper.saveEditStationsEnabled(true)
|
||||
}
|
||||
PreferencesHelper.saveHouseKeepingNecessaryState()
|
||||
}
|
||||
|
||||
// set up views
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.PickVisualMediaRequest
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
@@ -40,6 +41,7 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.media3.common.MediaItem
|
||||
import androidx.media3.common.PlaybackException
|
||||
import androidx.media3.common.Player
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.session.MediaController
|
||||
import androidx.media3.session.SessionResult
|
||||
import androidx.media3.session.SessionToken
|
||||
@@ -180,8 +182,7 @@ class PlayerFragment : Fragment(),
|
||||
(activity as AppCompatActivity).supportActionBar?.hide()
|
||||
|
||||
// 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
|
||||
itemTouchHelper = ItemTouchHelper(ItemTouchHelperCallback())
|
||||
itemTouchHelper?.attachToRecyclerView(layout.recyclerView)
|
||||
@@ -209,14 +210,14 @@ class PlayerFragment : Fragment(),
|
||||
}
|
||||
|
||||
override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
|
||||
val fromPosition = viewHolder.adapterPosition
|
||||
val toPosition = target.adapterPosition
|
||||
val fromPosition = viewHolder.bindingAdapterPosition
|
||||
val toPosition = target.bindingAdapterPosition
|
||||
collectionAdapter.onItemMove(fromPosition, toPosition)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
|
||||
val position = viewHolder.adapterPosition
|
||||
val position = viewHolder.bindingAdapterPosition
|
||||
collectionAdapter.onItemDismiss(position)
|
||||
}
|
||||
|
||||
@@ -264,7 +265,7 @@ class PlayerFragment : Fragment(),
|
||||
// handle navigation arguments
|
||||
handleNavigationArguments()
|
||||
// // handle start intent - if started via tap on rss link
|
||||
// handleStartIntent()
|
||||
handleStartIntent()
|
||||
// start watching for changes in shared preferences
|
||||
PreferencesHelper.registerPreferenceChangeListener(this as SharedPreferences.OnSharedPreferenceChangeListener)
|
||||
}
|
||||
@@ -395,6 +396,7 @@ class PlayerFragment : Fragment(),
|
||||
|
||||
|
||||
/* Initializes the MediaController - handles connection to PlayerService under the hood */
|
||||
@OptIn(UnstableApi::class)
|
||||
private fun initializeController() {
|
||||
controllerFuture = MediaController.Builder(
|
||||
activity as Context,
|
||||
@@ -432,15 +434,15 @@ class PlayerFragment : Fragment(),
|
||||
val swipeToDeleteHandler = object : UiHelper.SwipeToDeleteCallback(activity as Context) {
|
||||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
|
||||
// ask user
|
||||
val adapterPosition: Int = viewHolder.adapterPosition
|
||||
val bindingAdapterPosition: Int = viewHolder.bindingAdapterPosition
|
||||
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(
|
||||
context = activity as Context,
|
||||
type = Keys.DIALOG_REMOVE_STATION,
|
||||
messageString = dialogMessage,
|
||||
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) {
|
||||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
|
||||
// mark card starred
|
||||
val adapterPosition: Int = viewHolder.adapterPosition
|
||||
collectionAdapter.toggleStarredStation(activity as Context, adapterPosition)
|
||||
val bindingAdapterPosition: Int = viewHolder.bindingAdapterPosition
|
||||
collectionAdapter.toggleStarredStation(activity as Context, bindingAdapterPosition)
|
||||
}
|
||||
}
|
||||
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 */
|
||||
private fun updatePlayerViews() {
|
||||
// get station
|
||||
@@ -549,7 +535,7 @@ class PlayerFragment : Fragment(),
|
||||
private fun requestSleepTimerUpdate() {
|
||||
val resultFuture: ListenableFuture<SessionResult>? =
|
||||
controller?.requestSleepTimerRemaining()
|
||||
resultFuture?.addListener(Runnable {
|
||||
resultFuture?.addListener({
|
||||
val timeRemaining: Long = resultFuture.get().extras.getLong(Keys.EXTRA_SLEEP_TIMER_REMAINING)
|
||||
layout.updateSleepTimer(activity as Context, timeRemaining)
|
||||
}, MoreExecutors.directExecutor())
|
||||
@@ -559,7 +545,7 @@ class PlayerFragment : Fragment(),
|
||||
/* Requests an update of the metadata history from the player service */
|
||||
private fun requestMetadataUpdate() {
|
||||
val resultFuture: ListenableFuture<SessionResult>? = controller?.requestMetadataHistory()
|
||||
resultFuture?.addListener(Runnable {
|
||||
resultFuture?.addListener({
|
||||
val metadata: ArrayList<String>? = resultFuture.get().extras.getStringArrayList(Keys.EXTRA_METADATA_HISTORY)
|
||||
layout.updateMetadata(metadata?.toMutableList())
|
||||
}, MoreExecutors.directExecutor())
|
||||
@@ -588,7 +574,7 @@ class PlayerFragment : Fragment(),
|
||||
/* Handles ACTION_SHOW_PLAYER request from notification */
|
||||
private fun handleShowPlayer() {
|
||||
Log.i(TAG, "Tap on notification registered.")
|
||||
// todo implement
|
||||
layout.showPlayer(requireActivity())
|
||||
}
|
||||
|
||||
|
||||
@@ -650,16 +636,16 @@ class PlayerFragment : Fragment(),
|
||||
collectionViewModel.collectionLiveData.observe(this) {
|
||||
// update collection
|
||||
collection = it
|
||||
//// // updates current station in player views
|
||||
//// playerState = PreferencesHelper.loadPlayerState()
|
||||
// updates current station in player views
|
||||
playerState = PreferencesHelper.loadPlayerState()
|
||||
// // get station
|
||||
// val station: Station = CollectionHelper.getStation(collection, playerState.stationUuid)
|
||||
val station: Station = CollectionHelper.getStation(collection, playerState.stationUuid)
|
||||
// // update player views
|
||||
// layout.updatePlayerViews(activity as Context, station, playerState.isPlaying)
|
||||
//// // handle start intent
|
||||
//// handleStartIntent()
|
||||
//// // handle navigation arguments
|
||||
//// handleNavigationArguments()
|
||||
layout.updatePlayerViews(activity as Context, station, playerState.isPlaying)
|
||||
// handle start intent
|
||||
handleStartIntent()
|
||||
// handle navigation arguments
|
||||
handleNavigationArguments()
|
||||
}
|
||||
collectionViewModel.collectionSizeLiveData.observe(this) {
|
||||
// size of collection changed
|
||||
@@ -801,7 +787,7 @@ class PlayerFragment : Fragment(),
|
||||
.setAction(R.string.snackbar_show) {
|
||||
val releaseurl = getString(R.string.snackbar_url_app_home_page)
|
||||
val i = Intent(Intent.ACTION_VIEW)
|
||||
i.data = Uri.parse(releaseurl)
|
||||
i.data = releaseurl.toUri()
|
||||
// Not sure that does anything
|
||||
i.putExtra("SOURCE", "SELF")
|
||||
startActivity(i)
|
||||
@@ -820,9 +806,4 @@ class PlayerFragment : Fragment(),
|
||||
request.tag = TAG
|
||||
queue.add(request)
|
||||
}
|
||||
|
||||
/*
|
||||
* End of declaration
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -280,19 +280,8 @@ class PlayerService : MediaLibraryService() {
|
||||
val updatedMediaItems: List<MediaItem> =
|
||||
mediaItems.map { mediaItem ->
|
||||
CollectionHelper.getItem(this@PlayerService, collection, mediaItem.mediaId)
|
||||
// if (mediaItem.requestMetadata.searchQuery != null)
|
||||
// getMediaItemFromSearchQuery(mediaItem.requestMetadata.searchQuery!!)
|
||||
// else MediaItemTree.getItem(mediaItem.mediaId) ?: mediaItem
|
||||
}
|
||||
return Futures.immediateFuture(updatedMediaItems)
|
||||
|
||||
|
||||
// val updatedMediaItems = mediaItems.map { mediaItem ->
|
||||
// mediaItem.buildUpon().apply {
|
||||
// setUri(mediaItem.requestMetadata.mediaUri)
|
||||
// }.build()
|
||||
// }
|
||||
// return Futures.immediateFuture(updatedMediaItems)
|
||||
}
|
||||
|
||||
|
||||
@@ -397,75 +386,6 @@ class PlayerService : MediaLibraryService() {
|
||||
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 +400,21 @@ class PlayerService : MediaLibraryService() {
|
||||
customLayout: ImmutableList<CommandButton>,
|
||||
showPauseButton: Boolean
|
||||
): ImmutableList<CommandButton> {
|
||||
val seekToPreviousCommandButton = CommandButton.Builder().apply {
|
||||
setPlayerCommand(Player.COMMAND_SEEK_TO_PREVIOUS)
|
||||
setIconResId(R.drawable.ic_notification_skip_to_previous_36dp)
|
||||
setEnabled(true)
|
||||
}.build()
|
||||
val playCommandButton = CommandButton.Builder().apply {
|
||||
setPlayerCommand(Player.COMMAND_PLAY_PAUSE)
|
||||
setIconResId(if (player.isPlaying) R.drawable.ic_notification_stop_36dp else R.drawable.ic_notification_play_36dp)
|
||||
setEnabled(true)
|
||||
}.build()
|
||||
val seekToNextCommandButton = CommandButton.Builder().apply {
|
||||
setPlayerCommand(Player.COMMAND_SEEK_TO_NEXT)
|
||||
setIconResId(R.drawable.ic_notification_skip_to_next_36dp)
|
||||
setEnabled(true)
|
||||
}.build()
|
||||
val seekToPreviousCommandButton = CommandButton.Builder()
|
||||
.setPlayerCommand(Player.COMMAND_SEEK_TO_PREVIOUS)
|
||||
.setIconResId(R.drawable.ic_notification_skip_to_previous_36dp)
|
||||
.setEnabled(true)
|
||||
.build()
|
||||
val playCommandButton = CommandButton.Builder()
|
||||
.setPlayerCommand(Player.COMMAND_PLAY_PAUSE)
|
||||
.setIconResId(if (player.isPlaying) R.drawable.ic_notification_stop_36dp else R.drawable.ic_notification_play_36dp)
|
||||
.setEnabled(true)
|
||||
.build()
|
||||
val seekToNextCommandButton = CommandButton.Builder()
|
||||
.setPlayerCommand(Player.COMMAND_SEEK_TO_NEXT)
|
||||
.setIconResId(R.drawable.ic_notification_skip_to_next_36dp)
|
||||
.setEnabled(true)
|
||||
.build()
|
||||
val commandButtons: MutableList<CommandButton> = mutableListOf(
|
||||
seekToPreviousCommandButton,
|
||||
playCommandButton,
|
||||
@@ -544,19 +464,19 @@ class PlayerService : MediaLibraryService() {
|
||||
when (player.playbackState) {
|
||||
// player is able to immediately play from its current position
|
||||
Player.STATE_READY -> {
|
||||
// todo
|
||||
stopSelf()
|
||||
}
|
||||
// buffering - data needs to be loaded
|
||||
Player.STATE_BUFFERING -> {
|
||||
// todo
|
||||
stopSelf()
|
||||
}
|
||||
// player finished playing all media
|
||||
Player.STATE_ENDED -> {
|
||||
// todo
|
||||
stopSelf()
|
||||
}
|
||||
// initial state or player is stopped or playback failed
|
||||
Player.STATE_IDLE -> {
|
||||
// todo
|
||||
stopSelf()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -567,15 +487,10 @@ class PlayerService : MediaLibraryService() {
|
||||
if (!playWhenReady) {
|
||||
when (reason) {
|
||||
Player.PLAY_WHEN_READY_CHANGE_REASON_END_OF_MEDIA_ITEM -> {
|
||||
// playback reached end: stop / end playback
|
||||
stopSelf()
|
||||
}
|
||||
else -> {
|
||||
// playback has been paused by user or OS: update media session and save state
|
||||
// PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST or
|
||||
// PLAY_WHEN_READY_CHANGE_REASON_AUDIO_FOCUS_LOSS or
|
||||
// PLAY_WHEN_READY_CHANGE_REASON_AUDIO_BECOMING_NOISY or
|
||||
// PLAY_WHEN_READY_CHANGE_REASON_REMOTE
|
||||
// handlePlaybackChange(PlaybackStateCompat.STATE_PAUSED)
|
||||
stopSelf()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -585,7 +500,10 @@ class PlayerService : MediaLibraryService() {
|
||||
override fun onPlayerError(error: PlaybackException) {
|
||||
super.onPlayerError(error)
|
||||
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 +554,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
|
||||
*/
|
||||
@@ -667,7 +569,6 @@ class PlayerService : MediaLibraryService() {
|
||||
intent.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, packageName)
|
||||
intent.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC)
|
||||
sendBroadcast(intent)
|
||||
// note: remember to broadcast AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION, when not needed anymore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ import com.michatec.radio.helpers.PreferencesHelper.initPreferences
|
||||
*/
|
||||
class Radio : Application() {
|
||||
|
||||
/* Define log tag */
|
||||
private val TAG: String = Radio::class.java.simpleName
|
||||
|
||||
/* Implements onCreate */
|
||||
override fun onCreate() {
|
||||
@@ -36,7 +34,6 @@ class Radio : Application() {
|
||||
AppThemeHelper.setTheme(PreferencesHelper.loadThemeSelection())
|
||||
}
|
||||
|
||||
|
||||
/* Implements onTerminate */
|
||||
override fun onTerminate() {
|
||||
super.onTerminate()
|
||||
|
||||
@@ -27,8 +27,6 @@ import android.view.View
|
||||
import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.navigation.fragment.findNavController
|
||||
@@ -62,20 +60,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
||||
(activity as AppCompatActivity).supportActionBar?.show()
|
||||
(activity as AppCompatActivity).supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
(activity as AppCompatActivity).supportActionBar?.title = getString(R.string.fragment_settings_title)
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
requireActivity().window.navigationBarColor = getColor(requireContext(), android.R.attr.colorBackground)
|
||||
}
|
||||
|
||||
/* Overrides onCreatePreferences from PreferenceFragmentCompat */
|
||||
@@ -131,16 +116,21 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
||||
}
|
||||
|
||||
|
||||
// // set up "Update Stations" preference
|
||||
// val preferenceUpdateCollection: Preference = Preference(activity as Context)
|
||||
// preferenceUpdateCollection.title = getString(R.string.pref_update_collection_title)
|
||||
// preferenceUpdateCollection.setIcon(R.drawable.ic_refresh_24dp)
|
||||
// preferenceUpdateCollection.summary = getString(R.string.pref_update_collection_summary)
|
||||
// preferenceUpdateCollection.setOnPreferenceClickListener {
|
||||
// // show dialog
|
||||
// YesNoDialog(this).show(context = activity as Context, type = Keys.DIALOG_UPDATE_COLLECTION, message = R.string.dialog_yes_no_message_update_collection, yesButton = R.string.dialog_yes_no_positive_button_update_collection)
|
||||
// return@setOnPreferenceClickListener true
|
||||
// }
|
||||
// set up "Update Stations" preference
|
||||
val preferenceUpdateCollection = Preference(activity as Context)
|
||||
preferenceUpdateCollection.title = getString(R.string.pref_update_collection_title)
|
||||
preferenceUpdateCollection.setIcon(R.drawable.ic_refresh_24dp)
|
||||
preferenceUpdateCollection.summary = getString(R.string.pref_update_collection_summary)
|
||||
preferenceUpdateCollection.setOnPreferenceClickListener {
|
||||
// show dialog
|
||||
YesNoDialog(this).show(
|
||||
context = activity as Context,
|
||||
type = Keys.DIALOG_UPDATE_COLLECTION,
|
||||
message = R.string.dialog_yes_no_message_update_collection,
|
||||
yesButton = R.string.dialog_yes_no_positive_button_update_collection,
|
||||
)
|
||||
return@setOnPreferenceClickListener true
|
||||
}
|
||||
|
||||
|
||||
// set up "M3U Export" preference
|
||||
@@ -314,7 +304,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
||||
screen.addPreference(preferenceThemeSelection)
|
||||
screen.addPreference(preferenceCategoryMaintenance)
|
||||
screen.addPreference(preferenceUpdateStationImages)
|
||||
// screen.addPreference(preferenceUpdateCollection)
|
||||
screen.addPreference(preferenceUpdateCollection)
|
||||
screen.addPreference(preferenceCategoryImportExport)
|
||||
screen.addPreference(preferenceM3uExport)
|
||||
screen.addPreference(preferencePlsExport)
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.cardview.widget.CardView
|
||||
@@ -193,6 +194,8 @@ class CollectionAdapter(
|
||||
setStationImage(stationViewHolder, station)
|
||||
setStationButtons(stationViewHolder, station)
|
||||
setEditViews(stationViewHolder, station)
|
||||
setPlaybackProgress(stationViewHolder, station)
|
||||
setDownloadProgress(stationViewHolder, station)
|
||||
|
||||
// show / hide edit views
|
||||
when (expandedStationPosition) {
|
||||
@@ -248,6 +251,28 @@ class CollectionAdapter(
|
||||
}
|
||||
|
||||
|
||||
/* Sets the playback progress view */
|
||||
private fun setPlaybackProgress(stationViewHolder: StationViewHolder, station: Station) {
|
||||
if (station.bufferingProgress > 0) {
|
||||
stationViewHolder.bufferingProgress.progress = station.bufferingProgress
|
||||
stationViewHolder.bufferingProgress.isVisible = true
|
||||
} else {
|
||||
stationViewHolder.bufferingProgress.isGone = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Sets the download progress view */
|
||||
private fun setDownloadProgress(stationViewHolder: StationViewHolder, station: Station) {
|
||||
if (station.downloadProgress > 0) {
|
||||
stationViewHolder.downloadProgress.progress = station.downloadProgress
|
||||
stationViewHolder.downloadProgress.isVisible = true
|
||||
} else {
|
||||
stationViewHolder.downloadProgress.isGone = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Sets the edit views */
|
||||
private fun setEditViews(stationViewHolder: StationViewHolder, station: Station) {
|
||||
stationViewHolder.stationNameEditView.setText(station.name, TextView.BufferType.EDITABLE)
|
||||
@@ -264,12 +289,12 @@ class CollectionAdapter(
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||
})
|
||||
stationViewHolder.cancelButton.setOnClickListener {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
|
||||
}
|
||||
stationViewHolder.saveButton.setOnClickListener {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
saveStation(
|
||||
station,
|
||||
@@ -280,15 +305,15 @@ class CollectionAdapter(
|
||||
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
|
||||
}
|
||||
stationViewHolder.placeOnHomeScreenButton.setOnClickListener {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
ShortcutHelper.placeShortcut(context, station)
|
||||
toggleEditViews(position, station.uuid)
|
||||
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
|
||||
}
|
||||
stationViewHolder.stationImageChangeView.setOnClickListener {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
collectionAdapterListener.onChangeImageButtonTapped(station.uuid)
|
||||
stationViewHolder.adapterPosition
|
||||
stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
UiHelper.hideSoftKeyboard(context, stationViewHolder.stationNameEditView)
|
||||
}
|
||||
@@ -296,6 +321,7 @@ class CollectionAdapter(
|
||||
|
||||
|
||||
/* Shows / hides the edit view for a station */
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun toggleEditViews(position: Int, stationUuid: String) {
|
||||
when (stationUuid) {
|
||||
// CASE: this station's edit view is already expanded
|
||||
@@ -377,7 +403,7 @@ class CollectionAdapter(
|
||||
}
|
||||
stationViewHolder.playButtonView.setOnLongClickListener {
|
||||
if (editStationsEnabled) {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
return@setOnLongClickListener true
|
||||
} else {
|
||||
@@ -386,7 +412,7 @@ class CollectionAdapter(
|
||||
}
|
||||
stationViewHolder.stationNameView.setOnLongClickListener {
|
||||
if (editStationsEnabled) {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
return@setOnLongClickListener true
|
||||
} else {
|
||||
@@ -395,7 +421,7 @@ class CollectionAdapter(
|
||||
}
|
||||
stationViewHolder.stationStarredView.setOnLongClickListener {
|
||||
if (editStationsEnabled) {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
return@setOnLongClickListener true
|
||||
} else {
|
||||
@@ -404,7 +430,7 @@ class CollectionAdapter(
|
||||
}
|
||||
stationViewHolder.stationImageView.setOnLongClickListener {
|
||||
if (editStationsEnabled) {
|
||||
val position: Int = stationViewHolder.adapterPosition
|
||||
val position: Int = stationViewHolder.bindingAdapterPosition
|
||||
toggleEditViews(position, station.uuid)
|
||||
return@setOnLongClickListener true
|
||||
} else {
|
||||
@@ -470,24 +496,25 @@ class CollectionAdapter(
|
||||
|
||||
} else if (holder is StationViewHolder) {
|
||||
// get station from position
|
||||
collection.stations[holder.getAdapterPosition()]
|
||||
val station: Station = collection.stations[holder.bindingAdapterPosition]
|
||||
|
||||
for (data in payloads) {
|
||||
when (data as Int) {
|
||||
Keys.HOLDER_UPDATE_COVER -> {
|
||||
// todo implement
|
||||
setStationImage(holder, station)
|
||||
setStarredIcon(holder, station)
|
||||
}
|
||||
Keys.HOLDER_UPDATE_NAME -> {
|
||||
// todo implement
|
||||
setStationName(holder, station)
|
||||
}
|
||||
Keys.HOLDER_UPDATE_PLAYBACK_STATE -> {
|
||||
// todo implement
|
||||
setStationButtons(holder, station)
|
||||
}
|
||||
Keys.HOLDER_UPDATE_PLAYBACK_PROGRESS -> {
|
||||
// todo implement
|
||||
setPlaybackProgress(holder, station)
|
||||
}
|
||||
Keys.HOLDER_UPDATE_DOWNLOAD_STATE -> {
|
||||
// todo implement
|
||||
setDownloadProgress(holder, station)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -574,21 +601,6 @@ class CollectionAdapter(
|
||||
}
|
||||
|
||||
|
||||
// /* Initiates update of a station's information */ // todo move to CollectionHelper
|
||||
// private fun updateStation(context: Context, station: Station) {
|
||||
// if (station.radioBrowserStationUuid.isNotEmpty()) {
|
||||
// // get updated station from radio browser - results are handled by onRadioBrowserSearchResults
|
||||
// val radioBrowserSearch: RadioBrowserSearch = RadioBrowserSearch(context, this)
|
||||
// radioBrowserSearch.searchStation(context, station.radioBrowserStationUuid, Keys.SEARCH_TYPE_BY_UUID)
|
||||
// } else if (station.remoteStationLocation.isNotEmpty()) {
|
||||
// // download playlist // todo check content type detection is necessary here
|
||||
// DownloadHelper.downloadPlaylists(context, arrayOf(station.remoteStationLocation))
|
||||
// } else {
|
||||
// Log.w(TAG, "Unable to update station: ${station.name}.")
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/* Determines if position is last */
|
||||
private fun isPositionFooter(position: Int): Boolean {
|
||||
return position == collection.stations.size
|
||||
@@ -599,7 +611,7 @@ class CollectionAdapter(
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun updateRecyclerView(oldCollection: Collection, newCollection: Collection) {
|
||||
collection = newCollection
|
||||
if (oldCollection.stations.size == 0 && newCollection.stations.size > 0) {
|
||||
if (oldCollection.stations.isEmpty() && newCollection.stations.isNotEmpty()) {
|
||||
// data set has been initialized - redraw the whole list
|
||||
notifyDataSetChanged()
|
||||
} else {
|
||||
@@ -650,7 +662,7 @@ class CollectionAdapter(
|
||||
/*
|
||||
* Inner class: ViewHolder for the Add New Station action
|
||||
*/
|
||||
private inner class AddNewViewHolder(listItemAddNewLayout: View) :
|
||||
private class AddNewViewHolder(listItemAddNewLayout: View) :
|
||||
RecyclerView.ViewHolder(listItemAddNewLayout) {
|
||||
val addNewStationView: ExtendedFloatingActionButton =
|
||||
listItemAddNewLayout.findViewById(R.id.card_add_new_station)
|
||||
@@ -665,12 +677,14 @@ class CollectionAdapter(
|
||||
/*
|
||||
* Inner class: ViewHolder for a station
|
||||
*/
|
||||
private inner class StationViewHolder(stationCardLayout: View) :
|
||||
private class StationViewHolder(stationCardLayout: View) :
|
||||
RecyclerView.ViewHolder(stationCardLayout) {
|
||||
val stationCardView: CardView = stationCardLayout.findViewById(R.id.station_card)
|
||||
val stationImageView: ImageView = stationCardLayout.findViewById(R.id.station_icon)
|
||||
val stationNameView: TextView = stationCardLayout.findViewById(R.id.station_name)
|
||||
val stationStarredView: ImageView = stationCardLayout.findViewById(R.id.starred_icon)
|
||||
val bufferingProgress: ProgressBar = stationCardLayout.findViewById(R.id.buffering_progress)
|
||||
val downloadProgress: ProgressBar = stationCardLayout.findViewById(R.id.download_progress)
|
||||
|
||||
// val menuButtonView: ImageView = stationCardLayout.findViewById(R.id.menu_button)
|
||||
val playButtonView: ImageView = stationCardLayout.findViewById(R.id.playback_button)
|
||||
|
||||
@@ -48,7 +48,9 @@ data class Station(
|
||||
@Expose var radioBrowserStationUuid: String = String(),
|
||||
@Expose var radioBrowserChangeUuid: String = String(),
|
||||
@Expose var bitrate: Int = 0,
|
||||
@Expose var codec: String = String()
|
||||
@Expose var codec: String = String(),
|
||||
@Expose var bufferingProgress: Int = 0,
|
||||
@Expose var downloadProgress: Int = 0
|
||||
) : Parcelable {
|
||||
|
||||
|
||||
@@ -79,6 +81,12 @@ data class Station(
|
||||
}
|
||||
|
||||
|
||||
/* Getter for media type */
|
||||
fun getMediaType(): String {
|
||||
return streamContent
|
||||
}
|
||||
|
||||
|
||||
/* Creates a deep copy of a Station */
|
||||
fun deepCopy(): Station {
|
||||
return Station(
|
||||
@@ -101,7 +109,9 @@ data class Station(
|
||||
radioBrowserStationUuid = radioBrowserStationUuid,
|
||||
radioBrowserChangeUuid = radioBrowserChangeUuid,
|
||||
bitrate = bitrate,
|
||||
codec = codec
|
||||
codec = codec,
|
||||
bufferingProgress = bufferingProgress,
|
||||
downloadProgress = downloadProgress
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,10 +42,6 @@ class AddStationDialog (
|
||||
}
|
||||
|
||||
|
||||
/* Define log tag */
|
||||
private val TAG = AddStationDialog::class.java.simpleName
|
||||
|
||||
|
||||
/* Main class variables */
|
||||
private lateinit var dialog: AlertDialog
|
||||
private lateinit var stationSearchResultList: RecyclerView
|
||||
|
||||
@@ -19,6 +19,7 @@ import android.text.method.ScrollingMovementMethod
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
@@ -46,9 +47,9 @@ class ErrorDialog {
|
||||
// get views
|
||||
val inflater: LayoutInflater = LayoutInflater.from(context)
|
||||
val view: View = inflater.inflate(R.layout.dialog_generic_with_details, null)
|
||||
val errorMessageView: TextView = view.findViewById(R.id.dialog_message) as TextView
|
||||
val errorDetailsLinkView: TextView = view.findViewById(R.id.dialog_details_link) as TextView
|
||||
val errorDetailsView: TextView = view.findViewById(R.id.dialog_details) as TextView
|
||||
val errorMessageView: TextView = view.findViewById(R.id.dialog_message)
|
||||
val errorDetailsLinkView: TextView = view.findViewById(R.id.dialog_details_link)
|
||||
val errorDetailsView: TextView = view.findViewById(R.id.dialog_details)
|
||||
|
||||
// set dialog view
|
||||
builder.setView(view)
|
||||
@@ -81,8 +82,7 @@ class ErrorDialog {
|
||||
|
||||
// add okay button
|
||||
builder.setPositiveButton(R.string.dialog_generic_button_okay) { _, _ ->
|
||||
// listen for click on okay button
|
||||
// do nothing
|
||||
Toast.makeText(context, R.string.dialog_generic_button_okay, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
// display error dialog
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
package com.michatec.radio.helpers
|
||||
|
||||
import android.util.Log
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.Metadata
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.extractor.metadata.icy.IcyHeaders
|
||||
import androidx.media3.extractor.metadata.icy.IcyInfo
|
||||
import androidx.media3.extractor.metadata.id3.Id3Frame
|
||||
import androidx.media3.extractor.metadata.id3.TextInformationFrame
|
||||
import com.michatec.radio.Keys
|
||||
import kotlin.math.min
|
||||
|
||||
@@ -33,29 +37,53 @@ object AudioHelper {
|
||||
|
||||
|
||||
/* Extract audio stream metadata */
|
||||
@OptIn(UnstableApi::class)
|
||||
fun getMetadataString(metadata: Metadata): String {
|
||||
var metadataString = String()
|
||||
var title = ""
|
||||
var artist = ""
|
||||
var album = ""
|
||||
for (i in 0 until metadata.length()) {
|
||||
// extract IceCast metadata
|
||||
when (val entry = metadata.get(i)) {
|
||||
is IcyInfo -> {
|
||||
metadataString = entry.title.toString()
|
||||
title = entry.title.toString()
|
||||
}
|
||||
|
||||
is IcyHeaders -> {
|
||||
Log.i(TAG, "icyHeaders:" + entry.name + " - " + entry.genre)
|
||||
}
|
||||
|
||||
is Id3Frame -> {
|
||||
when (entry) {
|
||||
is TextInformationFrame -> {
|
||||
when (entry.id) {
|
||||
"TIT2" -> title = entry.values.getOrNull(0) ?: "" // Title
|
||||
"TPE1" -> artist = entry.values.getOrNull(0) ?: "" // Artist
|
||||
"TALB" -> album = entry.values.getOrNull(0) ?: "" // Album
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
Log.d(TAG, "Unhandled ID3 frame: ${entry.javaClass.simpleName}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
Log.w(TAG, "Unsupported metadata received (type = ${entry.javaClass.simpleName})")
|
||||
}
|
||||
}
|
||||
// TODO implement HLS metadata extraction (Id3Frame / PrivFrame)
|
||||
// https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/metadata/Metadata.Entry.html
|
||||
}
|
||||
// Build metadata string
|
||||
var metadataString = title
|
||||
if (artist.isNotEmpty() && title.isNotEmpty()) {
|
||||
metadataString = "$artist - $title"
|
||||
}
|
||||
if (album.isNotEmpty() && metadataString.isNotEmpty()) {
|
||||
metadataString += " ($album)"
|
||||
}
|
||||
// ensure a max length of the metadata string
|
||||
if (metadataString.isNotEmpty()) {
|
||||
metadataString = metadataString.substring(0, min(metadataString.length, Keys.DEFAULT_MAX_LENGTH_OF_METADATA_ENTRY))
|
||||
metadataString = metadataString.take(min(metadataString.length, Keys.DEFAULT_MAX_LENGTH_OF_METADATA_ENTRY))
|
||||
}
|
||||
return metadataString
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
fun getStationPosition(collection: Collection, stationUuid: String): Int {
|
||||
collection.stations.forEachIndexed { stationId, station ->
|
||||
@@ -561,7 +535,7 @@ object CollectionHelper {
|
||||
fun exportCollectionM3u(context: Context, collection: Collection) {
|
||||
Log.v(TAG, "Exporting collection of stations as M3U")
|
||||
// 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 {
|
||||
FileHelper.backupCollectionAsM3uSuspended(
|
||||
context,
|
||||
@@ -603,7 +577,7 @@ object CollectionHelper {
|
||||
fun exportCollectionPls(context: Context, collection: Collection) {
|
||||
Log.v(TAG, "Exporting collection of stations as PLS")
|
||||
// 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 {
|
||||
FileHelper.backupCollectionAsPlsSuspended(
|
||||
context,
|
||||
@@ -670,51 +644,8 @@ object CollectionHelper {
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(collectionChangedIntent)
|
||||
}
|
||||
|
||||
|
||||
// /* Creates MediaMetadata for a single station - used in media session*/
|
||||
// fun buildStationMediaMetadata(context: Context, station: Station, metadata: String): MediaMetadataCompat {
|
||||
// return MediaMetadataCompat.Builder().apply {
|
||||
// putString(MediaMetadataCompat.METADATA_KEY_ARTIST, station.name)
|
||||
// putString(MediaMetadataCompat.METADATA_KEY_TITLE, metadata)
|
||||
// putString(MediaMetadataCompat.METADATA_KEY_ALBUM, context.getString(R.string.app_name))
|
||||
// putString(MediaMetadataCompat.METADATA_KEY_MEDIA_URI, station.getStreamUri())
|
||||
// putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, ImageHelper.getScaledStationImage(context, station.image, Keys.SIZE_COVER_LOCK_SCREEN))
|
||||
// //putString(MediaMetadataCompat.METADATA_KEY_ALBUM_ART_URI, station.image)
|
||||
// }.build()
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /* Creates MediaItem for a station - used by collection provider */
|
||||
// fun buildStationMediaMetaItem(context: Context, station: Station): MediaBrowserCompat.MediaItem {
|
||||
// val mediaDescriptionBuilder = MediaDescriptionCompat.Builder()
|
||||
// mediaDescriptionBuilder.setMediaId(station.uuid)
|
||||
// mediaDescriptionBuilder.setTitle(station.name)
|
||||
// mediaDescriptionBuilder.setIconBitmap(ImageHelper.getScaledStationImage(context, station.image, Keys.SIZE_COVER_LOCK_SCREEN))
|
||||
// // mediaDescriptionBuilder.setIconUri(station.image.toUri())
|
||||
// return MediaBrowserCompat.MediaItem(mediaDescriptionBuilder.build(), MediaBrowserCompat.MediaItem.FLAG_PLAYABLE)
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /* Creates description for a station - used in MediaSessionConnector */
|
||||
// fun buildStationMediaDescription(context: Context, station: Station, metadata: String): MediaDescriptionCompat {
|
||||
// val coverBitmap: Bitmap = ImageHelper.getScaledStationImage(context, station.image, Keys.SIZE_COVER_LOCK_SCREEN)
|
||||
// val extras: Bundle = Bundle()
|
||||
// extras.putParcelable(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, coverBitmap)
|
||||
// extras.putParcelable(MediaMetadataCompat.METADATA_KEY_DISPLAY_ICON, coverBitmap)
|
||||
// return MediaDescriptionCompat.Builder().apply {
|
||||
// setMediaId(station.uuid)
|
||||
// setIconBitmap(coverBitmap)
|
||||
// setIconUri(station.image.toUri())
|
||||
// setTitle(metadata)
|
||||
// setSubtitle(station.name)
|
||||
// setExtras(extras)
|
||||
// }.build()
|
||||
// }
|
||||
|
||||
|
||||
/* Creates a MediaItem with MediaMetadata for a single radio station - used to prepare player */
|
||||
fun buildMediaItem(context: Context, station: Station): MediaItem {
|
||||
// todo implement HLS MediaItems
|
||||
// put uri in RequestMetadata - credit: https://stackoverflow.com/a/70103460
|
||||
val requestMetadata = MediaItem.RequestMetadata.Builder().apply {
|
||||
setMediaUri(station.getStreamUri().toUri())
|
||||
@@ -739,7 +670,7 @@ object CollectionHelper {
|
||||
setMediaId(station.uuid)
|
||||
setRequestMetadata(requestMetadata)
|
||||
setMediaMetadata(mediaMetadata)
|
||||
//setMimeType(station.getMediaType())
|
||||
setMimeType(station.getMediaType())
|
||||
setUri(station.getStreamUri().toUri())
|
||||
}.build()
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ object FileHelper {
|
||||
File(activity.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_M3U_FILE)
|
||||
if (!m3uFile.exists()) {
|
||||
m3uFile = File(
|
||||
activity.getExternalFilesDir(Keys.URLRADIO_LEGACY_FOLDER_COLLECTION),
|
||||
activity.getExternalFilesDir(Keys.RADIO_LEGACY_FOLDER_COLLECTION),
|
||||
Keys.COLLECTION_M3U_FILE
|
||||
)
|
||||
}
|
||||
@@ -270,7 +270,7 @@ object FileHelper {
|
||||
File(activity.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_PLS_FILE)
|
||||
if (!plsFile.exists()) {
|
||||
plsFile = File(
|
||||
activity.getExternalFilesDir(Keys.URLRADIO_LEGACY_FOLDER_COLLECTION),
|
||||
activity.getExternalFilesDir(Keys.RADIO_LEGACY_FOLDER_COLLECTION),
|
||||
Keys.COLLECTION_PLS_FILE
|
||||
)
|
||||
}
|
||||
@@ -417,16 +417,14 @@ object FileHelper {
|
||||
|
||||
/* Reads InputStream from file uri and returns it as String */
|
||||
private fun readTextFileFromFile(context: Context): String {
|
||||
// todo read https://commonsware.com/blog/2016/03/15/how-consume-content-uri.html
|
||||
// https://developer.android.com/training/secure-file-sharing/retrieve-info
|
||||
|
||||
// check if file exists
|
||||
val file = File(context.getExternalFilesDir(Keys.FOLDER_COLLECTION), Keys.COLLECTION_FILE)
|
||||
if (!file.exists() || !file.canRead()) {
|
||||
return String()
|
||||
}
|
||||
// read until last line reached
|
||||
val stream: InputStream = file.inputStream()
|
||||
val uri = Uri.fromFile(file)
|
||||
val stream: InputStream = context.contentResolver.openInputStream(uri) ?: return String()
|
||||
val reader = BufferedReader(InputStreamReader(stream))
|
||||
val builder: StringBuilder = StringBuilder()
|
||||
reader.forEachLine {
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.michatec.radio.R
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import androidx.core.graphics.createBitmap
|
||||
|
||||
|
||||
/*
|
||||
@@ -98,7 +99,7 @@ object ImageHelper {
|
||||
}
|
||||
|
||||
// create empty bitmap and canvas
|
||||
val outputImage: Bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888)
|
||||
val outputImage: Bitmap = createBitmap(size, size, Bitmap.Config.ARGB_8888)
|
||||
val imageCanvas = Canvas(outputImage)
|
||||
|
||||
// draw square background
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* ImportHelper.kt
|
||||
* Implements the ImportHelper object
|
||||
* A ImportHelper provides methods for integrating station files from Radio v3
|
||||
*
|
||||
* This file is part of
|
||||
* TRANSISTOR - Radio App for Android
|
||||
*
|
||||
* Copyright (c) 2015-22 - Y20K.org
|
||||
* Licensed under the MIT-License
|
||||
* http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
|
||||
package com.michatec.radio.helpers
|
||||
|
||||
import android.content.Context
|
||||
import com.michatec.radio.Keys
|
||||
import com.michatec.radio.core.Collection
|
||||
|
||||
|
||||
/*
|
||||
* ImportHelper object
|
||||
*/
|
||||
object ImportHelper {
|
||||
|
||||
|
||||
/* */
|
||||
fun removeDefaultStationImageUris(context: Context) {
|
||||
val collection: Collection = FileHelper.readCollection(context)
|
||||
collection.stations.forEach { station ->
|
||||
if (station.image == Keys.LOCATION_DEFAULT_STATION_IMAGE) {
|
||||
station.image = String()
|
||||
}
|
||||
if (station.smallImage == Keys.LOCATION_DEFAULT_STATION_IMAGE) {
|
||||
station.smallImage = String()
|
||||
}
|
||||
}
|
||||
CollectionHelper.saveCollection(context, collection, async = false)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,7 +120,7 @@ object NetworkHelper {
|
||||
InetAddress.getAllByName(Keys.RADIO_BROWSER_API_BASE)
|
||||
// select a random address
|
||||
serverAddressList[Random().nextInt(serverAddressList.size)].canonicalHostName
|
||||
} catch (e: UnknownHostException) {
|
||||
} catch (_: UnknownHostException) {
|
||||
Keys.RADIO_BROWSER_API_DEFAULT
|
||||
}
|
||||
PreferencesHelper.saveRadioBrowserApiAddress(serverAddress)
|
||||
|
||||
@@ -213,20 +213,6 @@ object PreferencesHelper {
|
||||
}
|
||||
|
||||
|
||||
/* Checks if housekeeping work needs to be done - used usually in DownloadWorker "REQUEST_UPDATE_COLLECTION" */
|
||||
fun isHouseKeepingNecessary(): Boolean {
|
||||
return sharedPreferences.getBoolean(Keys.PREF_ONE_TIME_HOUSEKEEPING_NECESSARY, true)
|
||||
}
|
||||
|
||||
|
||||
/* Saves state of housekeeping */
|
||||
fun saveHouseKeepingNecessaryState(state: Boolean = false) {
|
||||
sharedPreferences.edit {
|
||||
putBoolean(Keys.PREF_ONE_TIME_HOUSEKEEPING_NECESSARY, state)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Load currently selected app theme */
|
||||
fun loadThemeSelection(): String {
|
||||
return sharedPreferences.getString(
|
||||
@@ -241,15 +227,6 @@ object PreferencesHelper {
|
||||
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STATIONS, true)
|
||||
}
|
||||
|
||||
|
||||
/* Saves value of the option: Edit Stations (only needed for migration) */
|
||||
fun saveEditStationsEnabled(enabled: Boolean = false) {
|
||||
sharedPreferences.edit {
|
||||
putBoolean(Keys.PREF_EDIT_STATIONS, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Loads value of the option: Edit Station Streams */
|
||||
fun loadEditStreamUrisEnabled(): Boolean {
|
||||
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STREAMS_URIS, true)
|
||||
@@ -276,7 +253,7 @@ object PreferencesHelper {
|
||||
fun downloadOverMobile(): Boolean {
|
||||
return sharedPreferences.getBoolean(
|
||||
Keys.PREF_DOWNLOAD_OVER_MOBILE,
|
||||
Keys.DEFAULT_DOWNLOAD_OVER_MOBILE
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ package com.michatec.radio.helpers
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.os.Build
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.pm.ShortcutInfoCompat
|
||||
import androidx.core.content.pm.ShortcutManagerCompat
|
||||
@@ -73,27 +72,15 @@ object ShortcutHelper {
|
||||
): IconCompat {
|
||||
val stationImageBitmap: Bitmap =
|
||||
ImageHelper.getScaledStationImage(context, stationImage.toUri(), 192)
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
IconCompat.createWithAdaptiveBitmap(
|
||||
ImageHelper.createSquareImage(
|
||||
context,
|
||||
stationImageBitmap,
|
||||
stationImageColor,
|
||||
192,
|
||||
true
|
||||
)
|
||||
)
|
||||
} else {
|
||||
IconCompat.createWithAdaptiveBitmap(
|
||||
ImageHelper.createSquareImage(
|
||||
context,
|
||||
stationImageBitmap,
|
||||
stationImageColor,
|
||||
192,
|
||||
false
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return IconCompat.createWithAdaptiveBitmap(
|
||||
ImageHelper.createSquareImage(
|
||||
context,
|
||||
stationImageBitmap,
|
||||
stationImageColor,
|
||||
192,
|
||||
true
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
/*
|
||||
* UiHelper.kt
|
||||
* Implements the UiHelper object
|
||||
* A UiHelper provides helper methods for User Interface related tasks
|
||||
*
|
||||
* This file is part of
|
||||
* TRANSISTOR - Radio App for Android
|
||||
*
|
||||
* Copyright (c) 2015-22 - Y20K.org
|
||||
* Licensed under the MIT-License
|
||||
* http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
|
||||
package com.michatec.radio.helpers
|
||||
|
||||
import android.content.Context
|
||||
|
||||
@@ -129,7 +129,7 @@ class RadioBrowserSearch(private var radioBrowserSearchListener: RadioBrowserSea
|
||||
|
||||
|
||||
/* Listens for (positive) server responses to search requests */
|
||||
private val responseListener: Response.Listener<JSONArray> = Response.Listener<JSONArray> { response ->
|
||||
private val responseListener: Response.Listener<JSONArray> = Response.Listener { response ->
|
||||
if (response != null) {
|
||||
radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString()))
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import android.content.Context
|
||||
import android.media.AudioAttributes
|
||||
import android.media.AudioFocusRequest
|
||||
import android.media.AudioManager
|
||||
import android.os.Build
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -106,7 +105,7 @@ class SearchResultAdapter(
|
||||
}
|
||||
|
||||
// mark selected if necessary
|
||||
val isSelected = selectedPosition == holder.adapterPosition
|
||||
val isSelected = selectedPosition == holder.bindingAdapterPosition
|
||||
searchResultViewHolder.searchResultLayout.isSelected = isSelected
|
||||
|
||||
// toggle text scrolling (marquee) if necessary
|
||||
@@ -121,7 +120,7 @@ class SearchResultAdapter(
|
||||
searchResultViewHolder.searchResultLayout.setOnClickListener {
|
||||
// move marked position
|
||||
val previousSelectedPosition = selectedPosition
|
||||
selectedPosition = holder.adapterPosition
|
||||
selectedPosition = holder.bindingAdapterPosition
|
||||
notifyItemChanged(previousSelectedPosition)
|
||||
notifyItemChanged(selectedPosition)
|
||||
|
||||
@@ -133,7 +132,7 @@ class SearchResultAdapter(
|
||||
resetSelection(false)
|
||||
} else {
|
||||
// get the selected station from searchResults
|
||||
val selectedStation = searchResults[holder.adapterPosition]
|
||||
val selectedStation = searchResults[holder.bindingAdapterPosition]
|
||||
// perform pre-playback here
|
||||
performPrePlayback(searchResultViewHolder.searchResultLayout.context, selectedStation.getStreamUri())
|
||||
// hand over station
|
||||
@@ -209,22 +208,16 @@ class SearchResultAdapter(
|
||||
// stop radio playback when one is active
|
||||
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val audioAttributes = AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
||||
.build()
|
||||
val audioAttributes = AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
||||
.build()
|
||||
|
||||
val focusRequest = AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN_TRANSIENT)
|
||||
.setAudioAttributes(audioAttributes)
|
||||
.build()
|
||||
val focusRequest = AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN_TRANSIENT)
|
||||
.setAudioAttributes(audioAttributes)
|
||||
.build()
|
||||
|
||||
audioManager.requestAudioFocus(focusRequest)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
// For older versions where AudioFocusRequest is not available
|
||||
audioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT)
|
||||
}
|
||||
audioManager.requestAudioFocus(focusRequest)
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +239,7 @@ class SearchResultAdapter(
|
||||
/*
|
||||
* Inner class: ViewHolder for a radio station search result
|
||||
*/
|
||||
private inner class SearchResultViewHolder(var searchResultLayout: View) :
|
||||
private class SearchResultViewHolder(var searchResultLayout: View) :
|
||||
RecyclerView.ViewHolder(searchResultLayout) {
|
||||
val nameView: MaterialTextView = searchResultLayout.findViewById(R.id.station_name)
|
||||
val streamView: MaterialTextView = searchResultLayout.findViewById(R.id.station_url)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
package com.michatec.radio.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
@@ -131,6 +132,7 @@ data class LayoutHolder(var rootView: View) {
|
||||
|
||||
|
||||
/* Updates the player views */
|
||||
@SuppressLint("DefaultLocale")
|
||||
fun updatePlayerViews(context: Context, station: Station, isPlaying: Boolean) {
|
||||
|
||||
// set default metadata views, when playback has stopped
|
||||
@@ -164,12 +166,20 @@ data class LayoutHolder(var rootView: View) {
|
||||
// show only the codec when the bitrate is at "0" from radio-browser.info API
|
||||
station.codec
|
||||
} else {
|
||||
val kiloBytesPerSecond = station.bitrate / 8F
|
||||
val dataRateString = if (kiloBytesPerSecond >= 1000) {
|
||||
String.format("%.2f mb/s", kiloBytesPerSecond / 1000F)
|
||||
} else {
|
||||
String.format("%.0f kb/s", kiloBytesPerSecond)
|
||||
}
|
||||
// show the bitrate and codec if the result is available in the radio-browser.info API
|
||||
buildString {
|
||||
append(station.codec)
|
||||
append(" | ")
|
||||
append(station.bitrate)
|
||||
append("kbps")
|
||||
append(" | ")
|
||||
append(dataRateString)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -303,18 +313,6 @@ data class LayoutHolder(var rootView: View) {
|
||||
isBuffering = buffering
|
||||
}
|
||||
|
||||
|
||||
/* Toggles visibility of player depending on playback state - hiding it when playback is stopped (not paused or playing) */
|
||||
// fun togglePlayerVisibility(context: Context, playbackState: Int): Boolean {
|
||||
// when (playbackState) {
|
||||
// PlaybackStateCompat.STATE_STOPPED -> return hidePlayer(context)
|
||||
// PlaybackStateCompat.STATE_NONE -> return hidePlayer(context)
|
||||
// PlaybackStateCompat.STATE_ERROR -> return hidePlayer(context)
|
||||
// else -> return showPlayer(context)
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/* Toggles visibility of the download progress indicator */
|
||||
fun toggleDownloadProgressIndicator() {
|
||||
when (PreferencesHelper.loadActiveDownloads()) {
|
||||
@@ -359,7 +357,7 @@ data class LayoutHolder(var rootView: View) {
|
||||
/* Shows player */
|
||||
fun showPlayer(context: Context): Boolean {
|
||||
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
|
||||
}
|
||||
return true
|
||||
@@ -440,7 +438,7 @@ data class LayoutHolder(var rootView: View) {
|
||||
/*
|
||||
* Inner class: Custom LinearLayoutManager
|
||||
*/
|
||||
private inner class CustomLayoutManager(context: Context) :
|
||||
private class CustomLayoutManager(context: Context) :
|
||||
LinearLayoutManager(context, VERTICAL, false) {
|
||||
override fun supportsPredictiveItemAnimations(): Boolean {
|
||||
return true
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/icon_default"
|
||||
android:pathData="m11.999,2.623c-5.54,0 -9.999,4.462 -9.999,10.001 -0,1.878 0.529,3.721 1.528,5.313l8.336,-10.778c0.06,-0.077 0.209,-0.077 0.27,0l3.482,4.502h-2.494l0.054,0.199h2.594l0.736,0.949h-3.062l0.086,0.311h3.217l0.647,0.836h-3.631l0.113,0.402h3.827l0.579,0.745h-4.198l0.137,0.49h4.438l0.508,0.655h-4.764l0.152,0.542h5.031l0.468,0.606h-5.33l0.152,0.542h5.598c0.998,-1.592 1.528,-3.435 1.528,-5.313 0,-5.54 -4.462,-10.001 -10.001,-10.001zM15.044,18.543 L15.196,19.085h4.438c0.145,-0.171 0.294,-0.361 0.428,-0.542zM15.365,19.69 L15.515,20.232h2.969c0.194,-0.166 0.405,-0.357 0.594,-0.542zM15.684,20.838 L15.836,21.377h1.003c0.296,-0.17 0.571,-0.343 0.868,-0.539z" />
|
||||
</vector>
|
||||
17
app/src/main/res/drawable/ic_refresh_24dp.xml
Normal file
17
app/src/main/res/drawable/ic_refresh_24dp.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/icon_default"
|
||||
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4
|
||||
7.58,4 4,7.58 4,12h2
|
||||
c0,-3.31 2.69,-6 6,-6
|
||||
1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z
|
||||
M6.35,17.65C7.8,19.1 9.79,20 12,20
|
||||
c4.42,0 8,-3.58 8,-8h-2
|
||||
c0,3.31 -2.69,6 -6,6
|
||||
-1.66,0 -3.14,-0.69 -4.22,-1.78L11,13H4v7l2.35,-2.35z"/>
|
||||
</vector>
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
|
||||
@@ -31,6 +31,21 @@
|
||||
app:shapeAppearanceOverlay="@style/RoundedCorners"
|
||||
app:srcCompat="@drawable/ic_default_station_image_72dp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/download_progress"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:progressTint="@color/player_button_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/station_icon"
|
||||
app:layout_constraintStart_toStartOf="@+id/station_icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/station_icon"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/change_image_view"
|
||||
android:layout_width="0dp"
|
||||
@@ -155,6 +170,21 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/save_button"
|
||||
app:layout_constraintTop_toTopOf="@+id/save_button" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/buffering_progress"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:progressTint="@color/player_button_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/default_edit_views"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
<string name="player_sheet_h2_station_metadata">Momentan läuft</string>
|
||||
<string name="player_sheet_h2_stream_url">Streaming-Adresse</string>
|
||||
<!-- Settings -->
|
||||
<string name="pref_update_collection_title">Senderinformationnen aktualisieren</string>
|
||||
<string name="pref_update_collection_summary">Die neueste Version aller Senderinformationen herunterladen.</string>
|
||||
<string name="dialog_yes_no_message_update_collection">Die neueste Version aller Senderinformationen herunterladen?</string>
|
||||
<string name="dialog_yes_no_positive_button_update_collection">Aktualisieren</string>
|
||||
<string name="pref_advanced_title">Erweitert</string>
|
||||
<string name="pref_app_version_summary">Version</string>
|
||||
<string name="pref_app_version_title">App-Version</string>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<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_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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- App Name -->
|
||||
<string name="app_version_name" translatable="false">\"Purple\"</string>
|
||||
<string name="app_version_name" translatable="false">\"Red\"</string>
|
||||
|
||||
<!-- Accessibility Descriptions -->
|
||||
<string name="descr_app_icon">App icon depicting an old radio</string>
|
||||
@@ -59,6 +59,10 @@
|
||||
<string name="player_sheet_h2_stream_url">Streaming link</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="pref_update_collection_title">Update Stations</string>
|
||||
<string name="pref_update_collection_summary">Download latest version of all station.</string>
|
||||
<string name="dialog_yes_no_message_update_collection">Download latest version of all station?</string>
|
||||
<string name="dialog_yes_no_positive_button_update_collection">Update</string>
|
||||
<string name="pref_advanced_title">Advanced</string>
|
||||
<string name="pref_app_version_summary">Version</string>
|
||||
<string name="pref_app_version_title">App Version</string>
|
||||
|
||||
@@ -17,4 +17,6 @@
|
||||
<locale android:name="tr" />
|
||||
<locale android:name="uk" />
|
||||
<locale android:name="zh-rCN" />
|
||||
<locale android:name="da" />
|
||||
<locale android:name="ja" />
|
||||
</locale-config>
|
||||
@@ -2,7 +2,7 @@
|
||||
<paths>
|
||||
<external-files-path
|
||||
name="my_images"
|
||||
path="Android/data/com.michatec.urlradio/files/Pictures" />
|
||||
path="Android/data/com.michatec.radio/files/Pictures" />
|
||||
<external-path
|
||||
name="external_files"
|
||||
path="." />
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
android:shortcutShortLabel="@string/shortcut_last_station_short_label">
|
||||
|
||||
<intent
|
||||
android:action="com.jamal2367.urlradio.action.START"
|
||||
android:action="com.michatec.radio.action.START"
|
||||
android:targetClass="com.michatec.radio.MainActivity"
|
||||
android:targetPackage="com.michatec.radio">
|
||||
<extra
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.6.1' apply false
|
||||
id 'com.android.library' version '8.6.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version "2.1.0" apply false
|
||||
id 'com.android.application' version '9.1.0' apply false
|
||||
id 'com.android.library' version '9.1.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version "2.3.10" apply false
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
delete rootProject.buildDir()
|
||||
}
|
||||
@@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1536m
|
||||
|
||||
# enables androidx repo
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
org.gradle.configuration-cache=true
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
7
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
#Fri Jan 28 14:15:43 CET 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
310
gradlew
vendored
310
gradlew
vendored
@@ -1,78 +1,128 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
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.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
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."
|
||||
fi
|
||||
else
|
||||
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.
|
||||
JAVACMD=java
|
||||
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
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --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
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
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
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# 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" "$@"
|
||||
|
||||
79
gradlew.bat
vendored
79
gradlew.bat
vendored
@@ -1,4 +1,22 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@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
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -9,25 +27,29 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
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.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -35,48 +57,35 @@ goto fail
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
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
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@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
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
7
renovate.json
Normal file
7
renovate.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user