ImageSwitcher / Gallery with bullet point below the image - android

I am trying to put a ImageSwitcher and Gallery in my app, however, I want the gallery part just with some bullet points instead of the thumbnail of the original image.
Just for some more explanation to make it more clear.
Assume there are three image in my ImageSwitcher and there are three bullet point according to them.
When the first image is displayed, the first bullet point is colored while others are remain white. When the second image is displayed, the second bullet point is colored while other
are remain white...and so on.
I think that feature is quite common in many app or website, but I really don't know how to describe it with keywords. Hoping that someone can understand and give me a help.
Thank you in advance.

I think you should consider using ViewPager and ViewPagerIndicator instead of ImageSwitcher and Gallery widgets. Gallery was deprecated since API level 16.

You can use View pager and corresponding third party library for indicators as https://github.com/JakeWharton/Android-ViewPagerIndicator
library for view pager indicator and view pager http://developer.android.com/reference/android/support/v4/view/ViewPager.html.

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

how to keep an image on top of other image

can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.

Image Count Indicator in Android

I am displaying an image gallery consisting of 15 images with image displayed on the screen (full-screen) at a time. When the user swipes across, the image changes. I am looking at a small polka-dots style indicator at the center-bottom of the screen to show the image count and where the user currently is.
eg: If my gallery held 5 images and the user was currently on the 3rd image, then there would be 5 polka dots with 3rd dot highlighted/filled with color and the rest polka-dots be hollow.
I know the description might sound a little vague but in short, I am looking at an image count indicator! :)
Thanks!
You might check out this Android Count Indicator project: https://github.com/rupertbates/android-count-indicator
I know exactly what you want, you are looking for the PageControl that is used on iPhones with the Scroll Views. I have never seen anything like that for Android. You would have to build a custom view. It's explained here:
Building Custom Android Components
I finally found it in the Launcher code!

Display gallery elements as a circle

Hi I am using the gallery for displaying images. But the gallery has an end. I don't want this behaviour; I want to repeat the images again and again on both sides of the gallery. Is there a way to display the gallery elements as a circle?
I wrote a tutorial on how to create circular gallery.
Read it in my Blog Post here:
http://evgeni-shafran.blogspot.com/2011/08/tutorial-custom-gallery-circular-and.html
Here is what i did:
In the adapter i used, i made him think he have a really big element count.
and then each element position= position%element.lenght
and then i made the first position in the middle.
so what happen is this: (lets do it for 3 elements, you can have what ever amount you like later)
This is how the adapter see the elements:
1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3
now you tell him that the first element is in the middle:
1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,->1<-,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3
if you make it a really big number, the user can scroll a lot before getting to the end.
Hope it helped you.

Android - how do I place an image on top of my existing layout through code?

I have a layout in which I am displaying a webview. I want to add images on top of the webview at specific places through code.
Can some one please tell me how to do that?
The translucent background example in API Demos makes the view cover the whole screen. I want to place only a small image and at a specific location (origin not 0,0)
Thanks a lot.
Have you tried putting both the WebView and the ImageView inside an Absolute Layout? This should let you specify the X/Y location of your image and by ordering make it constantly drawn over the webview.
EDIT: check out the Absolute layout:
http://developer.android.com/guide/topics/ui/layout-objects.html#absolutelayout
AbsoluteLayout is deprecated and if that bothers you, you may want to look for alternative.
I have put an example in my blog post here. It might not be exactly what you are after, but should give you an idea:
http://anothermobiledeveloper.blogspot.com/2011/10/using-relativelayout-instead-of.html

Categories

Resources