I want to create simple application like android image gallery but I don't want to display images. I want to display an editTexts and buttons...
My idea is to use android.widget.Gallery. Is it good way to solve this?
My next idea is HorizontalScrollView but here is problems with snaps etc.
Yes, you could do this with Gallery, make an Adapter that returns your layout that contains the EditText and Buttons.
However, you should check out ViewPager
Related
I need to make a layout similar to that Image.
I wish it were shown all the registered images and their attributes and a button to add the user would select an image and define the attributes of it. I do not want a complete example that ordered but at least one direction than I use to do the layout. By my research I should perhaps use a swipe view. Has anyone seen something similar?
Thank you
You can use ViewPager to display cards like in top part.
ViewPager with previous and next page boundaries
And use a ListView or RecyclerView to show the bottom part. https://code.tutsplus.com/tutorials/getting-started-with-recyclerview-and-cardview-on-android--cms-23465
I'm trying to implement my ownt picrutes gallary app. I'm using ImageSwitche for showing big image and Gallery for showing thumbnails. The problem is that when user scrolls gallery it changes selection to thumbnain whic is in the middle of gallery but required behaviour is just scroll like ListView and change image when user tap on thumbnail.
Does anybody have suggestion how to implement such behaviour.
PS. HorizontalScrollView with LinearLayout inside is bad idea becaus of it does not recycle views and holds all the pictures of thumbnails in the memory.
Take a look at the solution I have for my own question here
Basically I ended up with slightly modified version of ViewPager to display N-number of pages instead of just one. The only thing that I don't like about that that you will not have velocity-based scrolling as in ListView
The thing is, I want to avoid the extra space that normally Gallery view is displaying at the end of the Gallery; like in (Figure 1)
I need to adjust it like Figure 2
How can I achieve that with out using HorizontalListView describe in here or extending Gallery.
Thank you :-)
I am extending Gallery class & displaying scrollable images in a horizontal manner.
I am displaying only on the landscape mode.
For displaying the images , I am using BaseAdapter , since I need to place text & icon over the images.
I am displaying the no of images based on a condition which is set.
I want to put the following conditions.
i> If the no of image to be displayed is 1 , I'll only show a single image on the middle of the screen & there should not be any scrolling.
ii> If the no of images to be displayed is 2 , then both the images should be shown side by side(horizontal) & without any scrolling.
iii> Only if the no of images is equal to or greater than 3 , then images should be displayed in the horizontal manner & scrollable.
How can I handle all the above cases using a single layout xml & by handling the conditions source code.
Kindly provide me your inputs/sample code.
Thanks in advance.
Warm Regards,
CB
well for showing the text and the image you will need to create a custom adapter override the getView method and a custom layout (a linear layout with vertical orientation containing a textView and an ImageView) inside the getView. You can find a lot of examples of doing that on google, its pretty simple.(there is the gallery example on the android developers page that explains this). Hello Gallery
For your conditions you can probably make something like this in the adapter constructor or the actual creation of the adapter in the activity. i think by default it wont be scrollable for 1 item, but for 2 it will be since the gallery centers the selected item... which is pretty lame. and for 3 or more it will work as intended (show a scrollable horizontal list of items).
Hope this helps.
I am developing an Android application which involves splash screen.
There is a screen containing four Buttons and four Tabs. Now U am facing a problem when I have to show an image in a list.
Can anyone help me in this regard.
This is quite simple. In your adapter in the getView Method, you can return an Image or any other view.
See also this tutorial
http://www.androidpeople.com/android-custom-listview-tutorial-example/