0

I try to implement pull refresh with big (long) scrollable webview.

val pullRefreshState =
    rememberPullRefreshState(refreshing = isRefreshing,
    onRefresh = {isRefreshing = !isRefreshing
                 timerForReloadState += 1})
Surface {
   LazyColumn(Modifier.pullRefresh(pullRefreshState)) {
       item {
             WebView(
                     state = urlState,
                     onCreated = { webView ->
                                  webView.settings.javaScriptEnabled = true
                                  },
                     client = remember { webViewClient },
                     chromeClient = remember { chromeViewClient }
                    )
             }
   }

but I have a problem, webpage has scrollable and not scrollable content as sticky navigation top but then I apply additional scrollable field as (LazyColumn) the all webpage becomes scrollable. It seems, that view has two scroll, webpage and lazy column scroll, and then user scroll the content, he scrolls lazy column, and not page scroll.

4
  • Why are you using LazyColumn with WebView? Commented May 10, 2024 at 11:41
  • @MAshhal what should I use? I also tried verticalScroll(rememberScrollState()), the same effect. Commented May 10, 2024 at 11:49
  • I'm unable to understand your question clearly, you mentioned sticky navigation top, is this in the web content or are you putting navigation content yourself? If you don't use LazyColumn, the WebView isn't scrollable? It'll be better if u can show a video of the problem occurring Commented May 10, 2024 at 12:19
  • @MAshhal sticky navigation top are in web content. If I'm not using lazy column or column with vertical scroll, pull refresh doesn't work. pullRefresh(pullRefreshState) works only with some scroll Commented May 10, 2024 at 12:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.