From b61d44aaa6a71af2c8f0a17336cc875768110ed1 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 22 Sep 2021 19:08:03 -0400 Subject: [PATCH] Update Groupie to 2.9.0 --- app/build.gradle | 2 +- .../org/schabi/newpipe/info_list/StreamSegmentAdapter.kt | 5 ++--- .../java/org/schabi/newpipe/local/feed/FeedFragment.kt | 7 +++---- .../newpipe/local/subscription/dialog/FeedGroupDialog.kt | 9 ++++----- .../local/subscription/dialog/FeedGroupReorderDialog.kt | 5 ++--- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1c193ff34..68e5ac3e5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -107,7 +107,7 @@ ext { icepickVersion = '3.2.0' exoPlayerVersion = '2.12.3' googleAutoServiceVersion = '1.0' - groupieVersion = '2.8.1' + groupieVersion = '2.9.0' markwonVersion = '4.6.2' leakCanaryVersion = '2.5' diff --git a/app/src/main/java/org/schabi/newpipe/info_list/StreamSegmentAdapter.kt b/app/src/main/java/org/schabi/newpipe/info_list/StreamSegmentAdapter.kt index 62a06e29b..9fb4bfbb3 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/StreamSegmentAdapter.kt +++ b/app/src/main/java/org/schabi/newpipe/info_list/StreamSegmentAdapter.kt @@ -1,8 +1,7 @@ package org.schabi.newpipe.info_list import android.util.Log -import com.xwray.groupie.GroupAdapter -import com.xwray.groupie.GroupieViewHolder +import com.xwray.groupie.GroupieAdapter import org.schabi.newpipe.extractor.stream.StreamInfo import kotlin.math.max @@ -11,7 +10,7 @@ import kotlin.math.max */ class StreamSegmentAdapter( private val listener: StreamSegmentListener -) : GroupAdapter() { +) : GroupieAdapter() { var currentIndex: Int = 0 private set diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index b3619276d..965075bf3 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -40,8 +40,7 @@ import androidx.core.view.isVisible import androidx.lifecycle.ViewModelProvider import androidx.preference.PreferenceManager import androidx.recyclerview.widget.GridLayoutManager -import com.xwray.groupie.GroupAdapter -import com.xwray.groupie.GroupieViewHolder +import com.xwray.groupie.GroupieAdapter import com.xwray.groupie.Item import com.xwray.groupie.OnItemClickListener import com.xwray.groupie.OnItemLongClickListener @@ -91,7 +90,7 @@ class FeedFragment : BaseStateFragment() { private var groupName = "" private var oldestSubscriptionUpdate: OffsetDateTime? = null - private lateinit var groupAdapter: GroupAdapter + private lateinit var groupAdapter: GroupieAdapter @State @JvmField var showPlayedItems: Boolean = true private var onSettingsChangeListener: SharedPreferences.OnSharedPreferenceChangeListener? = null @@ -131,7 +130,7 @@ class FeedFragment : BaseStateFragment() { viewModel = ViewModelProvider(this, factory).get(FeedViewModel::class.java) viewModel.stateLiveData.observe(viewLifecycleOwner, { it?.let(::handleResult) }) - groupAdapter = GroupAdapter().apply { + groupAdapter = GroupieAdapter().apply { setOnItemClickListener(listenerStreamItem) setOnItemLongClickListener(listenerStreamItem) } diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt index 69d4c8819..851e84f9f 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt @@ -21,8 +21,7 @@ import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.xwray.groupie.GroupAdapter -import com.xwray.groupie.GroupieViewHolder +import com.xwray.groupie.GroupieAdapter import com.xwray.groupie.OnItemClickListener import com.xwray.groupie.Section import icepick.Icepick @@ -78,7 +77,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable { private val subscriptionMainSection = Section() private val subscriptionEmptyFooter = Section() - private lateinit var subscriptionGroupAdapter: GroupAdapter + private lateinit var subscriptionGroupAdapter: GroupieAdapter override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -153,7 +152,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable { } } - subscriptionGroupAdapter = GroupAdapter().apply { + subscriptionGroupAdapter = GroupieAdapter().apply { add(subscriptionMainSection) add(subscriptionEmptyFooter) spanCount = 4 @@ -379,7 +378,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable { } private fun setupIconPicker() { - val groupAdapter = GroupAdapter() + val groupAdapter = GroupieAdapter() groupAdapter.addAll(FeedGroupIcon.values().map { PickerIconItem(it) }) feedGroupCreateBinding.iconSelector.apply { diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupReorderDialog.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupReorderDialog.kt index 57815ea90..58547afd2 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupReorderDialog.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupReorderDialog.kt @@ -11,8 +11,7 @@ import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.xwray.groupie.GroupAdapter -import com.xwray.groupie.GroupieViewHolder +import com.xwray.groupie.GroupieAdapter import com.xwray.groupie.TouchCallback import icepick.Icepick import icepick.State @@ -38,7 +37,7 @@ class FeedGroupReorderDialog : DialogFragment() { @State @JvmField var groupOrderedIdList = ArrayList() - private val groupAdapter = GroupAdapter() + private val groupAdapter = GroupieAdapter() private val itemTouchHelper = ItemTouchHelper(getItemTouchCallback()) override fun onCreate(savedInstanceState: Bundle?) {