filmov
tv
Android floating action button animations
Показать описание
In this tutorial you will learn how to create android floating action button with animations. Basically when you click on floating action button it will show up another floating action buttons (menu) with text label next to each button.
Here is how to do it:
- Add 2 android floating action button, one is used to make a call to a number and the other one is used to send sms message
- Set an icon for the buttons like this:
- Add 2 LinearLayout with horizontal orientation, each of these LinearLayout will hold 1 floating action button and textview label
android:visibility="gone"
- Do setOnClickListener for main floating action button, inside the onClick method is where we are going to handle the visibility of the 2 LinearLayout that we've just created
- Do setOnClickListener for call & sms floating action button
- Now will create Android resource directory and name it (anim) and set it's resource type as (anim) as well
- Next will create 4 animation files: first 2 files will handle rotate animation for the android floating action button icon and the other 2 files are used for moving the floating action button animation
- That's it!!
- You may refer to this website for Google material design icons:
Social media:
Here is how to do it:
- Add 2 android floating action button, one is used to make a call to a number and the other one is used to send sms message
- Set an icon for the buttons like this:
- Add 2 LinearLayout with horizontal orientation, each of these LinearLayout will hold 1 floating action button and textview label
android:visibility="gone"
- Do setOnClickListener for main floating action button, inside the onClick method is where we are going to handle the visibility of the 2 LinearLayout that we've just created
- Do setOnClickListener for call & sms floating action button
- Now will create Android resource directory and name it (anim) and set it's resource type as (anim) as well
- Next will create 4 animation files: first 2 files will handle rotate animation for the android floating action button icon and the other 2 files are used for moving the floating action button animation
- That's it!!
- You may refer to this website for Google material design icons:
Social media:
Комментарии