I want to implement Horizontal ScrollView
with some features of Gallery,
In Gallery the scroll made at some distance it arrange in pair, i.e If we have three images shown in screen, clicking last image will arrange at center.
How would I implement HorizontalSCrollView
as mentioned?
I have created a horizontal ListView in every row of ListView if you want single You can do the following
Here I am just creating horizontalListView of Thumbnail of Videos Like this
The idea is just continuously add the ImageView to the child of LinearLayout in HorizontalscrollView
Note: remember to fire .removeAllViews(); before next time load other wise it will add duplicate child
My xml for HorizontalListView
and Also my Image View as each child
To learn More you can follow the following links which have some easy samples
Here is my layout:
And I populate it in the code with dynamic check-boxes.
I implemented something similar with Horizontal Variable ListView The only drawback is, it works only with Android 2.3 and later.
Using this library is as simple as implementing a ListView with a corresponding Adapter. The library also provides an example
Here is a good tutorial with code. Let me know if it works for you! This is also a good tutorial.
EDIT
In This example, all you need to do is add this line:
after setting the adapter to gallery object, that is this line:
UPDATE1
Alright, I got your problem. This open source library is your solution. I also have used it for one of my projects. Hope this will solve your problem finally.
UPDATE2:
I would suggest you to go through this tutorial. You might get idea. I think I got your problem, you want the horizontal scrollview with snap. Try to search with that keyword on google or out here, you might get your solution.
Try this code:
activity_main.xml
grid_item.xml
MainActivity.java
Let me know if any issue enjoy...
You may use HorizontalScrollView to implement Horizontal scrolling.
Code
featured.xml:
Java Code:
Note: to implement lazy loading, please use this link for AQUERY
https://code.google.com/p/android-query/wiki/ImageLoading