Android Viewpager with dynamic data - android

There are buttons from the service. I need to show these buttons according to the screen size. Buttons that do not fit on the screen should appear when you scroll to the right using the viewpager. How can I do that.
Sorry, I made the picture by hand.

Related

How to add scrollable background image in sliding fragments in android?

I'm developing an android app which is having 7 tabbed (slidable) fragments. I want to add a single scrollable background to these fragments. Searched a lot, but couldn't find a solution to this.
I want to have the same effect as that of a home screen in any launcher - When you swipe through different views the background also scrolls accordingly.
An example would be:
https://www.youtube.com/watch?v=uP91iN04kyc (# 1:17)
Pointers on how to do that are also enough.
I was thinking if we can have an image as background and set the x offfset and width of the image for every tabbed fragment, then we can achieve the same effect. Not sure if that will be the right approach or it is possible or not.
You need to add ImageView behind your pager.
Set its (ImageView) right margin to negative value (so the width of the image is greater than width of the screen)
Then register listener for pager scroll and set image view translateX accordinally.
Voila, scrolling background image.

Animation on Layout Android Code

I am a newbie android developer.
In some application, mainly Iphone magazine or others, they have feature animation on each thumbnail news. ( When user click on the news, the small article with thumbnail image will zoom or stretch to full screen of the phone)
Sorry It's hard to explain, anyway that's the concept.
I'm not sure what this feature call in android.
EDITED
For example, I have a relative layout in the middle of the screen. This relative layout contains an image and textview components.
What I want to do is when user click on this layout, The layout BECOME BIGGER and BIGGER (animation) until it stretch the phone screen.
Thank,
I didn't get your requirement but i here is the animation examples for Layout and frame animation.

Is it possible to display two ImageViews within a PageViewer?

I have a working ViewPager app which renders an ImageView. This ImageView fills the screen in portrait mode but when the user orientates their device to landscape I wish to display the current ImageView on the left and the next ImageView in the sequene on the right.
Currently in landscape the ImageView is simply displayed in the centre of the screen.
I know that I have to define a res/layout-land version of the PageViewer layout, but more than that I don't know.
Is this possible?
Thanks,
Mark.
I don't think it is possible to display more than 1 view on a viewpager (doesn't matter if youre using horizontal or vertical orientation). What you could try is creating 2 viewpagers, but this may become confusing (updating the positions on both viewpagers.. as I assume you want to update the images like flipping through a book). Viewpagers are quite limiting in that sense.
You can try using a ViewFlipper, instead, which allows more flexibility.

Need help to scroll images

I need to display some images which can be scrolled horizontally. Only one image should be visible on the screen. It should be like iphone screen, which has multiple 4 or more screen and display the items per screen and shows how many screens left as small circles at the bottom. Like that I have show the small circles as many as the images. I tried GestureListener, but it scroll only a single image. Any suggestions pls..
You might want to take a look at android.widget.AdapterView and android.widget.Gallery: These are standard Android widgets that provide scrolling through images. However, this will not look like the UI you describe (iOS look&feel) but like an Android app...
See this example code:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/Gallery1.html

Dashboard pattern: HorizontalScrollView with pagination or ScrollView?

I am starting a new application and I am willing to use the Dashboard pattern.
For example: The Google IO app uses it:
My issue is that the amount of buttons will be more than six.
I'm not sure if I should use vertical or horizontal scrolling.
Vertical scrolling could be done with a ScrollView or a GridView but I am not sure which would be the easier way to implement the horizontal version.
I was thinking of using an HorizontalScrollView but it doesn't have pagination. It should feel similar to the tweetdeck app.
How would you implement it?
My issue is that the amount of buttons will be more than six. I'm not sure if I should use vertical or horizontal scrolling.
IMHO, do neither. Reduce the number of buttons. Watch the 2010 Google I|O presentation on this design pattern -- the point behind the dashboard is to only surface a few items.
I would go with a vertical scroll. It is way more natural to scroll down to view more content of the same view.
A horizontal scroll kind of feels like you switch to another part of the application.
I have an app that uses a gridview with vertical scrolling but I dynamically adjust the number of rows in the gridview based on the width of the actual screen so that it in landscape or in a bigger display it uses more columns and avoid scrolling alltogether in most cases.
However in my case it is more of a search results display of categories and not a dashboard. I believe the whole point of a dashboard is to have only a small number of button (e.g. max six or so).
What you could do is dynamically interrogate the screen real estate and if there is not enough room just show e.g. 6 buttons of which one is a more/utils or whatever button. Sort of like the options menu does it.. but on a bigger screen display them all.
It would be interesting to scroll based on the orientation of the device, so you would scroll horizontally or vertically if the device is oriented that way. This would let you maximize the screen real estate.

Categories

Resources