View pager android with single background picture - android

Is it possible to have one picture as a panorama background of a viewpager, without having to cut the image into 3 and put each of the 3 images as a background for each of the different views?
Like the home screen of android.

You want a horzontal Parallax .
this library should to the trick, or at least get you on track.

Related

In android how to swipe screens with image buttons?

I want to create an android application..Where I have 3 xml files. 1st one is the splash screen, 2nd one describes the overview third one is the about me..
My requirement is in the page there will be three circles in the bottom for 3 screens.
when i click to a screen(swipe) it will go to another screen and one of the circle will fill up a colour.other wise
it will blank..
Actually I want like :--- This image
This image has 5 circles for 5 screens..if we are in page3 then 3rd no circle will fill up a colour others will empty..
Please give me some suggestion..how can I do that????
You can use the ViewPager to swipe and for circle indictor you can use the image views with selectors background and manage this in onPageChangeListener.
One of the best and standard solution/example you can find here :
http://developer.android.com/training/animation/screen-slide.html
I have used this and working fine. please let me know if you are having any further issue.
For main screen xml You have to use FrameLayout as the images(circle indicators) will be on the top of the screens.

Flip an Imageview with two images back to back

I need to have a set of Image views on a Linear Layout. &
==> onClick of an ImageView, I want to turn the Image to the back(Like Flipping Effect) & show another Image.
==> Again on click of that Image or another Image, I want to apply the same effect for that Image View & the Previous Imageview must come to the default position.
---> I just checked the FLIP ANIMATION in Android. But it is flipping the total view.
So I Just need How to flip an Image view in the same manner, with support from Android v2.2 & up
I think it is quite complicated but it is interesting & need some help how to achieve this as I am just learning the Android(& Coding).
Thanks.!!!
You can use this small library to do that :
https://github.com/castorflex/FlipImageView

Image auto scrolling in android

I want to create an image auto scrolling for an outer-space type of game. To make it more exact, I want to load 2 background image that uses a single image occupying the whole screen and auto-scroll it alternatively to create an animation that the background image is moving. Don't get confused with auto scrolling and and shifting to another image automatically. I really meant auto scrolling like moving background using 1 image.
I did some research but what I saw are segments of java codes that made me confused. If possible can anyone provide me an example? From loading the image from xml (should I use an imageview with this? or just set the background image of the layout?) and how I should process it in java code to make an image autoscrolling.
Any ideas guys? Thanks! Sorry for asking too much.

how to design this UI in android app

i am trying to create the following UI in android app
In the above image all the five are to be image buttons. How to design this UI as like in the screen shot please help me friends....
Inside LinearLayout take RelativeLayout and make it centrally aligned.Then
Take first image Near me and set it's property.
Now take the second image Explore and set it to right of first image.
Place third image My network and place it below first image.
Fourth image Live set this to right of third image and and below second image.
Now center aligned your center image.
You will need to create 5 images, each of which has transparent areas. This layout type lets you position elements relative to the layout group itself, as well as to items within the group.
I'm not very familiar with Android advanced layout design, but the common layout objects give an idea:
There is a SurfaceView which gives you the ability to manipulate z-coördinates. In the SurfaceView you can then place a Grid/Relative/TableLayout for the 4 buttons (which you pre-render as rectangular images with transparency) and a simple Layout which centers and only contains the middle button.
If you then set the Z value of the first layout to less than that of the second you will get the view you want.

Does Android layouts work like HTML/CSS layouts?

I have created a button in Photoshop and I have split them into 3 images. Now I want to put those images into android button. I know how to create layouts in android but the point I am missing is how can I make them fluid?
So there is a button for which I have 3 images.
I now want to ask how can I use these images for a <Button> tag so it expands repeating the middle one. Do I need to create style here and then put background="#drawable/three_button_style" or there is something I really need to know?
Is the same going to be true for ListView? I got a list view and images for top, middle and bottom so can I create a ListView of 3 images repeating the middle one?
For scaling items Android usually uses 9-patch, which behaves something like your example but also vertically. Here's a link to the 9-patch tool that can be used to draw these:
http://developer.android.com/guide/developing/tools/draw9patch.html

Categories

Resources