I agree with your choice... If you only need smooth scrolling the easiest way is to simulate that touch event - feed dispatchTouchEvent with your MotionEvents as you do. But the challenge here is to compute right scroll positions. Hope you will archive that! Good luck
Pavel On Apr 27, 9:24 pm, Moto <medicalsou...@gmail.com> wrote: > Hi Pavel, > > Thanks for your reply! I agree with some of the information you > provided. > > So it seems ListView is keeping track of the list state. To name a > few; scroll position, visible items, user input. > > I guess the main idea here is in order to create a completely custom > ListView we need to handle displaying the list items as the user > scrolls. But to me that seems like too much work, almost re-inventing > the wheel. > > My main concern is get and set scroll position smoothly... Thanks to > your post I got a little idea to compute scroll position but not sure > about setting the scroll position. I am able to scroll smoothly via > dispatchTouchEven(...) but it's not accurate, might scroll little too > much and sometimes not enough... I got some code for that I can get > if you want to see that... > > -Moto > > On Apr 27, 3:14 am, Pal <pavel.khlusti...@gmail.com> wrote: > > > > > > > Hi Moto, > > > at this moment I'm working on my own custom ListView implementation so > > I can share some investigations I've found about ListView internals. > > 1) First of all ListView is adapter view that means that it uses > > adapter object to get it's child views - take a look at > > ArrayAdapter.getView(int, View, ViewGroup) > > 2) ListView at the moment only contains children that are on the > > screen. For example, if you have adapter with 100 records but only 5 > > are fit on screen ListView.getChildCount will return 5 not 100 > > 3) each time you scroll your list it refresh dynamically its children > > list getting child view from adapter and/or relayouting existing views > > offsets > > > I dont have best understanding now but I think ListView state is : 1) > > first position of child view of screen 2) offset of child view within > > parent view > > if you know first position and it offset you can simply get from > > adapter and draw other ones > > > android.widget.AdapterView.getFirstVisiblePosition() will give you a > > position of first item within adapter data on the screen > > use getChildCount() and getChildAt() of ListView to get current child > > views so you can obtain some layout details > > ListView.setSelection(int) allows you to sets the currently selected > > item but I think It will not scroll smoothly to it... > > > Hope this will help you > > > Thanks, > > Pavel > > > On 27 апр, 03:05, Moto <medicalsou...@gmail.com> wrote: > > > > I hope someone can shed some light? :( > > > > On Apr 25, 9:37 pm, Moto <medicalsou...@gmail.com> wrote: > > > > > I'm trying to figure out how it's been designed. How it holds its > > > > items? How do I get a hold of the scrolling container? How can I > > > > know it's exact scrolling position? How can I scroll it to an exact > > > > position? > > > > > I want to have all the current benefits the ListView provides plus > > > > detailed scrolling control... How about animating from x to x+100 > > > > scroll position? > > > > > Maybe I need to create my own ListView? Where do I begin? > > > > > Thanks for the help! > > > > -Moto! > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to android-developers@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > android-developers+unsubscr...@googlegroups.com > > > > For more options, visit this group > > > > athttp://groups.google.com/group/android-developers?hl=en > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to android-developers@googlegroups.com > > > To unsubscribe from this group, send email to > > > android-developers+unsubscr...@googlegroups.com > > > For more options, visit this group > > > athttp://groups.google.com/group/android-developers?hl=en > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en