From 52bfc9636b2d11ef10257ace860c7276276ead27 Mon Sep 17 00:00:00 2001 From: max Date: Tue, 2 Apr 2024 16:52:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/behavior/FixAppBarBehavior.java | 49 ------------------- app/src/main/res/values-zh-rTW/strings.xml | 1 - app/src/main/res/values-zh/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 4 files changed, 52 deletions(-) delete mode 100644 app/src/main/java/com/chwl/app/ui/behavior/FixAppBarBehavior.java diff --git a/app/src/main/java/com/chwl/app/ui/behavior/FixAppBarBehavior.java b/app/src/main/java/com/chwl/app/ui/behavior/FixAppBarBehavior.java deleted file mode 100644 index 79f075b69..000000000 --- a/app/src/main/java/com/chwl/app/ui/behavior/FixAppBarBehavior.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.chwl.app.ui.behavior; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.View; - -import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.core.view.ViewCompat; - -import com.google.android.material.appbar.AppBarLayout; - -/** - * 此文件不能删,引用到AppLayout下面的 - * create by lvzebiao @2020/1/7 - */ -public class FixAppBarBehavior extends AppBarLayout.Behavior { - - public FixAppBarBehavior() { - } - - public FixAppBarBehavior(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - public void onNestedScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dxConsumed, int dyConsumed, int - dxUnconsumed, int dyUnconsumed, int type) { - super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type); - stopNestedScrollIfNeeded(dyUnconsumed, child, target, type); - } - - @Override - public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dx, int dy, int[] consumed, int type) { - super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type); - stopNestedScrollIfNeeded(dy, child, target, type); - } - - - private void stopNestedScrollIfNeeded(int dy, AppBarLayout child, View target, int type) { - if (type == ViewCompat.TYPE_NON_TOUCH) { - final int currOffset = getTopAndBottomOffset(); - if ((dy < 0 && currOffset == 0) - || (dy > 0 && currOffset == -child.getTotalScrollRange())) { - ViewCompat.stopNestedScroll(target, ViewCompat.TYPE_NON_TOUCH); - } - } - } - -} diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 61f22d146..af21a4b45 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -893,7 +893,6 @@ 隱私設置 通知提醒設置 - com.chwl.app.ui.behavior.FixAppBarBehavior 搜索記錄 進房記錄 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index e4ef0ce53..b3d0e6531 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -893,7 +893,6 @@ 隱私設置 通知提醒設置 - com.chwl.app.ui.behavior.FixAppBarBehavior 搜索記錄 進房記錄 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 103f2ba95..e75e76b15 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -883,7 +883,6 @@ Privacy Setting Notification Setting - com.chwl.app.ui.behavior.FixAppBarBehavior Search history Room entry history