how do you implement custom animations?
I want to tell you nobody can come up with this stuff off the top of their head , if anybody claims that they can, they are lying to you unless you just finished implementing something that is entirely related to this question.
you're not going to be able to hit all the points
the first thing you feel is a deep sinking feeling in your heart, you're not sure what do they want me to say to describe the whole process to describe how I Implement them
let's find out what is required here.
first of all, show the classes' name you're going to use. Android provides several classes, there's the value animator object, animator and AnimatorSet.
you don't really need to go into them, just mention that you know them that's amazing.
but it's not amazing enough if you just stop right there, you're going to say you need to choose the right class for the right job you need to know what you need.
like I want to animate the position of an object, the size, the color.
these are all high level talk it's not implementation stuff.
you would say I would create the animation object given the properties and the duration how long I would animate it for, then I would call start() to start the animation
easy, then you would probably need to add an animator listener to be notified of what happens during the animation. like it start, it is cannceled, it is ended.
you need to override all of these methods ,you add your custom code here. where you need it you can customize
your can add an interpolator, indicate how an animation changes over time for example
you can also just use the View Property animator because in the end you are animating properties of a view this is a very direct simple easy to use API
you may be wondering I said in the beginning that no one can come up with the stuff off the top of their head, how did I do it I Googled it that's what I did, and to study for this stuff you have to Google it you have to memorize them
I hope they can serve as a reference for you when you are studying for something like this.
大体思路是:问到大致的问题, 作为一个普通开发者来说, 不可能一上来就能说的面面俱到, 除非是刚好这几天写过这个功能。回答可以先回答要完成这个功能, android都提供了哪几个相关的类。 之后把相关类的大致用法给说明下。提一句 I should give the properties by google it.
如果赶上自己正好了解的知识点, 就说的详细些, 如果确实了解的不多, 就说个大概, 至于详细的类属性和该调用什么方法, 就直接说I will google it.