Need to create Android toggle button in Iphone style

by Balraj Singh » Fri, 20 May 2011 09:34:08 GMT


Sponsored Links
 Hi,

I have a requirement to create a toggle button in Android but in
Iphone style something as shown in link below:-

 http://fc03.deviantart.net/fs71/f/2010/215/2/0/iPhone_Toggle_Button_by_mitchjinfo.png 

Can anyone tell me how to implement this or if provide the code for
this.

-- 



Other Threads

1. Starting out with animations, need some help

Hi all, I'm starting to add animation to my game, but I'm having some
problems
I'm attaching an excerpt of the code:
...
                                //get coordinates
                                int[] handLocation = {0,0};
                                
hand.getContainer().getLocationInWindow(handLocation);
                                int[] deckLocation = {0,0};
                                deckImg.getLocationInWindow(deckLocation);

                                //move from deck location to hand location
                                TranslateAnimation dealCardAnimation = new 
TranslateAnimation
(Animation.ABSOLUTE,deckLocation[0],
                                                
Animation.ABSOLUTE,handLocation[0],
                                                
Animation.ABSOLUTE,deckLocation[1],
                                                
Animation.ABSOLUTE,handLocation[1]);
                                dealCardAnimation.setDuration(400);
                                deckImg.startAnimation(dealCardAnimation);
                                //mina
...
I have a deck and 4 hands and I'm dealing cards to them.
I've added this to the deal cards loop
I'm guessing I have more than one mistake here since nothing is
happening on the screen in the entire loop.
I saw some other people have called a post() method on the underlying
layout but I didn't see where it says to do so.
can someone please help me with this?
Thanks,
Sh.
--~--~---------~--~----~------------~-------~--~----~

2. getRuntime().exec("su do seomthing") fails (exit code)

As of 1.5 applications can no longer use su.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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

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

3. A window does not automatiacally resize when an IME is shown

4. another AppWidget issue: can't start parent app, "process is bad"

5. File I/O and efficiency

6. Mimetypes and their associated icons

7. How to enforce the soft keyboard