From 7bf6eef2aa48b66c51d17f752eb4926ba9addac1 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 24 May 2021 21:56:12 +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 --- app/src/main/assets/updateLog.md | 1 + .../RecyclerViewAtPager2.kt} | 12 ++++++++---- app/src/main/res/layout/fragment_books.xml | 2 +- app/src/main/res/layout/fragment_explore.xml | 2 +- app/src/main/res/layout/fragment_rss.xml | 2 +- app/src/main/res/layout/fragment_rss_articles.xml | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) rename app/src/main/java/io/legado/app/ui/widget/{RecyclerViewAtViewPager2.kt => recycler/RecyclerViewAtPager2.kt} (89%) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index bd024a9bd..e1016e4e3 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -5,6 +5,7 @@ **2021/05/24** * 反转目录后刷新内容 +* 修复上下滑动会导致左右切换问题 **2021/05/21** * 添加反转目录功能 diff --git a/app/src/main/java/io/legado/app/ui/widget/RecyclerViewAtViewPager2.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/RecyclerViewAtPager2.kt similarity index 89% rename from app/src/main/java/io/legado/app/ui/widget/RecyclerViewAtViewPager2.kt rename to app/src/main/java/io/legado/app/ui/widget/recycler/RecyclerViewAtPager2.kt index 10abec353..7ab5ed8e9 100644 --- a/app/src/main/java/io/legado/app/ui/widget/RecyclerViewAtViewPager2.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/RecyclerViewAtPager2.kt @@ -1,15 +1,19 @@ -package io.legado.app.ui.widget +package io.legado.app.ui.widget.recycler import android.content.Context -import androidx.recyclerview.widget.RecyclerView import android.util.AttributeSet import android.view.MotionEvent +import androidx.recyclerview.widget.RecyclerView import kotlin.math.abs -class RecyclerViewAtViewPager2 : RecyclerView { +class RecyclerViewAtPager2 : RecyclerView { constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super( + context, + attrs, + defStyleAttr + ) private var startX = 0 private var startY = 0 diff --git a/app/src/main/res/layout/fragment_books.xml b/app/src/main/res/layout/fragment_books.xml index 1e2fbe64b..e67df9c4e 100644 --- a/app/src/main/res/layout/fragment_books.xml +++ b/app/src/main/res/layout/fragment_books.xml @@ -9,7 +9,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - -