mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-24 01:48:24 +01:00
Change source preference theming fix (#8679)
This commit is contained in:
parent
99a717f849
commit
8945ef8880
@ -53,9 +53,6 @@ interface ThemingDelegate {
|
||||
resIds += R.style.ThemeOverlay_Tachiyomi_Amoled
|
||||
}
|
||||
|
||||
// For source preference theme
|
||||
resIds += R.style.PreferenceThemeOverlay_Tachiyomi
|
||||
|
||||
return resIds
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package eu.kanade.tachiyomi.ui.browse.extension.details
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
@ -127,6 +129,13 @@ class SourcePreferencesScreen(val sourceId: Long) : Screen {
|
||||
|
||||
class SourcePreferencesFragment : PreferenceFragmentCompat() {
|
||||
|
||||
override fun getContext(): Context? {
|
||||
val superCtx = super.getContext() ?: return null
|
||||
val tv = TypedValue()
|
||||
superCtx.theme.resolveAttribute(R.attr.preferenceTheme, tv, true)
|
||||
return ContextThemeWrapper(superCtx, tv.resourceId)
|
||||
}
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
preferenceScreen = populateScreen()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user