diff --git a/app/src/main/java/org/oxycblt/auxio/coil/CoilUtils.kt b/app/src/main/java/org/oxycblt/auxio/coil/CoilUtils.kt index 99c9caf43..7a8060a18 100644 --- a/app/src/main/java/org/oxycblt/auxio/coil/CoilUtils.kt +++ b/app/src/main/java/org/oxycblt/auxio/coil/CoilUtils.kt @@ -20,26 +20,26 @@ import org.oxycblt.auxio.music.Genre import org.oxycblt.auxio.music.Song import org.oxycblt.auxio.settings.SettingsManager -// TODO: Stop disk caching - // SettingsManager is lazy-initted to prevent it from being used before its initialized. val settingsManager: SettingsManager by lazy { SettingsManager.getInstance() } /** - * Create the custom [ImageLoader] used by Auxio, which doesn't cache album art to the disk by default. + * Create the custom [ImageLoader] used by Auxio, which automates some convienence things. */ fun createImageLoader(context: Context): ImageLoader { Log.d("createImageLoader", "Creating image loader.") val builder = ImageLoader.Builder(context) .crossfade(true) + .placeholder(android.R.color.transparent) // To save memory/improve speed, allow disc caching when if quality covers are enabled. if (settingsManager.useQualityCovers) { builder.diskCachePolicy(CachePolicy.ENABLED) } else { + // Otherwise disable it since the covers are already cached, really. builder.diskCachePolicy(CachePolicy.DISABLED) } @@ -51,7 +51,7 @@ fun createImageLoader(context: Context): ImageLoader { * **Do not use this on the UI elements, instead use the Binding Adapters.** * @param context [Context] required * @param song Song to load the cover for - * @param onDone What to do with the bitmap when the loading is finished. Bitmap will be null if loading failed/shouldnt occur. + * @param onDone What to do with the bitmap when the loading is finished. Bitmap will be null if loading failed/shouldn't occur. */ fun getBitmap(context: Context, song: Song, onDone: (Bitmap?) -> Unit) { if (!settingsManager.showCovers) { @@ -223,7 +223,5 @@ fun ImageRequest.Builder.doCoverSetup(context: Context, data: BaseModel): ImageR */ private fun ImageView.getDefaultRequest(): ImageRequest.Builder { return ImageRequest.Builder(context) - .crossfade(true) - .placeholder(android.R.color.transparent) .target(this) } diff --git a/app/src/main/java/org/oxycblt/auxio/coil/MosaicFetcher.kt b/app/src/main/java/org/oxycblt/auxio/coil/MosaicFetcher.kt index 5a415b08d..f59b5a194 100644 --- a/app/src/main/java/org/oxycblt/auxio/coil/MosaicFetcher.kt +++ b/app/src/main/java/org/oxycblt/auxio/coil/MosaicFetcher.kt @@ -30,7 +30,8 @@ class MosaicFetcher(private val context: Context) : Fetcher> { ): FetchResult { val streams = mutableListOf() - // Load the streams. + // Load the streams, the lower-quality MediaStore covers are used simply because using + // the raw ones would make loading far too long. Its not that noticable either. data.forEach { val stream: InputStream? = context.contentResolver.openInputStream(it) diff --git a/app/src/main/java/org/oxycblt/auxio/coil/QualityCoverFetcher.kt b/app/src/main/java/org/oxycblt/auxio/coil/QualityCoverFetcher.kt index d79fd7c39..10a288257 100644 --- a/app/src/main/java/org/oxycblt/auxio/coil/QualityCoverFetcher.kt +++ b/app/src/main/java/org/oxycblt/auxio/coil/QualityCoverFetcher.kt @@ -52,5 +52,6 @@ class QualityCoverFetcher(private val context: Context) : Fetcher { ) } + // Group bitmaps by their album so that caching is more efficent override fun key(data: Song): String = data.album.id.toString() } diff --git a/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt b/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt index deb5ee6b3..d1ba9866a 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/state/PlaybackStateManager.kt @@ -317,8 +317,8 @@ class PlaybackStateManager private constructor() { * Go to the previous song, doing any checks that are needed. */ fun prev() { - // If enabled, rewind before skipping back if the position is past the threshold set. - if (settingsManager.rewindWithPrev && mPosition >= settingsManager.rewindThreshold) { + // If enabled, rewind before skipping back if the position is past 3 seconds [3000ms] + if (settingsManager.rewindWithPrev && mPosition >= 3000) { seekTo(0) } else { // Only decrement the index if there's a song to move back to AND if we are not exiting diff --git a/app/src/main/java/org/oxycblt/auxio/settings/SettingsManager.kt b/app/src/main/java/org/oxycblt/auxio/settings/SettingsManager.kt index ecb49b0ca..086b517a6 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/SettingsManager.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/SettingsManager.kt @@ -128,12 +128,6 @@ class SettingsManager private constructor(context: Context) : val rewindWithPrev: Boolean get() = sharedPrefs.getBoolean(Keys.KEY_PREV_REWIND, true) - /** - * The threshold at which to rewind when the back button is pressed. - */ - val rewindThreshold: Long - get() = (sharedPrefs.getInt(Keys.KEY_REWIND_THRESHOLD, 5) * 1000).toLong() - /** * The current [SortMode] of the library. */ @@ -236,7 +230,6 @@ class SettingsManager private constructor(context: Context) : const val KEY_AT_END = "KEY_AT_END" const val KEY_KEEP_SHUFFLE = "KEY_KEEP_SHUFFLE" const val KEY_PREV_REWIND = "KEY_PREV_REWIND" - const val KEY_REWIND_THRESHOLD = "KEY_REWIND_THRESHOLD" const val KEY_LIBRARY_SORT_MODE = "KEY_LIBRARY_SORT_MODE" const val KEY_DEBUG_SAVE = "KEY_SAVE_STATE" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4a73c0ce3..87722a730 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -94,8 +94,6 @@ Rewind before skipping back Rewind before skipping to the previous song - Rewind threshold - Progress at which a rewind should occur (seconds) Debug diff --git a/app/src/main/res/xml/prefs_main.xml b/app/src/main/res/xml/prefs_main.xml index 19f0c40e5..fbdc36fe6 100644 --- a/app/src/main/res/xml/prefs_main.xml +++ b/app/src/main/res/xml/prefs_main.xml @@ -123,19 +123,8 @@ app:defaultValue="true" app:iconSpaceReserved="false" app:key="KEY_PREV_REWIND" - app:summary="@string/setting_behavior_rewind_prev_desc" /> - - + app:summary="@string/setting_behavior_rewind_prev_desc" /> diff --git a/info/FAQ.md b/info/FAQ.md index a1a0b7124..7721acf8b 100644 --- a/info/FAQ.md +++ b/info/FAQ.md @@ -6,7 +6,7 @@ This FAQ will be continually updated as new changes and updates are made to Auxi ## What is Auxio? -Auxio is a reliable and customizable local music player that I built for myself, primarily. +Auxio is local music player for android that I built for myself, primarily. Its meant to be simplistic and straightfoward, however still customizable to ones wants. ## Where can I download Auxio? @@ -38,7 +38,7 @@ You will be able to set the accent to something less saturated when I implement The APIs for changing system bar colors were only added in API Level 27 (Oreo MR1), meaning that edge-to-edge will not work below that version. -I could possibly extend edge-to-edge support to those versions, but it would take awhile. +I could possibly extend edge-to-edge support to earlier versions, but it would take awhile. ## Why doesnt edge-to-edge work when my phone is in landscape?