ui: rework resource distribution
Try to remove the weird config file and replace it with more conventional resource files in other places.
This commit is contained in:
@@ -44,6 +44,9 @@ import org.oxycblt.auxio.util.systemBarInsetsCompat
|
||||
*
|
||||
* TODO: Add multi-select
|
||||
*
|
||||
* LEFT-OFF: Add RecyclerView styles, queue issue is caused by tiny scroll and then replace op, not
|
||||
* enough to change scroll apparently
|
||||
*
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
@@ -111,8 +111,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
||||
this.titleAnimator =
|
||||
ValueAnimator.ofFloat(from, to).apply {
|
||||
addUpdateListener { titleView?.alpha = it.animatedValue as Float }
|
||||
duration =
|
||||
resources.getInteger(R.integer.detail_app_bar_title_anim_duration).toLong()
|
||||
duration = TOOLBAR_FADE_DURATION
|
||||
start()
|
||||
}
|
||||
}
|
||||
@@ -143,6 +142,8 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TOOLBAR_FADE_DURATION = 150L
|
||||
|
||||
private val TOOLBAR_TITLE_TEXT_FIELD: Field by
|
||||
lazyReflectedField(Toolbar::class, "mTitleTextView")
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.oxycblt.auxio.settings
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.annotation.DrawableRes
|
||||
@@ -161,6 +162,10 @@ class SettingsListFragment : PreferenceFragmentCompat() {
|
||||
preference.apply {
|
||||
when (key) {
|
||||
context.getString(R.string.set_key_theme) -> {
|
||||
// Android 12 is the first version I deem to have universal dark and light
|
||||
// mode toggles. No need for our setting.
|
||||
isVisible = Build.VERSION.SDK_INT < Build.VERSION_CODES.S
|
||||
|
||||
onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _, value ->
|
||||
AppCompatDelegate.setDefaultNightMode(value as Int)
|
||||
|
||||
Reference in New Issue
Block a user