• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ILayoutAnimationController: 自定义LayoutAnimationController,可任意定制ViewGroup ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ILayoutAnimationController

开源软件地址:

https://gitee.com/huanhailiuxin/ILayoutAnimationController

开源软件介绍:

ILayoutAnimationController

  自定义LayoutAnimationController,可任意定制ViewGroup实例内部子View的动画执行顺序,1行代码就让你的ViewGroup拥有华丽的布局动画!
  简书:Android开源之ILayoutAnimationController,1行代码让你的ViewGroup拥有华丽的布局动画!


截屏GIF:

    

使用方法:

######方法一:首先创建ILayoutAnimationController实例,然后将此实例作为参数为ViewGroup设置布局动画

  • 1:{@link ILayoutAnimationController#generateController(Animation, float, ILayoutAnimationController.IndexAlgorithm)}

  • 2:{@link android.view.ViewGroup#setLayoutAnimation(LayoutAnimationController)}

######方法二:1行代码直接搞定,以下两种方法任选

  • {@link ILayoutAnimationController#setLayoutAnimation(ViewGroup, int, float, ILayoutAnimationController.IndexAlgorithm)}

  • {@link ILayoutAnimationController#setLayoutAnimation(ViewGroup, Animation, float,ILayoutAnimationController.IndexAlgorithm)}

示例代码:

LinearLayout ll = (LinearLayout) findViewById(R.id.ll);//两行代码设置布局动画:ILayoutAnimationController controller = ILayoutAnimationController.generateController(AnimationUtils.loadAnimation(this,R.anim.activity_open_enter),0.8f,ILayoutAnimationController.IndexAlgorithm.INDEXSIMPLEPENDULUM);ll.setLayoutAnimation(controller);//一行代码直接搞定:ILayoutAnimationController.setLayoutAnimation(ll,R.anim.activity_open_enter,0.8f,ILayoutAnimationController.IndexAlgorithm.INDEXSIMPLEPENDULUM);方法setLayoutAnimation中各参数介绍:/** * 根据传入的动画资源ID、单个子View动画延时、子View动画执行顺序算法枚举值 创建一个新的CustomLayoutAnimationController实例, * 将此实例作为参数为viewGroup设置布局动画 * @param viewGroup * @param animResId * @param delay * @param indexAlgorithm */public static void setLayoutAnimation(@NonNull ViewGroup viewGroup,@AnimRes int animResId, float delay,@Nullable final IndexAlgorithm indexAlgorithm){    Animation animation = AnimationUtils.loadAnimation(viewGroup.getContext(),animResId);    setLayoutAnimation(viewGroup,animation,delay,indexAlgorithm);}

注意:

  • 使用ILayoutAnimationController获取的ILayoutAnimationController实例,调用setOrder(int order)方法无效!

开发者:


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap