Fix theme bug
Fix an issue where setting the theme from AuxioApp will make the theme default to Theme.Base for...some reason...
This commit is contained in:
parent
fc33e01b89
commit
1e102e9d5d
4 changed files with 6 additions and 4 deletions
|
@ -1,7 +1,6 @@
|
||||||
package org.oxycblt.auxio
|
package org.oxycblt.auxio
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
|
||||||
import coil.ImageLoader
|
import coil.ImageLoader
|
||||||
import coil.ImageLoaderFactory
|
import coil.ImageLoaderFactory
|
||||||
import coil.request.CachePolicy
|
import coil.request.CachePolicy
|
||||||
|
@ -14,9 +13,7 @@ class AuxioApp : Application(), ImageLoaderFactory {
|
||||||
|
|
||||||
// Init SettingsManager here so that there aren't any race conditions
|
// Init SettingsManager here so that there aren't any race conditions
|
||||||
// [e.g Service gets SettingsManager before activity can init SettingsManager]
|
// [e.g Service gets SettingsManager before activity can init SettingsManager]
|
||||||
val settingsManager = SettingsManager.init(applicationContext)
|
SettingsManager.init(applicationContext)
|
||||||
|
|
||||||
AppCompatDelegate.setDefaultNightMode(settingsManager.theme)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun newImageLoader(): ImageLoader {
|
override fun newImageLoader(): ImageLoader {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.WindowInsets
|
import android.view.WindowInsets
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import org.oxycblt.auxio.databinding.ActivityMainBinding
|
import org.oxycblt.auxio.databinding.ActivityMainBinding
|
||||||
import org.oxycblt.auxio.playback.PlaybackService
|
import org.oxycblt.auxio.playback.PlaybackService
|
||||||
|
@ -27,6 +28,8 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
val settingsManager = SettingsManager.getInstance()
|
val settingsManager = SettingsManager.getInstance()
|
||||||
|
|
||||||
|
AppCompatDelegate.setDefaultNightMode(settingsManager.theme)
|
||||||
|
|
||||||
accent = settingsManager.accent
|
accent = settingsManager.accent
|
||||||
|
|
||||||
// Apply the theme
|
// Apply the theme
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.oxycblt.auxio.music.processing.MusicLoader
|
||||||
/**
|
/**
|
||||||
* An intermediary [Fragment] that asks for the READ_EXTERNAL_STORAGE permission and runs
|
* An intermediary [Fragment] that asks for the READ_EXTERNAL_STORAGE permission and runs
|
||||||
* the music loading process in the background.
|
* the music loading process in the background.
|
||||||
|
* FIXME: Leak that occurs when skipping load
|
||||||
* @author OxygenCobalt
|
* @author OxygenCobalt
|
||||||
*/
|
*/
|
||||||
class LoadingFragment : Fragment(R.layout.fragment_loading) {
|
class LoadingFragment : Fragment(R.layout.fragment_loading) {
|
||||||
|
|
|
@ -133,6 +133,7 @@ class PlaybackService : Service(), Player.EventListener, PlaybackStateManager.Ca
|
||||||
|
|
||||||
// Set up callback for system events
|
// Set up callback for system events
|
||||||
systemReceiver = SystemEventReceiver()
|
systemReceiver = SystemEventReceiver()
|
||||||
|
|
||||||
IntentFilter().apply {
|
IntentFilter().apply {
|
||||||
addAction(NotificationUtils.ACTION_LOOP)
|
addAction(NotificationUtils.ACTION_LOOP)
|
||||||
addAction(NotificationUtils.ACTION_SHUFFLE)
|
addAction(NotificationUtils.ACTION_SHUFFLE)
|
||||||
|
|
Loading…
Reference in a new issue