How to create functionality for the following requirements in android webView?
Next Button - Should be disabled when there is no page to load next.
Previous button - Should be disabled when there is no previous page.
Progress bar (Horizontal) - Display the progress when loading a page. (Should be aligned to top or bottom and with control keys.)
Refresh button
Any other nice to have elements or controls - Share the URL of the current page etc..
There is no component available to meet your requirement, you have to create your own, with the help of recyclerView and ViewPager2, List which contains your URLs, I have described using the diagram. User recyclerView to display a progress bar, and ViewPager2 will use to display the fragment, and the fragment contains the webView.
Related
I would like to have a page which includes 3 items:
A SwipeView: Horizontal swipe. We can swipe left and right to navigate to a next view.
I think it is easy to achieve this one with ViewPager in Android (https://learn.microsoft.com/en-us/xamarin/android/user-interface/controls/view-pager/) and UIScrollView (pagingEnabled=YES) combined to UIPageControl (not sure where it is in Xamarin iOS). Look like there is no a UI control doing like this in Xamarin Form. I'm not sure.
A DatePicker: We can select a date, then SwipeView will load and show a content related to the selected date.
A Navigation: Include a previous navigation and next navigation, we can tap on these navigation to swipe to previous or next view. Behavior likes when we interact on SwipeView.
There is a big challenge here. By using SwipeView with Date navigation, we don't have a total dataset. We don't know number of views (pages) available!!
Do you have any idea for solving this issue?
SwipeView with DatePicker Mock UI
I have an Activity with android.support.v4.view.ViewPager and custom ActionBar. There are three(0,1,2) pages in the ViewPager with page 1 set to be default page and user can slide left and right.
One Fragment class is used to show UI for each of the pages,which has a WebView which shows some html data which can be collapsed and viewed on a Button click in the WebView. Now there is also a button in the action, and I'm required to collapse and show these data on WebViewon the click of the Button in ActionBar. I've done it but the problem is that the items on the currently viewing page of ViewPager are not toggling on the click of the button in the actionbar, while that for the page on the left or right of it are working well.
How can I solve this problem?
What is the correct method of doing this?
You need to write 3 interfaces in 3 fragments.
You need to register this 3 fragments to you pager adapter/activity.
Whenever you click on the actionBar button check which is your
active/current page in the viewPager.
Perform click operation on the registered interface on the basis of
the active/current Page/Fragment.
I have a screen with recyclerView and articles list inside it. After clicking on item - i open new activity with content inside WebView (each article has own url which is displayed). I need to improve this functionality and add ability to switch between articles inside my activity with WebView by swipe movement (left - right).
That is my question: which way should i choose, make it with ViewPager or intercept swipe moves manually and refresh only content for WebView. Which way would be better for performance and more friendly user? Maybe some of you already have this experience?
I have a single activity which has a tabPageIndicator at the bottom of the screen. . The first four icons need to open other fragments. The final icon needs to open an alert box with options to open other screens.
I am facing two problems:
ViewPager loads all the 4 fragments at once and there is a lot of data being processed in the background. I would like to know if there is any way to load content only when the fragment is visible to user. I tried using setPageLimit but it did not work.
My second problem is that I would like to ideally open a popup when the last icon is clicked, rather than opening another fragment. IS that possible?
I am not sure if viewPager supports view without fragments.
I want to show a button in a view.. If I swipe it left/right, I want to be able to get the next button.. How can I do it?
Each button represents an option of a menu..
Swiping should only work on the button.
The ViewPager class allows you to implement horizontal swiping through menu items. It can be set up to work on just on a small area of your Activity. You would use a fragment containing just a button in your case.
Take a look at this post on the Android Developers Blog for an example.