Skip to content
Snippets Groups Projects
Commit 49f1e0c5 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Make the SwipeRefreshLayout background color follow the theme

Fixes #2666
parent 5f03d83f
No related branches found
No related tags found
1 merge request!1502Make the SwipeRefreshLayout background color follow the theme
Pipeline #258121 passed with stage
in 3 minutes and 43 seconds
......@@ -2,6 +2,7 @@ package org.videolan.vlc.gui
import android.content.Intent
import android.content.res.TypedArray
import android.graphics.Color
import android.os.Bundle
import android.util.TypedValue
import android.view.Menu
......@@ -55,10 +56,12 @@ abstract class BaseFragment : Fragment(), ActionMode.Callback {
super.onViewCreated(view, savedInstanceState)
view.findViewById<SwipeRefreshLayout>(R.id.swipeLayout)?.let {
swipeRefreshLayout = it
val a: TypedArray = requireActivity().obtainStyledAttributes(TypedValue().data, intArrayOf(R.attr.colorPrimary))
val a: TypedArray = requireActivity().obtainStyledAttributes(TypedValue().data, intArrayOf(R.attr.colorPrimary, R.attr.background_default))
val color = a.getColor(0, 0)
val bColor = a.getColor(1, Color.WHITE)
a.recycle()
it.setColorSchemeColors(color)
it.setProgressBackgroundColorSchemeColor(bColor)
}
val fab = requireActivity().findViewById<FloatingActionButton?>(R.id.fab)
((fab?.layoutParams as? CoordinatorLayout.LayoutParams)?.behavior as? FloatingActionButtonBehavior)?.shouldNeverShow = !hasFAB()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment