Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: are there any native/default animations available in android recource?

I'm still a starter in Android. And i just wanna set the fade_in fade_out animations with my Fragments.

and i read the android document, which shows that the R.animator.fade_in is available.

but in my Android Studio, when i typed in R.animator, it alerts that "cant resolve animator".

are there any native/default animations available in android recource?

like image 977
Demonbane Avatar asked Jan 18 '26 15:01

Demonbane


1 Answers

If you want to use any resources provided by Android you have to prefix it with "android" to specify from which package to load it like this "android.R.anim.fade_in".

If you want to see all of the resources provided by Android, go to the location where your Android Studio is installed(or just locate the sdk folder if you downloaded a separate sdk folder like for eclipse) open the "sdk" folder, then open the "platform" folder, tgen select any platform versions, go to "res" folder, you can check out all of the built-in resources provided by the platform, it is really great and helpful to you to see how a particular resource is created, for example, you can open the "anim" folder, locate the "fade_out.xml" resource file and see how it is constructed. Hope this helps you a little

like image 120
Biu Avatar answered Jan 20 '26 06:01

Biu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!