Update Groupie to 2.9.0

This commit is contained in:
TacoTheDank 2021-09-22 19:08:03 -04:00
parent f36fd2f7b2
commit b61d44aaa6
5 changed files with 12 additions and 16 deletions

View file

@ -107,7 +107,7 @@ ext {
icepickVersion = '3.2.0' icepickVersion = '3.2.0'
exoPlayerVersion = '2.12.3' exoPlayerVersion = '2.12.3'
googleAutoServiceVersion = '1.0' googleAutoServiceVersion = '1.0'
groupieVersion = '2.8.1' groupieVersion = '2.9.0'
markwonVersion = '4.6.2' markwonVersion = '4.6.2'
leakCanaryVersion = '2.5' leakCanaryVersion = '2.5'

View file

@ -1,8 +1,7 @@
package org.schabi.newpipe.info_list package org.schabi.newpipe.info_list
import android.util.Log import android.util.Log
import com.xwray.groupie.GroupAdapter import com.xwray.groupie.GroupieAdapter
import com.xwray.groupie.GroupieViewHolder
import org.schabi.newpipe.extractor.stream.StreamInfo import org.schabi.newpipe.extractor.stream.StreamInfo
import kotlin.math.max import kotlin.math.max
@ -11,7 +10,7 @@ import kotlin.math.max
*/ */
class StreamSegmentAdapter( class StreamSegmentAdapter(
private val listener: StreamSegmentListener private val listener: StreamSegmentListener
) : GroupAdapter<GroupieViewHolder>() { ) : GroupieAdapter() {
var currentIndex: Int = 0 var currentIndex: Int = 0
private set private set

View file

@ -40,8 +40,7 @@ import androidx.core.view.isVisible
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import com.xwray.groupie.GroupAdapter import com.xwray.groupie.GroupieAdapter
import com.xwray.groupie.GroupieViewHolder
import com.xwray.groupie.Item import com.xwray.groupie.Item
import com.xwray.groupie.OnItemClickListener import com.xwray.groupie.OnItemClickListener
import com.xwray.groupie.OnItemLongClickListener import com.xwray.groupie.OnItemLongClickListener
@ -91,7 +90,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
private var groupName = "" private var groupName = ""
private var oldestSubscriptionUpdate: OffsetDateTime? = null private var oldestSubscriptionUpdate: OffsetDateTime? = null
private lateinit var groupAdapter: GroupAdapter<GroupieViewHolder> private lateinit var groupAdapter: GroupieAdapter
@State @JvmField var showPlayedItems: Boolean = true @State @JvmField var showPlayedItems: Boolean = true
private var onSettingsChangeListener: SharedPreferences.OnSharedPreferenceChangeListener? = null private var onSettingsChangeListener: SharedPreferences.OnSharedPreferenceChangeListener? = null
@ -131,7 +130,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
viewModel = ViewModelProvider(this, factory).get(FeedViewModel::class.java) viewModel = ViewModelProvider(this, factory).get(FeedViewModel::class.java)
viewModel.stateLiveData.observe(viewLifecycleOwner, { it?.let(::handleResult) }) viewModel.stateLiveData.observe(viewLifecycleOwner, { it?.let(::handleResult) })
groupAdapter = GroupAdapter<GroupieViewHolder>().apply { groupAdapter = GroupieAdapter().apply {
setOnItemClickListener(listenerStreamItem) setOnItemClickListener(listenerStreamItem)
setOnItemLongClickListener(listenerStreamItem) setOnItemLongClickListener(listenerStreamItem)
} }

View file

@ -21,8 +21,7 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.xwray.groupie.GroupAdapter import com.xwray.groupie.GroupieAdapter
import com.xwray.groupie.GroupieViewHolder
import com.xwray.groupie.OnItemClickListener import com.xwray.groupie.OnItemClickListener
import com.xwray.groupie.Section import com.xwray.groupie.Section
import icepick.Icepick import icepick.Icepick
@ -78,7 +77,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
private val subscriptionMainSection = Section() private val subscriptionMainSection = Section()
private val subscriptionEmptyFooter = Section() private val subscriptionEmptyFooter = Section()
private lateinit var subscriptionGroupAdapter: GroupAdapter<GroupieViewHolder> private lateinit var subscriptionGroupAdapter: GroupieAdapter
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -153,7 +152,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
} }
} }
subscriptionGroupAdapter = GroupAdapter<GroupieViewHolder>().apply { subscriptionGroupAdapter = GroupieAdapter().apply {
add(subscriptionMainSection) add(subscriptionMainSection)
add(subscriptionEmptyFooter) add(subscriptionEmptyFooter)
spanCount = 4 spanCount = 4
@ -379,7 +378,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
} }
private fun setupIconPicker() { private fun setupIconPicker() {
val groupAdapter = GroupAdapter<GroupieViewHolder>() val groupAdapter = GroupieAdapter()
groupAdapter.addAll(FeedGroupIcon.values().map { PickerIconItem(it) }) groupAdapter.addAll(FeedGroupIcon.values().map { PickerIconItem(it) })
feedGroupCreateBinding.iconSelector.apply { feedGroupCreateBinding.iconSelector.apply {

View file

@ -11,8 +11,7 @@ import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback import androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.xwray.groupie.GroupAdapter import com.xwray.groupie.GroupieAdapter
import com.xwray.groupie.GroupieViewHolder
import com.xwray.groupie.TouchCallback import com.xwray.groupie.TouchCallback
import icepick.Icepick import icepick.Icepick
import icepick.State import icepick.State
@ -38,7 +37,7 @@ class FeedGroupReorderDialog : DialogFragment() {
@State @State
@JvmField @JvmField
var groupOrderedIdList = ArrayList<Long>() var groupOrderedIdList = ArrayList<Long>()
private val groupAdapter = GroupAdapter<GroupieViewHolder>() private val groupAdapter = GroupieAdapter()
private val itemTouchHelper = ItemTouchHelper(getItemTouchCallback()) private val itemTouchHelper = ItemTouchHelper(getItemTouchCallback())
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {