Android Custom gallery - android

I have a image with the size of 1299 * 625. I want to show the image in Gallery view like first half is one page and second of is another page. Sorry for my Bad English..

Use the ViewPager and add two ImageViews to it. Split you image in half and assign each half to one ImageView.

Related

How to display other image when I scroll screen?

I have two images in drawable. I am using the ImageView to display them. However, I want to display each image individually by hand. At the first, I want to display image1.png. When I scroll left to right, it will be display images image2.png. Could you suggest to me the way to do it? Thank you so much
you can use ViewPager see this example http://developer.android.com/training/animation/screen-slide.html

Customizing image gallery

I have working sample of image gallery.
Now if I have 10 images in gallery, few of them gets displayed initially, lets say 3 (based on image thumbnail dimensions), and rest of the images can be viewed by scrolling the gallery.
I want to change this a bit.
Based on image thumbnail dimensions, few images should be displayed initially and instead of scrolling, there should be previous and next buttons, on click of which images will shift left or right.
Any help appreciated.
You can use gallery and onButtonPress call onFling (for smooth scrolling, or simple select next image) event to change selected item.
Or you can use LinearLayout, calculate image dimensions runtime, create child imageViews for parent linearLayout and onclick fill this views with your images

How to place an image on top of another image in Android XML?

I am creating an app which is a guide. I have a photograph showing an example, but I need to know, how can I make certain parts of the images clickable, to go to another activity to show more details about that thing.
Or have an image (which will be clicked) on top of the base image?
Thanks
have an image (which will be clicked) on top of the base image?
1 -
Can set the Background of Linear layout and add imageView in center of parent.
or
2- Use relative layout with tow image Views
You can split your main image on rectangular parts, then put them as ImageViews using RelativeLayout or TableLayout (which ever fits best in your case) so their combinations looks like a single image.
On each ImageView you can set a click listener using View.setOnClickListener(View.OnClickListener l)

Image displayed at Gallery not to be centred

I am using Gallery class for displaying images.
With the default implementation , the first image occupies the centre of the screen .
If the first image(centre image) is scrolled towards the left of the screen , then the second image(next image) occupies the centre of the screen.
My requirement is that for the very first time , the first image should be displayed 20 dip from the left margin. I'll keep some spacing (60 dip) between the first & the second image.
I wanted to know , whether this is possible or not.
Kindly provide your inputs/sample code.
Thanks in advance.
Warm Regards,
CB
If you don't want the Gallery to automatically move any Item to center after some user input, you should use an ScrollView, add your ImageViews there.
You can do that by placing your Gallery with 60dip padding or by overriding the Adapter from Gallery and return ImageViews with your own padding.

What is the best view for a displaying an images in android?

I'm designing an app that splits an image into a 3 x 3 grid. What is the best way to display this image.
Also, How can I move this piece from one point to another on the view.
Thanks.
Use an ImageView? I don't understand your second question. If you are talking about trying to show the 3x3 grid, use a GridView.
You can mess around with the ScaleType and image matrix to change what part of an image is displayed.

Categories

Resources