Add animation to buttons in android - android

So this is the main activity of my app:
As u can see, there are 6 buttons.
I thought about the idea of setting the animation of them to be like when a bubble pops up...i mean whenever the main activity shows up i want the button to "bubble up"+ i don't want them to bubble up all together, i want a Interval of approximately half a second between each button.
Another animation i would like to add is the rounding animation, in which, whenever i press a button, it firstly spinning and then i do some actions...
Hopefully guys you understand my willings, i would be glad for any help :)

u can see android api demo where some example given for button animation
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0CCgQFjAB&url=https%3A%2F%2Fgithub.com%2Fgoogledrive%2Fandroid-demos&ei=OL70VKn6PJSpuwTsvoLQDw&usg=AFQjCNEkkqFYd6xmuOzqdv-eXhKitC_o-w&sig2=fUuJK2OQpgLIF6qZCWOY5g&bvm=bv.87269000,d.c2E

Related

How to build a random button picker with the blocks in app inventor 2?

I am a beginner and I don’t have any experience with coding etc. and I need help
The first screenshot:
shows my screen, and as you can depict from it there are two buttons- the first one is called RIGHT BUTTON, and the other one is called WRONG BUTTON. This is because clicking on the RIGHT BUTTON will open a next screen, whereas clicking on the WRONG BUTTON will result in going back to the previous screen. I thought that this is kind of boring :D that’s why I want to build something with the blocks that would choose randomly one of those buttons to be right and the other one to be wrong after the screen has initialized. To make it more clear. Every time I start the app I don’t know which button out of those two will take me one screen further- it could be the first or the second button- I want this to be a random pick.
Now, I have tried to build something like this blocks:
but I can’t find a suitable block, as you can see in screen shot 2 :D I assume, that this isn’t the way it should look like, but my skill is too low at the moment. I also assume that I will need an "if,then" block" I would be really grateful if someone built it and made a screenshot and post it here ;)
Basically, I am kindly asking for help. I have been looking on the internet for a tutorial etc. but I couldn’t find something that would really help me.
Thank you very much in advance ;)
When the button is pressed, instead of opening the next/prev screen, instead call a custom procedure and have that procedure decide if it was the right button to press or not. This can be done several ways, for instance with the Math.randomInteger block. You don't actually have to decide if it was the right button or not before the button is pressed, just do a "coin flip" at the time of the button press to decide (at least that's what it sounds like you wanted from your description).
Also note that the number of screens in AI is highly limited, and instead of going to another screen, you can just reuse the same buttons over and over (and maybe just show a label in the corner counting how far you've come), or make lots of buttons and only have the first two visible at the start, then as you progress hide/unhide the correct buttons.
Here this is the answer I have found for my problem using your info

How to change the way a new activity starts in android?

I don't like the look of how a new activity starts in android, the "fade in" and getting bigger untill it covers the screen.
Is there anyway to change the way?
Ideally, i want the activity just to appear all in one go
You can use the overridePendingTransition()method in Activity class to change the transition.Here are a good tutorial for this topic, the link.
But I should mention the point that animation can be disable in phone setting and in this situation your animation transition wont show.

Android: How to make sliding buttons like phone unlock button on screensaver?

I don't know how exactly this type of buttons is called that's why I can't even google about it.
You use that button to unlock phone - tap on it and move from left to right.
I'd like to add same button in my app. How to do it?
You should use SeekBar to achieve what you want. http://developer.android.com/reference/android/widget/SeekBar.html
Here is a good example
http://www.techrepublic.com/blog/app-builder/androids-seekbar-your-way/943
Try this for a library
https://github.com/sitepoint-editors/SwipeButtonExample
and this for a DIY
https://rightclicksolutions.wordpress.com/2014/04/09/android-slide-to-unlock-like-ios-mb-slider-slider/
You can overide onTouch() and change the location of the button acording to the x position. and when you lift the finger you can overide onUp() (im not sure thats the name of the method) and create an animation that will lead the button back to its place.
From your question I get that you might think its a button you can simply add from a list of buttons, well, its not. you need to manualy create it.

Theme.Translucent then show image after click

I have completely lost my focus now.
I was trying to create a transparent background to show users phone screen like this.
https://market.android.com/details?id=net.kreci.crackedscreen&hl=en
Now i got it working. But i want to now add an image but it wont show till after the click.
Can this be done in Viewflipper with showing the activity Transclucent then showing image after the click? (cause i dont want the screen to flip to another activity, I want it to show straight away)
So technically if you don't understand what I meant.... Similar to the market link i added in this post.
I don't have knowledge regarding ViewFlipper class to implement in this situation,
But
I have one Idea to implement while creating two different activities to show 2 Images.
In onCreate of both activities write the below line right after super.onCreate()
getWindow().setWindowAnimations(0);
This will set Window Animation to 0 so your screen will be changed without any effects.

How to get iphone like animation for button in android

I saw one iphone application if the button is visible and we press cancel button then that button should gone. in that case there is animation "the button diposes from left to right and finally got vanished". In android i am able to rotate any view or move it from left to right. But how can i get the effect that the button destroy animation and make a button visible in that type of animation.
Thanks
Deepak
I'm not sure that I fully understand what you're trying to do, but it seems like you want to fade the button as well as translating it. If that's the case, then you can use alpha animations to change the opacity of the button. By gradually reducing the alpha to 0, the button will appear to fade away.
I have recently completed a series on animations on my blog. It is probably best to read the articles in order starting with the first, but the final article covers animating individual widgets.
To get a general idea of animations in android, check out this awesome page on quick actions. There is plenty of code and working animations with different options so you can get a full tutorial of how they work.
How to create quick action dialog

Categories

Resources