From a02d5525bea6d4fd4353b44851deba22d9cb3531 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 8 Sep 2020 17:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/recycler/HeaderAdapterDataObserver.kt} | 4 ++-- .../legado/app/ui/widget/recycler/UpLinearLayoutManager.kt | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) rename app/src/main/java/io/legado/app/{help/AdapterDataObserverHeader.kt => ui/widget/recycler/HeaderAdapterDataObserver.kt} (93%) diff --git a/app/src/main/java/io/legado/app/help/AdapterDataObserverHeader.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/HeaderAdapterDataObserver.kt similarity index 93% rename from app/src/main/java/io/legado/app/help/AdapterDataObserverHeader.kt rename to app/src/main/java/io/legado/app/ui/widget/recycler/HeaderAdapterDataObserver.kt index 1aeddeb95..f8e2a0c8c 100644 --- a/app/src/main/java/io/legado/app/help/AdapterDataObserverHeader.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/HeaderAdapterDataObserver.kt @@ -1,8 +1,8 @@ -package io.legado.app.help +package io.legado.app.ui.widget.recycler import androidx.recyclerview.widget.RecyclerView -internal class AdapterDataObserverHeader( +internal class HeaderAdapterDataObserver( private var adapterDataObserver: RecyclerView.AdapterDataObserver, private var headerCount: Int ) : RecyclerView.AdapterDataObserver() { diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt index 0df53aba7..0af559c45 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/UpLinearLayoutManager.kt @@ -4,12 +4,7 @@ import android.content.Context import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSmoothScroller -class UpLinearLayoutManager: LinearLayoutManager { - val context: Context - - constructor(context: Context) : super(context) { - this.context = context - } +class UpLinearLayoutManager(val context: Context) : LinearLayoutManager(context) { fun smoothScrollToPosition(position: Int) { smoothScrollToPosition(position, 0)