Android - What's the best way to create a Slideshow? - android

What is the best way to create a slideshow in Android?
Basically, what I need is to slide through a collection of LinearLayout or RelativeLayout objects, that contains inside them different views, ex: an ImageView and a TextView overlayed on that image.
On the bottom of the screen, should be some bulled points that will keep track of the currently element in the gallery.
To give an idea take a look at this jQuery implementation: http://slidesjs.com/
(I don't need the "left"/"right" controls, and the bulled points also dont need to be clickable, as in example)
Also, the slideshow should be in a cycle.

Maybe not the best, but I used a Gallery.

Related

Putting a button on top of an imageView

So here is my problem. I've spent couple of days on this and didn't get anywhere. I've tried every layout possible, but it just doesn't seem to work.
Basically, I have a map of a floor and I want to make it so when you click on different parts of that floor, a new activity or a dialog box shows up. I want this to scale for all the devices. Why is this so difficult in Android? I would think that putting buttons on top of an image would be easy and made sure that it wouldn't move like in HTML.
I have been looking into Surface View, but wasn't sure if that's the best way to go? I can get the coordinates of the objects on the floor, would that help?
I want to implement this inside of an fragment. Thanks!
One possible solution could be to have a RelativeLayout as the base layout of your 'Floor Map' fragment, with the floor image set as its background.
Then you could add buttons or any other views to the Relativelayout at the coordinates of the objects.
If you already know how many features the floor will have, you could add the buttons statically, otherwise, loop through your array of features to add them dynamically.

How to use Android HorizontalScrollView to move image one by one

I want to create an image slider using the HorizontalScrollView. Indeed, the slider will display one image at the time and I want to be able to use the fling gesture to navigate left and right in the slider.
Any Idea to which methods to override in the HorizontalScrollView to achieve this.
Thanks a lot.
Best
You could use Gallery with Image Switcher view to achieve this
This Link is usefull to you for better way to implement Android HorizontalScrollView to move image one by one.
Link :http://saigeethamn.blogspot.in/2010/05/image-switcher-view-android-developer.html
video: http://www.youtube.com/watch?v=c6a6wTfSPJA
EDIT :
If you want to implement Complex way refer this Links
Link1
Link2
You'd be better served implementing this with a Gallery widget or a ViewPager. These elements handle the display and interaction portion for you; you just have to provide the data behind that. If these don't quite work for you, better to customize one of them then start all the way from scratch.
Gallery Docs
ViewPager Docs
You can use any of below things for your need
Gallery - A view that shows items in a center-locked, horizontally scrolling list.
ViewPager -Layout manager that allows the user to flip left and right through pages of data. You supply an implementation of a PagerAdapter to generate the pages that the view
shows.
HorizontalScrollView -Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display
for reference see these links - Gallery , ViewPager and HorizontalScrollView

How many views are required as I have a view showing drawing required, do I still need surfaceview

I have already created a circle with the use of a View and have not used SurfaceView at all. I want to create buttons which when clicked on show images from the drawables. But I have read on the net that a SurfaceView is required to allow UI elements to be placed on top. Is this true, can someone please help me, as I am confused on this.
Thanks.
It's not very clear what you want to do, but if you want to place UI elements on top of each other without using SurfaceView you can you a RelativeLayout, this layout allows you to have views on top of each other, do you can have an ImageView with a drawable appearing over a button for example.
If you just want to change the background/src images of a button when clicked (for example to create a 3d effect of clicking), you can check out selectors, these allows you to specify different drawables for pressed/normal states.
If you want to create buttons on a SurfaceView, I suggest you render Bitmaps that will represent buttons. You will have to programmatically check if the touch coordinates are in the bounds of that bitmap tough, to register a button click.
I hope this helps.

Android Animation of TextViews

I basically have 5 text views that fill in one on top of the other. Rather then just all showing up like they do now, I want them to all come in with some animation, one after the other. Anyone have a link to a tutorial on how to animate TextView objects? only one I saw in the android docs involved using images as well as needing an image in the background.
Animating a TextView is basically like animating any other view. If you want it to show up one after one, you can implement an AnimationListener and start the corresponding TextView when the previous has finished.

Scrolling multiple images in android

I´m writing an application for Android in which I have a character that I must dress with multiple items, such as clothes, hairs, hats, earrings, etc. and on one side of the screen I need to have a container with many items inside that are available for use.
My problem is that I haven´t found any object that lets me do this simple task in android, I need it to be scrollable, and resizeable so I can place it on the right of the screen, the objects i need to add are Imageviews.
I accomplished this on iPhone with a UIScrollView but it seems that it't not that simple with Android.
Thank you.
you will use a ScrollView too, but you need embed a container of your images, like a Layout or Webview inside your ScrollView.

Categories

Resources