Android Vertical Listview with horizontal scrolling on top -


i have android app in have multiple "categories" each items associated it. online electronics shop instance have categories such computers, printers, cameras etc. categories , each of have items in them.

these categories should displayed "tabs" in top of screen can select tab show items associated it. works fine want able change category sliding left or right on screen well. image of single tab selected (the first)

as can see on image first tab selected. need when user swipes right, tab 2 selected instead , items in listview changed of course of category 2 (tab2). items (independent of category) have same design why use 1 listview. of problems have faced are:

  • i don't know beginning how many tabs there going have created @ runtime.

  • i can't create swipe listener on each item user not able swipe if items don't fill screen (as in example below there 4 items , empty area below have no listener) seems coul performance heavy maybe ?

  • adding swipe listener on entire view containing list kind of works except view intercepts gestures including clicks means user not able click single item required.

  • i thought using viewpager have never used 1 before , don't know if overkill need "one" view different data depending on tab choice.

hope can help.

you're on right track viewpager, correct functionality top, should use library jake wharton.

https://github.com/jakewharton/viewpagerindicator

you can set top elements, , pager correspond proper fragment in adapted callback.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -