Example on the use of TouchDelegate?

by Mariano Kamp » Mon, 09 Mar 2009 02:45:19 GMT


Sponsored Links
 Hi,

  is there anybody who used a TouchDelegate[1] and care to share some sample
code?

  I can't make heads and tails of the documentation. If there is no sample
code it would be great if someone could shed some light on the "actors" and
which one implements what for a simple sample, like one button should get a
bigger touch area in a layout?

Cheers,
Mariano

[1]  http://developer.android.com/reference/android/view/TouchDelegate.html 

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Unexpected behavior with animated views / layouts

I am using a button to trigger an animation of a view. This button
toggles the view, such that the view slides on and off the screen...

Class Members:

     final Animation animout = AnimationUtils.loadAnimation(this,
R.anim.slideout );
     final Animation animin = AnimationUtils.loadAnimation(this,
R.anim.slidein );

Click handler for the button:

         public void onClick(View v)
         {
            View sv = findViewById(R.id.SV);
            if(mDialIsIn)
            {
               sv.clearAnimation();
               sv.startAnimation(animout);
               mDialIsIn = false;
            }
            else
            {
               sv.clearAnimation();
               sv.startAnimation(animin);
               mDialIsIn = true;
            }

         }

So... it works... but...

This view that is moving around has a handler for the touch event. The
strange thing is... when my view is off screen, it is still getting
touch events for its "original" position on screen. It seems the
animation is only moving the visual aspect of the view (drawing
surface) and not the rest of the view's "guts".

Does this make sense?

Do I just need to manually turn off my handling of the touch event
while the view is animated off screen?

And...

My intention was to put other controls UNDER this view. If this view
is "on top" receiving touch events even when off screen, will controls
underneath get their events? Or... do I have to do something about the
Z order when the view is scrolled off screen?

Am I just going about this all wrong?

Thanks,
Buzz

-- 

2. Streaming data from file to audio mixer

Hi all,

In Java SDK there are classes that allow to read audio file content as
byte array (for instance AudioInputStream) and also write byte array
to audio system (SourceDataLine), so between reading and writing
operations I can change and analyse data, especially change. I was
wondering if android SDK provides the same functionality? Could you
point me to documentation or tutorials?

So basically, what I need is to read audio file chunks as byte arrays
(because file can be quite big), write directly to audio line or at
least as fast as it possible send data to audio mixer to avoid
lagging.

I guess AudioTrack class allows to write data to audio line, however I
still cannot find an easy way to stream data from audio file.

-- 

3. How to manage creating own thumbnails on Android 1.6?

4. Fwd: FW: Employee Referral invited for ( PL/SQL Developer's) Saturday's walk-in 05 March 2011

5. [WTS] Motorola Milestone 2, Motorola XT720, HTC Desire HD BNIB

6. One app, multiple APKs targeting different SDK levels would be good for adding Honeycomb functionality

7. tanya ketahanan gorilla glass nya GTAB?