From dabe6267b9317ddedd1fe52d5e1ffbaeb8cf5848 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Thu, 23 May 2019 16:50:31 +0200 Subject: [PATCH] Fixed error that prevented flashing --- .../java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt | 7 +++---- app/src/main/res/values/ids.xml | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/values/ids.xml diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt index cf3848e63..a5f5cd424 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt @@ -155,8 +155,6 @@ fun setScrollToLast(view: RecyclerView, shouldScrollToLast: Boolean) { Observable.timer(1, TimeUnit.SECONDS).subscribeK { callback() } } - val tag = RecyclerView::class.java.name.sumBy { it.toInt() } - fun RecyclerView.Adapter<*>.setListener() { val observer = object : RecyclerView.AdapterDataObserver() { override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { @@ -164,11 +162,12 @@ fun setScrollToLast(view: RecyclerView, shouldScrollToLast: Boolean) { } } registerAdapterDataObserver(observer) - view.setTag(tag, observer) + view.setTag(R.id.recyclerScrollListener, observer) } fun RecyclerView.Adapter<*>.removeListener() { - val observer = view.getTag(tag) as? RecyclerView.AdapterDataObserver ?: return + val observer = + view.getTag(R.id.recyclerScrollListener) as? RecyclerView.AdapterDataObserver ?: return unregisterAdapterDataObserver(observer) } diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml new file mode 100644 index 000000000..77b8f273e --- /dev/null +++ b/app/src/main/res/values/ids.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file