Surely it is not spending 91% of its time just in that function.  Have you
dug down into the functions it calls from within itself?

On Tue, Mar 31, 2009 at 10:16 AM, AlCapwn <[email protected]> wrote:

>
> On Mar 30, 11:13 pm, Romain Guy <[email protected]> wrote:
> > Well if your profiling shows 91% of the time spent in the
> > GestureDectory, then you are probably doing something wrong.
>
> As far as I know, GestureDetector#onTouchEvent is something that
> should be called from the touch listener to make it check the
> motionevent for any matching methods we have implemented and then
> calls these methods (onFling(), onScroll(), etc). I'm not doing any
> work inside onTouchEvent but only doing work when onFling or onScroll
> are called. So inside my onTouchListener I have: return
> myGestureDetector.onTouchEvent(event).
>
> > > I don't do anything related to scrolling except for make it scrolldown
> > > (scrollTo(x,y)) and detecting if Im trying to scroll up and set a
> > > boolean which says dont make it scroll.
> >
> > Why do you call scrollTo() since ScrollView already handles that?
> >
> >
> >
> >
> >
> > > On Mar 30, 10:45 pm, Romain Guy <[email protected]> wrote:
> > >> Why are you using your own fling mechanism with GestureDetector?
> > >> ScrollView already handles all of that.
> >
> > >> On Mon, Mar 30, 2009 at 2:18 PM, AlCapwn <[email protected]>
> wrote:
> >
> > >> > On Mar 30, 9:40 pm, Romain Guy <[email protected]> wrote:
> > >> >> How is your scrolling implemented exactly?
> >
> > >> > It just uses a ScrollView.
> >
> > >> >> What is the view hierarchy?
> > >> > ViewFlipper with children which have this layout:
> >
> > >> > RelativeLayout
> > >> >    -> Image Button
> > >> >    -> ImageButton
> > >> >    -> EditText
> > >> >    -> LinearLayout (used only for a context menu, not visible or
> > >> > focusable)
> > >> >    -> Scrollview
> > >> >        -> TextView
> >
> > >> > The same onTouch and gesture listeners are used by the scrollview
> (for
> > >> > trying to detect when to not autoscroll) and the textview (for fling
> > >> > gestures). I've tried using only 1 view for this, but it didn't
> work.
> > >> > Removing the listeners have no effect on the scrolling it seems. The
> > >> > listeners themselves do nothing overly special, just try to detect a
> > >> > gesture using the motion events and check if scrolling should be
> > >> > stopped.
> >
> > >> >> Have you tried profiling?
> >
> > >> > Plenty of times. The trace shows 91% if spent in
> > >> > GestureDetector#onTouchEvent and the rest in some small computations
> I
> > >> > do.
> >
> > >> > I've also tried removing some text from the textview occasionally
> and
> > >> > it helps but I dont see why the scrolling would be that badly
> affected
> > >> > with 400 lines of text.
> >
> > >> > Thanks.
> >
> > >> >> On Mon, Mar 30, 2009 at 1:39 PM, Al <[email protected]>
> wrote:
> >
> > >> >> > Currently, attempting to scroll when the textview has large
> amount of
> > >> >> > text makes the app completely unresponsive. It doesnt ANR, but it
> > >> >> > doesn't respond either. I've tried occasionally removing some
> text
> > >> >> > from the textview and removing some spans also, but it doesnt
> seem to
> > >> >> > help much. Any idea how to improve scrolling? It takes ages to
> scroll
> > >> >> > up or down. I also tried throttling touch events but it hasnt
> helped
> > >> >> > either.
> >
> > >> >> --
> > >> >> Romain Guy
> > >> >> Android framework engineer
> > >> >> [email protected]
> >
> > >> >> Note: please don't send private questions to me, as I don't have
> time
> > >> >> to provide private support.  All such questions should be posted on
> > >> >> public forums, where I and others can see and answer them
> >
> > >> --
> > >> Romain Guy
> > >> Android framework engineer
> > >> [email protected]
> >
> > >> Note: please don't send private questions to me, as I don't have time
> > >> to provide private support.  All such questions should be posted on
> > >> public forums, where I and others can see and answer them
> >
> > --
> > Romain Guy
> > Android framework engineer
> > [email protected]
> >
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support.  All such questions should be posted on
> > public forums, where I and others can see and answer them
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to