The Android Development Tutorials blog contains Basic as well as Advanced android tutorials.Go to Android Development Tutorials to get list of all Android Tutorials.
How To Animate a Button
We need a xml file that will define the Animation.
Create a folder named "anim" in res folder
Create a xml file named vanish.xml, in this file we will define our Animation.
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale android:duration="300" // duration in miliseconds
android:fromXScale="1.0" // X scaling to start from
android:fromYScale="1.0" // Y scaling to start from
android:toXScale="1.5"
android:toYScale="1.5"
android:pivotX="40%"
android:pivotY="40%"
android:interpolator="@android:anim/decelerate_interpolator"/>
<alpha android:duration="300"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"/>
</set>
In your Activity class create the reference of the Button on which you want apply the animation.
Animation vanish =AnimationUtils.loadAnimation(this,R.anim.vanish);
findViewById(R.id.youButton).startAnimation(vanish).
You can change the following attributes acoording your requirement
android:duration="300"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="1.5"
android:toYScale="1.5"
android:pivotX="40%"
android:pivotY="40%"
How To Animate a Button
We need a xml file that will define the Animation.
Create a folder named "anim" in res folder
Create a xml file named vanish.xml, in this file we will define our Animation.
vanish.xml
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale android:duration="300" // duration in miliseconds
android:fromXScale="1.0" // X scaling to start from
android:fromYScale="1.0" // Y scaling to start from
android:toXScale="1.5"
android:toYScale="1.5"
android:pivotX="40%"
android:pivotY="40%"
android:interpolator="@android:anim/decelerate_interpolator"/>
<alpha android:duration="300"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"/>
</set>
In your Activity class create the reference of the Button on which you want apply the animation.
Animation vanish =AnimationUtils.loadAnimation(this,R.anim.vanish);
findViewById(R.id.youButton).startAnimation(vanish).
You can change the following attributes acoording your requirement
android:duration="300"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:toXScale="1.5"
android:toYScale="1.5"
android:pivotX="40%"
android:pivotY="40%"
Android Animation Examples:
Animating ImageViews
Layout Animations
Sliding Between Screen Using ViewFlipperMore Android Topics
New Advance Topics:Android ImageSwitcher Android TextSwitcher Android ViewFlipper
Android Gesture Detector Handling/Detecting Swap Events Gradient Drawable
Detecting Missed Calls Hide Title Bar GridView Animation
Beginning With Android
Android : Introduction Configuring Eclipse for Android Development
Creating Your First Android Project Understanding Android Manifest File of your android app
Advance Android Topics Customizing Android Views
Working With Layouts Working With Views
Understanding Layouts in Android Using Buttons and EditText in Android
Working with Linear Layout (With Example) Using CheckBoxes in Android
Nested Linear Layout (With Example) Using AutoCompleteTextView in Android Grid View
Relative Layout In Android ListView
Table Layout Android ProgressBar
Frame Layout(With Example) Customizing ProgressBar
Absolute Layout Customizing Radio Buttons
Grid Layout Customizing Checkboxes In Android
Android Components Dialogs In Android
Activity In Android Working With Alert Dialog
Activity Life Cycle Adding Radio Buttons In Dialog
Starting Activity For Result Adding Check Boxes In Dialog
Sending Data from One Activity to Other in Android Creating Customized Dialogs in Android
Returning Result from Activity Creating Dialog To Collect User Input
Android : Service DatePicker and TimePickerDialog
BroadcastReceiver Using TimePickerDialog and DatePickerDialog In android
Menus In Android ListView:
Creating Option Menu Populating ListView With DataBase
Creating Context Menu In Android Populating ListView with ArrayList
ListView with Custom Adapter
Toast Working With SMS
Customizing Toast In Android How to Send SMS in Android
Customizing the Display Time of Toast How To Receive SMS
Customizing Toast At Runtime Accessing Inbox In Android
Adding Image in Toast
Showing Toast for Longer Time
TelephonyManager Storage: Storing Data In Android
Using Telephony Manager In Android SharedPreferences In Android
Reading and Writing files to Internal Stoarage
Working With Incoming Calls DataBase
How To Handle Incoming Calls in Android Working With Database in Android
How to Forward an Incoming Call In Android Creating Table In Android
CALL States In Android Inserting, Deleting and Updating Records In Table in Android
Miscellaneous
Notifications In Android
How To Vibrate The Android Phone
Sending Email In Android
Opening a webpage In Browser
How to Access PhoneBook In Android
Prompt User Input with an AlertDialog
Thanks AAREN
ReplyDeletethanks a lot ! well done !
ReplyDeletesuperb yar..
ReplyDeleteTY !!!
ReplyDeletei want to create 3d live wallpaper in which there is day and night detector,talking digital clock and also talking battery warning,can anyone help me its my project?i am new to developing
ReplyDeletegreat :)
ReplyDeleteit is very helpful ,we can save our course fee by doing it .great site.
v use full
ReplyDeleteit was very informative information for me, thanks for post.
ReplyDeleteawesome post...
ReplyDeleteIts very informative. I was searching it from some time.
ReplyDelete[url=http://webdesignandappdevelopment.com/] Professional web design company[/url]
good information. Thanks for such post
ReplyDeleteThanks it enhanced my knowledge.
ReplyDeleteyou always write informative notes.
ReplyDeletevery nice information thanks.
ReplyDeletevery nice information thanks for the post.
ReplyDeleteI like your post thanks for the information.
ReplyDeleteyou write a nice information thanks.
ReplyDeleteDrawing a toon me face of somebody is still my greatest test following quite a while of preparing and a few workmanship classes. I now and again get baffled drawing someones eyes since they are the most hard to draw and can take hours of practice. Check This Out
ReplyDelete"Bharat Go Digital gives you a lot of information on Startup India Essay,
ReplyDeleteand Make in India Essay, Digital India Essay"
Good post... Thanks for sharing the information.
ReplyDeleteMobile game development company, Android game development company
Enjoyed reading the article above , really explains everything in detail,the article is very interesting and effective. Thank you and good luck for the upcoming articles...For more please visit: Android App Development USA
ReplyDeleteAivivu đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ giá rẻ
vé máy bay từ mỹ về việt nam hãng eva
khi nào có chuyến bay từ nhật về việt nam
bao giờ có chuyến bay từ đức về việt nam
vé máy bay từ canada về việt nam giá rẻ
vé máy bay incheon hà nội
khách sạn cách ly ở hà nội
Chuyen bay cho chuyen gia nuoc ngoai