android: New swipe to refresh color scheme

This commit is contained in:
Charles Lombardo 2023-03-14 00:03:51 -04:00 committed by bunnei
parent 352559b83d
commit 37cc94526b
1 changed files with 9 additions and 1 deletions

View File

@ -17,10 +17,10 @@ import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.color.MaterialColors
import org.yuzu.yuzu_emu.R import org.yuzu.yuzu_emu.R
import org.yuzu.yuzu_emu.YuzuApplication import org.yuzu.yuzu_emu.YuzuApplication
import org.yuzu.yuzu_emu.adapters.GameAdapter import org.yuzu.yuzu_emu.adapters.GameAdapter
import org.yuzu.yuzu_emu.utils.InsetsHelper
class PlatformGamesFragment : Fragment(), PlatformGamesView { class PlatformGamesFragment : Fragment(), PlatformGamesView {
private val presenter = PlatformGamesPresenter(this) private val presenter = PlatformGamesPresenter(this)
@ -70,6 +70,14 @@ class PlatformGamesFragment : Fragment(), PlatformGamesView {
pullToRefresh.isRefreshing = false pullToRefresh.isRefreshing = false
} }
// Set theme color to the refresh animation's background
pullToRefresh.setProgressBackgroundColorSchemeColor(
MaterialColors.getColor(pullToRefresh, R.attr.colorPrimary)
)
pullToRefresh.setColorSchemeColors(
MaterialColors.getColor(pullToRefresh, R.attr.colorOnPrimary)
)
setInsets() setInsets()
} }