android - How to create two dimesions scrollable table(view) with oncliks -


i've spent day trying make this. need create large table horizontal , vertical scrolling. each cell of table should clickable.

to make clear picture of trying achieve. scrollable area on center, empty cells , cells numbers should clickable.

what trying achieve

i've tried different approaches, end failed:

  1. gridview:- problem: gridview elements clickable , scrollable, scroll vertical.
  2. horizontalscrollview placed in verticalscrollview, while linearlayout, represents table row, placed in horizontalscrollview. , program built table adds new linearlayouts row row. scrolling implemented manually in parent layout setting coordinates scroll views in touchevent. i'm using custom scrollviews return false in ontouchevent set coordinates in parent. scrolling works fine, when attach onclickevent cell(textview), breaks. clicking works, scrolling doesn't. i've tried different modifications (onintercepttouchevent) of approach, best result scroll causing click after scrolling.

also table header should fixed vertically. first , last column should fixed horizontally. wonder how google made in google docs app. table scrollable , clickable.

i found working solutuion. instead of ontouchevent use onscrollchanged , onhorizontalscrollchanged manual scroll. approach clicking works fine doesn't work diagonal scroll, because event parameter x 0 in onscrollchanged(and opposite in onhorizontalscrollchanged).


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -