diff --git a/app/src/main/java/com/michatec/radio/dialogs/ThemeSelectionDialog.kt b/app/src/main/java/com/michatec/radio/dialogs/ThemeSelectionDialog.kt index 3605508..4013019 100644 --- a/app/src/main/java/com/michatec/radio/dialogs/ThemeSelectionDialog.kt +++ b/app/src/main/java/com/michatec/radio/dialogs/ThemeSelectionDialog.kt @@ -27,28 +27,6 @@ class ThemeSelectionDialog(private var themeSelectionDialogListener: ThemeSelect private lateinit var dialog: AlertDialog - /* Update radio buttons to reflect current theme */ - private fun updateRadioButtons( - context: Context, - radioFollowSystem: RadioButton, - radioLight: RadioButton, - radioDark: RadioButton - ) { - val currentTheme = AppThemeHelper.getCurrentTheme(context) - when (currentTheme) { - context.getString(R.string.pref_theme_selection_mode_device_default) -> { - radioFollowSystem.isChecked = true - } - context.getString(R.string.pref_theme_selection_mode_light) -> { - radioLight.isChecked = true - } - context.getString(R.string.pref_theme_selection_mode_dark) -> { - radioDark.isChecked = true - } - } - } - - /* Construct and show dialog */ fun show(context: Context) { // prepare dialog builder diff --git a/app/src/main/java/com/michatec/radio/helpers/BackupHelper.kt b/app/src/main/java/com/michatec/radio/helpers/BackupHelper.kt index c539b0a..252e12d 100644 --- a/app/src/main/java/com/michatec/radio/helpers/BackupHelper.kt +++ b/app/src/main/java/com/michatec/radio/helpers/BackupHelper.kt @@ -53,7 +53,7 @@ object BackupHelper { Snackbar.make(view, R.string.toastmessage_restored, Snackbar.LENGTH_LONG).show() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { - // bypass "ZipException" for Android 14 or above applications when zip file names contain ".." or start with "/" + // bypass "ZipException" for Android 14 or above applications when zip file names contain "." or start with "/" dalvik.system.ZipPathValidator.clearCallback() } diff --git a/app/src/main/java/com/michatec/radio/helpers/CollectionHelper.kt b/app/src/main/java/com/michatec/radio/helpers/CollectionHelper.kt index 9fcf048..3a22317 100644 --- a/app/src/main/java/com/michatec/radio/helpers/CollectionHelper.kt +++ b/app/src/main/java/com/michatec/radio/helpers/CollectionHelper.kt @@ -299,7 +299,7 @@ object CollectionHelper { } - /* Returns the children stations under under root (simple media library structure: root > stations) */ + /* Returns the children stations under root (simple media library structure: root > stations) */ fun getChildren(context: Context, collection: Collection): List { val mediaItems: MutableList = mutableListOf() collection.stations.forEach { station -> diff --git a/app/src/main/java/com/michatec/radio/helpers/DateTimeHelper.kt b/app/src/main/java/com/michatec/radio/helpers/DateTimeHelper.kt index a6cebb9..34297b6 100644 --- a/app/src/main/java/com/michatec/radio/helpers/DateTimeHelper.kt +++ b/app/src/main/java/com/michatec/radio/helpers/DateTimeHelper.kt @@ -17,14 +17,14 @@ object DateTimeHelper { /* Main class variables */ - private const val pattern: String = "EEE, dd MMM yyyy HH:mm:ss Z" - private val dateFormat: SimpleDateFormat = SimpleDateFormat(pattern, Locale.ENGLISH) + private const val PATTERN: String = "EEE, dd MMM yyyy HH:mm:ss Z" + private val dateFormat: SimpleDateFormat = SimpleDateFormat(PATTERN, Locale.ENGLISH) /* Converts RFC 2822 string representation of a date to DATE */ fun convertFromRfc2822(dateString: String): Date { val date: Date = try { - // parse date string using standard pattern + // parse date string using standard PATTERN dateFormat.parse((dateString)) ?: Keys.DEFAULT_DATE } catch (e: Exception) { Log.w(TAG, "Unable to parse. Trying an alternative Date format. $e") @@ -37,7 +37,7 @@ object DateTimeHelper { /* Converts a DATE to its RFC 2822 string representation */ fun convertToRfc2822(date: Date): String { - val dateFormat = SimpleDateFormat(pattern, Locale.ENGLISH) + val dateFormat = SimpleDateFormat(PATTERN, Locale.ENGLISH) return dateFormat.format(date) } diff --git a/app/src/main/java/com/michatec/radio/helpers/DownloadHelper.kt b/app/src/main/java/com/michatec/radio/helpers/DownloadHelper.kt index 7744864..39b42dc 100644 --- a/app/src/main/java/com/michatec/radio/helpers/DownloadHelper.kt +++ b/app/src/main/java/com/michatec/radio/helpers/DownloadHelper.kt @@ -370,7 +370,7 @@ object DownloadHelper { private fun determineAllowedNetworkTypes(type: Int, ignoreWifiRestriction: Boolean): Int { var allowedNetworkTypes: Int = (DownloadManager.Request.NETWORK_WIFI or DownloadManager.Request.NETWORK_MOBILE) - // restrict download of audio files to WiFi if necessary + // restrict download of audio files to Wi-Fi if necessary if (type == Keys.FILE_TYPE_AUDIO) { if (!ignoreWifiRestriction && !PreferencesHelper.downloadOverMobile()) { allowedNetworkTypes = DownloadManager.Request.NETWORK_WIFI diff --git a/app/src/main/java/com/michatec/radio/helpers/NetworkHelper.kt b/app/src/main/java/com/michatec/radio/helpers/NetworkHelper.kt index 72bde59..6f89225 100644 --- a/app/src/main/java/com/michatec/radio/helpers/NetworkHelper.kt +++ b/app/src/main/java/com/michatec/radio/helpers/NetworkHelper.kt @@ -115,7 +115,7 @@ object NetworkHelper { } - /* Creates a http connection from given url string */ + /* Creates an http connection from given url string */ private fun createConnection(urlString: String, redirectCount: Int = 0): HttpURLConnection? { var connection: HttpURLConnection? = null