Reputation: 5684
I want to develop an app based on the image in which thumbnails can move from top to bottom and left to right simultaneously.
please refer the image where gray parts are the thumbnails. I want to know from where i can start
Looking for the help
Upvotes: 0
Views: 496
Reputation: 2679
I think that you do not need to handle the scroll of both the views, but just move the items from one view to another. The below snippet moves children from the horizontal scroll view to the vertical scroll view.
int[] xy = new int[2];
// horizontalComponents contains all the children of the
// horizontal scroll view, this statement reads the location
// of the ith child of the view.
horizontalComponents[i].getLocationInWindow(xy);
// Check for some limit of the x-coordinate
if (xy[0] < 58) {
// Linear layout in horizontal scroll view &
// vertical scroll view respectively
hrzChild.removeView(horizontalComponents[i]);
vertChild.addView(horizontalComponents[i]);
hrzScroll.fullScroll(HorizontalScrollView.FOCUS_LEFT);
vertScroll.scrollTo(0, 0);
}
I've put this snippet in the onScroll method of a gesture listener of the horizontal scroll view.
I hope it helps..
Upvotes: 2
Reputation: 145
by customizing android gallery widget, drawing thumbnail in L shape was to some extent achieved but when fling or scroll operation is used, vertical thumbnails also move off the screen and then are refreshed.
I think this is because scroll operation is applied on the complete view group. Kindly suggest if scroll or fling operation can be modified so that horizontal thumbnails move towards left and vertical thumbnails move towards up.
How about the idea of creating horizontal and vertical scroll view, does it have some memory issues or performance issues when no. of images increase.
Upvotes: 0
Reputation: 1932
you have to create a verical scroolView and horizontal scrollView in one layout for that you have to add images in that scrollView by creating a custom View that append one by one from top to bottom
Upvotes: 0