Is it possible to "mask" an animation (i.e., animate only within the bounds of another view)?

by Andrew Dupont » Fri, 19 Sep 2008 03:01:46 GMT


Sponsored Links
 I've got an animation that pushes an item in from the right side of
the screen. Right now, it animates so that you start to see the item
as soon as it enters the viewport; I want it to be invisible until
it's within the bounds of its view parent.

The parent has setClipChildren(true), but that doesn't seem to apply
to animations.

Cheers,
Andrew Dupont
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. AudioTrack.write blocks in multi-threaded app

I would really appreciate some advice on using AudioTrack.  I need to
be able to play a number of audio signals on demand, potentially mixed
together.

I have no problem setting AudioTrack up and writing an audio buffer to
it (originally captured by another Android device's AudioRecord and
received via network). However, when I try to put AudioTrack in its
own Runnable class, I run into problems. My current implementation
instantiates the AudioTrack in the constructor and, to keep things
simple, the run() function is a while loop that checks a Buffer queue
(modified version of http://www.siafoo.net/snippet/216 to use short
instead of byte) and writes anything over 100 bytes to AudioTrack. The
buffer queue fills fine, but as soon as I try to write it, the
AudioTrack blocks.

I am really not sure what relevant code to post, but here is a version
of my AudioTrack Runnable code with the irrelevant code missing:

public class SoundIn implements Runnable{

        BufferQueue m_queue = null;

        // Audio track to output audio on phone
        AudioTrack m_audioTrack = null;

        // Buffer size required to support AudioTrack
        int m_BufferSize;

        short[] m_outbuf;

        public SoundIn(BufferQueue queue)
        {
                m_queue = queue;

                // Get minimum supported buffer size
                m_BufferSize = AudioTrack.getMinBufferSize(11025,
                                AudioFormat.CHANNEL_CONFIGURATION_MONO,
                                AudioFormat.ENCODING_PCM_16BIT);

                // Initialize a streaming audio track with minimum-size buffer
                m_audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 11025,
                                AudioFormat.CHANNEL_CONFIGURATION_MONO,
                                AudioFormat.ENCODING_PCM_16BIT, m_BufferSize,
                                AudioTrack.MODE_STREAM);

                m_audioTrack.play();

        }

        public void run()
        {
                int minsize;
                m_outbuf = new short[50000];
                while(true)
                {
                        minsize = //...Get available data size

                        if (minsize == 0)
                        {
                                Log.d("SoundIn", "Sleeping...");
                                try{Thread.sleep(100);}
                                catch (Exception e){e.printStackTrace();}
                                continue;
                        }

                        //read available bytes from queue
                        m_queue().read(m_outbuf, 0, minsize);

                        //Gets here with m_outbuf correctly holding data
                        m_audioTrack.write(m_outbuf,0,minsize);
                        //Never gets here
                }
        }

}

Any suggestions on why the AudioTrack.write call might block in a
situation like this would be greatly appreciated.

-- 

2. [WTB] HTC Evo 4G

dear droider,
saya noob baru saja join, ini post pertama saya.

saat ini belum punya android dan tertarik sama HTC Evo 4G (CDMA)
adakah di antara rekan yang menjualnya?
dan bisa COD Semarang / Yogya / Solo?

terima kasih

--

-- 
===============
"

3. paging droidx and darksliide use.r ...

4. [WTI] Vodafone 845, Ponsel Android Senilai Rp 800 Ribu-an

5. Android 2.3 SDK Emulator is very slow

6. 15 minute refund did not work

7. Does SoftReference calls .recyle() on a Bitmap ?