Android开发Android自定义控件、自定义View、自定义ViewGroup安卓自定义VIEW

Android 楔子Wedges Loading View

2018-09-18  本文已影响45人  逸小苼

原创版权所有,转载请注明出处 ,https://www.jianshu.com/p/dfe411baa0ed

WedgesView

可自动转动的 楔子loading效果,支持自由配置。

地址: https://github.com/fairytale110/WedgesView

预览

preview

Gif 效果略卡,实机运行很流畅的。。。

功能

已支持:

开发中功能:

怎么使用?

  <tech.nicesky.libwedgesview.WedgesView
        android:id="@+id/wedgesView"
        android:layout_width="222dp"
        android:layout_height="222dp"
        app:wv_background="@android:color/white"
        app:wv_rotate_speed="0.5"
        app:wv_wedge_alpha="0.8"
        app:wv_wedge_diameter="@dimen/dp_222"
        android:padding="@dimen/dp_20"
        />

or


        int[] colors = new int[4];
        colors[0] = Color.parseColor("#C2DFD7");
        colors[1] = Color.parseColor("#FFE6F5");
        colors[2] = Color.parseColor("#FE718D");
        colors[3] = Color.parseColor("#E90C59");
        WedgesView wedgesView = new WedgesView(this);
        wedgesView.setBackgroundColor(Color.WHITE);//Set View's background color
        wedgesView.setColors(colors);//set wedges's color
        wedgesView.setRotateSpeed(0.5F);//设置最快的转速 01F 到 1.0F
        wedgesView.setWedgeAlpha(0.8F);//设置楔子的透明度 0.1F到1.0F
        //设置楔子的直径
        wedgesView.setWedgeDiameter((int) getResources().getDimension(R.dimen.dp_200));
        wedgesView.reStart();//开始动画
        //wedgesView.stop();// 停止动画
上一篇 下一篇

猜你喜欢

热点阅读