Skip to content

Commit

Permalink
Give TabFilterPreferencesFragment background color to fix transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
charlag committed Feb 25, 2024
1 parent 9193121 commit 524eec8
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
package com.keylesspalace.tusky.components.preference

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.preference.PreferenceFragmentCompat
import com.google.android.material.color.MaterialColors
import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.di.Injectable
import com.keylesspalace.tusky.settings.AccountPreferenceDataStore
Expand All @@ -31,6 +35,17 @@ class TabFilterPreferencesFragment : PreferenceFragmentCompat(), Injectable {
@Inject
lateinit var accountPreferenceDataStore: AccountPreferenceDataStore

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
// Give view a background color so transitions show up correctly
return super.onCreateView(inflater, container, savedInstanceState).also { view ->
view.setBackgroundColor(MaterialColors.getColor(view, android.R.attr.colorBackground))
}
}

override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
makePreferenceScreen {
preferenceCategory(R.string.title_home) { category ->
Expand Down

0 comments on commit 524eec8

Please sign in to comment.