style: Use colorSurface everywhere
Instead of using @color/background directly, use ?attr/colorSurface so that changes can be made to the theming easier. This also resolves some more minor issues regarding certain widget's backgrounds.
This commit is contained in:
@@ -25,16 +25,16 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val binding = DataBindingUtil.setContentView<ActivityMainBinding>(
|
||||
this, R.layout.activity_main
|
||||
)
|
||||
|
||||
val settingsManager = SettingsManager.getInstance()
|
||||
val newAccent = Accent.set(settingsManager.accent)
|
||||
|
||||
AppCompatDelegate.setDefaultNightMode(settingsManager.theme)
|
||||
setTheme(newAccent.theme)
|
||||
|
||||
val binding = DataBindingUtil.setContentView<ActivityMainBinding>(
|
||||
this, R.layout.activity_main
|
||||
)
|
||||
|
||||
if (isEdgeOn()) {
|
||||
setupEdgeToEdge(binding)
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.isLandscape
|
||||
import org.oxycblt.auxio.ui.isTablet
|
||||
import org.oxycblt.auxio.ui.resolveAttr
|
||||
import org.oxycblt.auxio.ui.toColor
|
||||
|
||||
/**
|
||||
@@ -76,6 +77,10 @@ class MainFragment : Fragment() {
|
||||
navigateWithItem(controller, item)
|
||||
}
|
||||
}
|
||||
|
||||
// BottomNavigationView is a special little snowflake and doesn't like it when
|
||||
// we set the background in XML
|
||||
setBackgroundColor(R.attr.colorSurface.resolveAttr(requireContext()))
|
||||
}
|
||||
|
||||
// --- VIEWMODEL SETUP ---
|
||||
|
||||
Reference in New Issue
Block a user