Android: animated custom views

前端 未结 4 740
一整个雨季
一整个雨季 2021-02-02 12:07

EDIT 2: new official training guide

The Developers site released a training guide for UI related stuff, this is the index:

  • Animations Overview
  • Pro
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 12:44

    I would like to suggest a library I've written a while ago (published recently), which allows you to create custom views and add animations to them.

    You can find it here and a very simple demo here. While my demos frankly aren't that impressive, they demonstrate the power of the library and most importantly how to use it.

    It works with Android's TimeInterpolator and any of its children (as-well as custom ones).

    The animations are drawn entirely using Canvas, the only difference here is that you can get an animated value, which changes according to the TimeInterpolator as a function of time.

    You can add as many animations as you would like to your View, control them independently of each-other. And on top of that, you are not limited to drawing non-animation things. There's a dedicated method for that (onDrawStatics).

提交回复
热议问题