If I wanna use, say a picture, on a viewPager but spread each third of the picture onto the three different views of the viewPager, is this possible to do? If so, how?
Related
I want to have ViewPager with photos with the thumbnails at the bottom, like this
I saw some libraries that implements page indicators with dots or something, but I have no idea how to do it with custom different pictures. Also it's need to have an ability to implement animation, as on screenshot selected tab indicator bigger then unselected
The only solution I found is to make another ViewPager for thumbnails, but it must be more elegant solution
I guess this library is the nearest solution for your need.
Could anyone please help me as I want to implement viewpager textview, instead of images, I have searched on google however I cant manage to find any tutorials or help.
I have looked android developer sample. http://developer.android.com/training/animation/screen-slide.html#views
This is something which I am looking for however I want to show two different views of textviews, instead of repeating the same textview when swiping the screen. The sample shows 5 views which are all repating the same textview, however I want to have two views which are two different textviews, e.g, textview1 and textview2.
Could you please advise however I am able to do this, or if their are any tutorials to help me to achieve this.
You can use two different fragments and put different textview in each. I am providing the link of viewpager with different fragment.
How to implement a ViewPager with different Fragments / Layouts
I've got an app made for tablets, where I'm using RelativeLayout. For smaller screens I'd made TabLayout where that RelativeLayout is splitted on 3 tabs. That 3 tabs are 3 separated xml files. My problem is connecting code to both layouts. On tablet, everything is in one xml so I can e.g. call:
setContentView(R.layout.tablet_layout);
button = (Button) findViewById(R.id.btn1);
but for smaller screens it is in three xml files so it won't work like that. Is it possible to do something with that?
Is there a way to add an image (ie. a arrow) between two fragments in a viewpager while swapping the fragments? By default the fragments are just stinking together and at least i want some extra space between the fragment cards.
Any ideas?
With best regards,
Juergen
Add Your View pager & Image in Frame Layout then
ViewPager.OnPageChangeListener's onPageScrolled method
try one of this to add margin between fragment
setPageMargin(int marginPixels)
setPageMarginDrawable(Drawable)
setPageMarginDrawable(int)
after that you can show hide your image with your logic.
I am trying to implement a custom grid of images in one of my ViewPager tabs. The way I've approached this so far is putting in a GridView in xml, and inflating that through my layout. However, my onClick Listener isn't working.
Looks like that may not be the best approach because I've asked a question on it and resolving the onClick issue doesn't seem to be practical at this point.
Is there a better way to put a custom grid of images (plus some text, etc, on the image item) inside a ViewPager and retain its clickability?
I'm trying to improve my approach.