From 36b283d76e9f62b37dfd44d0922c4cf3074a3572 Mon Sep 17 00:00:00 2001 From: RuijinYao <878117310@qq.com> Date: Mon, 6 Sep 2021 09:58:57 +0800 Subject: [PATCH 1/2] Fix the bug of webview height webview height grows indefinitely inside a nestedScrollView --- library/src/main/res/layout/finest_web_view.xml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/library/src/main/res/layout/finest_web_view.xml b/library/src/main/res/layout/finest_web_view.xml index 598731c..28de23e 100644 --- a/library/src/main/res/layout/finest_web_view.xml +++ b/library/src/main/res/layout/finest_web_view.xml @@ -28,16 +28,11 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - - - + - Date: Mon, 6 Sep 2021 10:10:20 +0800 Subject: [PATCH 2/2] Fix refresh and incomplete page issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because the NestedScrollView is deleted, any pull-down will refresh the page, so refresh is disabled by default; And after deleting the NestedScrollView, the toobar setting layout_scrollFlags="scroll|enterAlways" is invalid, the bottom of the page is incomplete, and ‘scroll’ is not used by default. --- .../thefinestartist/finestwebview/FinestWebViewActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/thefinestartist/finestwebview/FinestWebViewActivity.kt b/library/src/main/java/com/thefinestartist/finestwebview/FinestWebViewActivity.kt index 9b5ee98..91b48cc 100644 --- a/library/src/main/java/com/thefinestartist/finestwebview/FinestWebViewActivity.kt +++ b/library/src/main/java/com/thefinestartist/finestwebview/FinestWebViewActivity.kt @@ -243,7 +243,7 @@ class FinestWebViewActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedL rtl = if (finestWebView.rtl != null) finestWebView.rtl!! else resources.getBoolean(R.bool.is_right_to_left) statusBarColor = if (finestWebView.statusBarColor != null) finestWebView.statusBarColor!! else colorPrimaryDark toolbarColor = if (finestWebView.toolbarColor != null) finestWebView.toolbarColor!! else colorPrimary - toolbarScrollFlags = if (finestWebView.toolbarScrollFlags != null) finestWebView.toolbarScrollFlags!! else AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL or AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS + toolbarScrollFlags = if (finestWebView.toolbarScrollFlags != null) finestWebView.toolbarScrollFlags!! else AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS iconDefaultColor = if (finestWebView.iconDefaultColor != null) finestWebView.iconDefaultColor!! else colorAccent iconDisabledColor = if (finestWebView.iconDisabledColor != null) finestWebView.iconDisabledColor!! else disableColor(iconDefaultColor) iconPressedColor = if (finestWebView.iconPressedColor != null) finestWebView.iconPressedColor!! else iconDefaultColor @@ -256,7 +256,7 @@ class FinestWebViewActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedL disableIconForward = if (finestWebView.disableIconForward != null) finestWebView.disableIconForward!! else false showIconMenu = if (finestWebView.showIconMenu != null) finestWebView.showIconMenu!! else true disableIconMenu = if (finestWebView.disableIconMenu != null) finestWebView.disableIconMenu!! else false - showSwipeRefreshLayout = if (finestWebView.showSwipeRefreshLayout != null) finestWebView.showSwipeRefreshLayout!! else true + showSwipeRefreshLayout = if (finestWebView.showSwipeRefreshLayout != null) finestWebView.showSwipeRefreshLayout!! else false swipeRefreshColor = if (finestWebView.swipeRefreshColor != null) finestWebView.swipeRefreshColor!! else colorAccent if (finestWebView.swipeRefreshColors != null) { val colors = IntArray(finestWebView.swipeRefreshColors!!.size) @@ -1079,4 +1079,4 @@ class FinestWebViewActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedL onPageCommitVisible(this@FinestWebViewActivity, key, url) } } -} \ No newline at end of file +}