From 97454ca162dbe38b9b1e0fd988f0660055daa104 Mon Sep 17 00:00:00 2001 From: len Date: Mon, 1 Aug 2016 00:09:34 +0200 Subject: [PATCH] Disable shared holders for now --- .../ui/library/LibraryCategoryFragment.kt | 2 +- .../kanade/tachiyomi/ui/library/LibraryFragment.kt | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt index 57c100dc0..1b28363f2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt @@ -94,7 +94,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli // This crashes when opening a manga after changing categories, but then viewholders aren't // recycled between pages. It may be fixed if this fragment is replaced with a custom view. //(recycler.layoutManager as LinearLayoutManager).recycleChildrenOnDetach = true - recycler.recycledViewPool = libraryFragment.pool + //recycler.recycledViewPool = libraryFragment.pool recycler.setHasFixedSize(true) recycler.adapter = adapter swipe_refresh.addView(recycler) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt index fe78be102..ac0b77b6d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt @@ -7,7 +7,6 @@ import android.os.Bundle import android.support.design.widget.TabLayout import android.support.v4.view.ViewPager import android.support.v7.view.ActionMode -import android.support.v7.widget.RecyclerView import android.support.v7.widget.SearchView import android.view.* import com.afollestad.materialdialogs.MaterialDialog @@ -94,10 +93,11 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback /** * A pool to share view holders between all the registered categories (fragments). */ - var pool = RecyclerView.RecycledViewPool().apply { setMaxRecycledViews(0, 20) } - private set(value) { - field = value.apply { setMaxRecycledViews(0, 20) } - } + // TODO find out why this breaks sometimes +// var pool = RecyclerView.RecycledViewPool().apply { setMaxRecycledViews(0, 20) } +// private set(value) { +// field = value.apply { setMaxRecycledViews(0, 20) } +// } private var numColumnsSubscription: Subscription? = null @@ -278,8 +278,8 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback * Reattaches the adapter to the view pager to recreate fragments */ private fun reattachAdapter() { - pool.clear() - pool = RecyclerView.RecycledViewPool() +// pool.clear() +// pool = RecyclerView.RecycledViewPool() val position = view_pager.currentItem view_pager.adapter = adapter view_pager.currentItem = position