mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-30 13:07:52 +02:00
Update Theme Preview Items (#6628)
* Improved theme preview items * Tweaked theme preference item border colours * Polished theme items * Update ThemesPreference.kt item layout width value Co-authored-by: CrepeTF <trungnguyen02@outlookcom>
This commit is contained in:
@ -63,9 +63,9 @@ class ThemesPreference @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
recycler?.let {
|
||||
(it.layoutManager as LinearLayoutManager).apply {
|
||||
scrollToPositionWithOffset(
|
||||
// 118dp is the width of the pref_theme_item layout
|
||||
lX / 118.dpToPx,
|
||||
-lX % 118.dpToPx
|
||||
// 114dp is the width of the pref_theme_item layout
|
||||
lX / 114.dpToPx,
|
||||
-lX % 114.dpToPx
|
||||
)
|
||||
}
|
||||
lastScrollPosition = it.computeHorizontalScrollOffset()
|
||||
|
@ -49,7 +49,7 @@ class ThemesPreferenceAdapter(private val clickListener: OnItemClickListener) :
|
||||
inner class ThemeViewHolder(private val view: View) : RecyclerView.ViewHolder(view) {
|
||||
|
||||
private val selectedColor = view.context.getResourceColor(R.attr.colorAccent)
|
||||
private val unselectedColor = view.context.getResourceColor(android.R.attr.textColorHint)
|
||||
private val unselectedColor = view.context.getResourceColor(android.R.attr.divider)
|
||||
|
||||
fun bind(appTheme: PreferenceValues.AppTheme) {
|
||||
binding.name.text = view.context.getString(appTheme.titleResId!!)
|
||||
|
Reference in New Issue
Block a user