mirror of
https://github.com/Michatec/Radio.git
synced 2026-04-01 07:56:27 +02:00
Compare commits
34 Commits
c62c61f2f1
...
ae16b12d28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae16b12d28 | ||
|
|
0697ee0dca | ||
|
|
27e324decc | ||
|
|
618914617e | ||
|
|
e81aa10125 | ||
|
|
44d25f92a0 | ||
|
|
95bf0e5c56 | ||
|
|
dddd180136 | ||
|
|
46ddd4feca | ||
|
|
e10c8ed68f | ||
|
|
6563820a00 | ||
|
|
594801238a | ||
|
|
8a1e0ef6c2 | ||
|
|
053db2abaa | ||
|
|
7e5d5eb6c1 | ||
|
|
1e1efd422c | ||
|
|
2c1913896d | ||
|
|
026e18ae22 | ||
|
|
3b6ebe5e1b | ||
|
|
26eab4c64c | ||
|
|
75b3deb210 | ||
|
|
96389a5c81 | ||
|
|
1544c07938 | ||
|
|
65e9d1fed4 | ||
|
|
9bfc1661b8 | ||
|
|
9a379675bf | ||
|
|
529e359f7f | ||
|
|
fc3a1f767a | ||
|
|
9197e5c2a9 | ||
|
|
5920327283 | ||
|
|
769cbb505f | ||
|
|
1f5d61759c | ||
|
|
5b1d6d96c7 | ||
|
|
606154cfb3 |
@@ -13,7 +13,7 @@
|
|||||||
<details>
|
<details>
|
||||||
<summary>⚙️ Install Radio</summary>
|
<summary>⚙️ Install Radio</summary>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://github.com/michatec/Radio/releases/latest"><img src="https://user-images.githubusercontent.com/15986930/229208526-e5a63be5-0d0b-48ab-a222-9f2f2faf0ee4.png" alt="Preview" 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" height="80px"></a>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<!-- react to playlist-links based on file extension -->
|
<!-- react to playlist-links based on file extension -->
|
||||||
<intent-filter android:autoVerify="true">
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<!-- react to playlist-links based on mimetype -->
|
<!-- react to playlist-links based on mimetype -->
|
||||||
<intent-filter android:autoVerify="true">
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
@@ -81,8 +81,7 @@
|
|||||||
|
|
||||||
<data android:scheme="http" />
|
<data android:scheme="http" />
|
||||||
<data android:scheme="https" />
|
<data android:scheme="https" />
|
||||||
<data android:host="*"
|
<data android:host="*" />
|
||||||
tools:ignore="AppLinkUrlError" />
|
|
||||||
<data android:mimeType="audio/x-scpls" />
|
<data android:mimeType="audio/x-scpls" />
|
||||||
<data android:mimeType="audio/mpegurl" />
|
<data android:mimeType="audio/mpegurl" />
|
||||||
<data android:mimeType="audio/x-mpegurl" />
|
<data android:mimeType="audio/x-mpegurl" />
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class Radio : Application() {
|
|||||||
AppThemeHelper.setTheme(PreferencesHelper.loadThemeSelection())
|
AppThemeHelper.setTheme(PreferencesHelper.loadThemeSelection())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Implements onTerminate */
|
/* Implements onTerminate */
|
||||||
override fun onTerminate() {
|
override fun onTerminate() {
|
||||||
super.onTerminate()
|
super.onTerminate()
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import com.michatec.radio.R
|
|||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import androidx.core.graphics.createBitmap
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -99,7 +98,7 @@ object ImageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create empty bitmap and canvas
|
// create empty bitmap and canvas
|
||||||
val outputImage: Bitmap = createBitmap(size, size, Bitmap.Config.ARGB_8888)
|
val outputImage: Bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888)
|
||||||
val imageCanvas = Canvas(outputImage)
|
val imageCanvas = Canvas(outputImage)
|
||||||
|
|
||||||
// draw square background
|
// draw square background
|
||||||
|
|||||||
42
app/src/main/java/com/michatec/radio/helpers/ImportHelper.kt
Normal file
42
app/src/main/java/com/michatec/radio/helpers/ImportHelper.kt
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -213,6 +213,20 @@ object PreferencesHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Checks if housekeeping work needs to be done - used usually in DownloadWorker "REQUEST_UPDATE_COLLECTION" */
|
||||||
|
fun isHouseKeepingNecessary(): Boolean {
|
||||||
|
return sharedPreferences.getBoolean(Keys.PREF_ONE_TIME_HOUSEKEEPING_NECESSARY, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Saves state of housekeeping */
|
||||||
|
fun saveHouseKeepingNecessaryState(state: Boolean = false) {
|
||||||
|
sharedPreferences.edit {
|
||||||
|
putBoolean(Keys.PREF_ONE_TIME_HOUSEKEEPING_NECESSARY, state)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Load currently selected app theme */
|
/* Load currently selected app theme */
|
||||||
fun loadThemeSelection(): String {
|
fun loadThemeSelection(): String {
|
||||||
return sharedPreferences.getString(
|
return sharedPreferences.getString(
|
||||||
@@ -227,6 +241,15 @@ object PreferencesHelper {
|
|||||||
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STATIONS, true)
|
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 */
|
/* Loads value of the option: Edit Station Streams */
|
||||||
fun loadEditStreamUrisEnabled(): Boolean {
|
fun loadEditStreamUrisEnabled(): Boolean {
|
||||||
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STREAMS_URIS, true)
|
return sharedPreferences.getBoolean(Keys.PREF_EDIT_STREAMS_URIS, true)
|
||||||
@@ -253,7 +276,7 @@ object PreferencesHelper {
|
|||||||
fun downloadOverMobile(): Boolean {
|
fun downloadOverMobile(): Boolean {
|
||||||
return sharedPreferences.getBoolean(
|
return sharedPreferences.getBoolean(
|
||||||
Keys.PREF_DOWNLOAD_OVER_MOBILE,
|
Keys.PREF_DOWNLOAD_OVER_MOBILE,
|
||||||
false
|
Keys.DEFAULT_DOWNLOAD_OVER_MOBILE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class RadioBrowserSearch(private var radioBrowserSearchListener: RadioBrowserSea
|
|||||||
|
|
||||||
|
|
||||||
/* Listens for (positive) server responses to search requests */
|
/* Listens for (positive) server responses to search requests */
|
||||||
private val responseListener: Response.Listener<JSONArray> = Response.Listener { response ->
|
private val responseListener: Response.Listener<JSONArray> = Response.Listener<JSONArray> { response ->
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString()))
|
radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import android.content.Context
|
|||||||
import android.media.AudioAttributes
|
import android.media.AudioAttributes
|
||||||
import android.media.AudioFocusRequest
|
import android.media.AudioFocusRequest
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
|
import android.os.Build
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@@ -239,7 +240,7 @@ class SearchResultAdapter(
|
|||||||
/*
|
/*
|
||||||
* Inner class: ViewHolder for a radio station search result
|
* Inner class: ViewHolder for a radio station search result
|
||||||
*/
|
*/
|
||||||
private class SearchResultViewHolder(var searchResultLayout: View) :
|
private inner class SearchResultViewHolder(var searchResultLayout: View) :
|
||||||
RecyclerView.ViewHolder(searchResultLayout) {
|
RecyclerView.ViewHolder(searchResultLayout) {
|
||||||
val nameView: MaterialTextView = searchResultLayout.findViewById(R.id.station_name)
|
val nameView: MaterialTextView = searchResultLayout.findViewById(R.id.station_name)
|
||||||
val streamView: MaterialTextView = searchResultLayout.findViewById(R.id.station_url)
|
val streamView: MaterialTextView = searchResultLayout.findViewById(R.id.station_url)
|
||||||
|
|||||||
9
app/src/main/res/drawable/ic_codeberg_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_codeberg_24dp.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<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>
|
||||||
Reference in New Issue
Block a user