mirror of
https://github.com/Michatec/Radio.git
synced 2026-04-01 07:56:27 +02:00
- Removed some old Systems
- Removed some old functions
This commit is contained in:
@@ -34,7 +34,6 @@ 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()
|
||||||
|
|||||||
@@ -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)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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 */
|
/* Load currently selected app theme */
|
||||||
fun loadThemeSelection(): String {
|
fun loadThemeSelection(): String {
|
||||||
return sharedPreferences.getString(
|
return sharedPreferences.getString(
|
||||||
@@ -241,15 +227,6 @@ 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)
|
||||||
@@ -276,7 +253,7 @@ object PreferencesHelper {
|
|||||||
fun downloadOverMobile(): Boolean {
|
fun downloadOverMobile(): Boolean {
|
||||||
return sharedPreferences.getBoolean(
|
return sharedPreferences.getBoolean(
|
||||||
Keys.PREF_DOWNLOAD_OVER_MOBILE,
|
Keys.PREF_DOWNLOAD_OVER_MOBILE,
|
||||||
Keys.DEFAULT_DOWNLOAD_OVER_MOBILE
|
false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class RadioBrowserSearch(private var radioBrowserSearchListener: RadioBrowserSea
|
|||||||
|
|
||||||
|
|
||||||
/* Listens for (positive) server responses to search requests */
|
/* Listens for (positive) server responses to search requests */
|
||||||
private val responseListener: Response.Listener<JSONArray> = Response.Listener<JSONArray> { response ->
|
private val responseListener: Response.Listener<JSONArray> = Response.Listener { response ->
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString()))
|
radioBrowserSearchListener.onRadioBrowserSearchResults(createRadioBrowserResult(response.toString()))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user