webview-in-coordinatorlayout | Android library
kandi X-RAY | webview-in-coordinatorlayout Summary
kandi X-RAY | webview-in-coordinatorlayout Summary
webview-in-coordinatorlayout
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Override to handle touch events
- Dispatch a pre scroll event
- Dispatch a nested scroll event
- Start nested scroll
- Stop nested scroll
- Create the Snackbar
- Setup the activity
- This method is called when a child has changed
- Override this to handle the action bar item selection
- This method is used to dispatch a single event
- Dispatch a nested pre -Fling event
- Retrieves whether this view has a nested scroll parent
- Is nested scrolled
- Enable or disable the scroll
webview-in-coordinatorlayout Key Features
webview-in-coordinatorlayout Examples and Code Snippets
Community Discussions
Trending Discussions on webview-in-coordinatorlayout
QUESTION
I have an app with two activities extends same abstract
- one with WebView
, another with ViewPager
with TabLayout
and RecyclerView
s - and on this level I've implemented "shared" showing/hiding toolbar with scroll/fling feature:
app:layout_scrollFlags="scroll|snap|enterAlways"
WebView
is "pushing out" Toolbar
just like RecyclerView
under any tab in ViewPager
(keeping TabLayout
visible), in both cases any scroll to top brings back Toolbar
. Just like on this example:
Now I've to change this behavior - Toolbar
should be hidden when user is NOT on top of page, so: any scroll to bottom should hide Toolbar
if present and only (scroll to top && getScrollY()<=0
) should make Toolbar
enter:
I've borrowed GIFs from THIS guide, which is suggesting (all other too) that my desired behavior is default with just scroll
flag (and possibly snap
). So I've removed enterAlways
and my "native" Activity
started to work as intended out-of-the-box. WebView
- no change at all...
I'm suspecting that this bug is caused by my NestedWebView
, I'm currently using THIS one. So I've tried to drop-in replace this class with these:
marshi - not scrollable webview content (toolbar shows/hides)
takahirom - toolbar enters even when 1px scroll in up direction almost immediate (kind of snap behavior, but during touch)
hanks - no nested scrolling (fixed toolbar), also with uncommented setNestedScrollingEnabled(true);
line
How to achieve second GIF Toolbar
behavior cooperating with WebView
?
ANSWER
Answered 2019-Nov-06 at 10:21read edit on bottom and other answers/comments! don't use this class, also avoid WebView
in any form if you can. You will get into trouble sooner or later, maintaining WebView
is hell...
I've found few different implementations of NestedWebView
and noticed that all of them are old and implements NestedScrollingChild
when currently we have 3rd version of this interface: NestedScrollingChild3
(androidx
). So I've penetrated current version of NestedSrcollView
and I've added some new methods handling, and now it works. To be exact - I was trying to achieve smooth scroll through whole screen just like when WebView
would fill whole screen and Toolbar
was part of web content (always on top). Also snap
is working. use wisely
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install webview-in-coordinatorlayout
You can use webview-in-coordinatorlayout like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the webview-in-coordinatorlayout component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page