I need to provide facility as shown in images.
In first view when there is viewpager at bottom.
When user swap from right to left the first should replace by second. That I can do. But
My question is how to so half portion of next view at end of right side and and of left side.
i.e.'irst' of first view and 'Thir' of second view.
You can try to remove the first TextView and then add back to the end of the linear layout using addView. TextView tv = (TextView)layout. getChildAt(0); layout. removeView(tv); layout.
View is a basic building block of UI (User Interface) in android. A view is a small rectangular box that responds to user inputs. Eg: EditText, Button, CheckBox, etc. ViewGroup is an invisible container of other views (child views) and other ViewGroup.
Tags are essentially an extra piece of information that can be associated with a view. They are most often used as a convenience to store data related to views in the views themselves rather than by putting them in a separate structure. Reference: http://developer.android.com/reference/android/view/View.html.
You can use gallery here. Inside gallery for each items, set the layout params (width) to fit with your requirement.
Problem with gallery is that it does not rotate the items. Which means that once you reach the end of the list, you do not get first item.
But there is a trick to over come that too. All you need to do is to set the list count to very large number (INT_MAX) and in your adapter carefully return proper views by % calculation.
This will ensure that you will not reach end of list soon.
I'd suggest checking out the solution for the question Android ViewPager with previous and next pages visible?) - using a negative page margin (via ViewPager.setPageMargin
) will allow you see multiple pages at a time (i.e., to the left and right of your current page).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With