这是一个自定义控件合集。目前包含Loading View。持续更新中...
- Gradle方式引用
compile 'com.zyao89:zloading:1.0.9'
- XML:
<com.zyao89.view.zloading.ZLoadingView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:z_type="CircleBuilder"
app:z_color="@color/colorAccent"/>
z_type
选择加载动画的类型,就是下面介绍的这些;
z_color
设置加载动画的颜色;
- Java
ZLoadingView zLoadingView = (ZLoadingView) findViewById(R.id.loadingView_1);
zLoadingView.setLoadingBuilder(Z_TYPE.CIRCLE);//设置类型
zLoadingView.setColorFilter(Color.WHITE);//设置颜色
- 【新增】Dialog对话框模式
ZLoadingDialog dialog = new ZLoadingDialog(MainActivity.this);
dialog.setLoadingBuilder(type)//设置类型
.setLoadingColor(Color.BLACK)//颜色
.setHintText("Loading...")
.setHintTextSize(16) // 设置字体大小 dp
.setHintTextColor(Color.GRAY) // 设置字体颜色
.show();
效果如下:
索引 | 类名 | 枚举值(Z_TYPE) | 昵称 |
---|---|---|---|
0 | CircleBuilder | CIRCLE | 圆 |
1 | ClockBuilder | CIRCLE_CLOCK | 计时器 |
2 | StarBuilder | STAR_LOADING | 跳舞的星星 |
3 | LeafBuilder | LEAF_ROTATE | 旋转的叶子 |
4 | DoubleCircleBuilder | DOUBLE_CIRCLE | 画两个圈圈 |
5 | PacManBuilder | PAC_MAN | PacMan |
6 | ElasticBallBuilder | ELASTIC_BALL | 颤抖吧!球球 |
7 | InfectionBallBuilder | INFECTION_BALL | 感染体 |
8 | IntertwineBuilder | INTERTWINE | 交织 |
9 | TextBuilder | TEXT | 文字 |
10 | SearchPathBuilder | SEARCH_PATH | 搜索等待 |
11 | RotateCircleBuilder | ROTATE_CIRCLE | 多圆旋转 |
12 | SingleCircleBuilder | SINGLE_CIRCLE | 单圆简单动画 |
13 | SnakeCircleBuilder | SNAKE_CIRCLE | 引蛇出洞 |
14 | StairsPathBuilder | STAIRS_CIRCLE | 舞动阶梯 |
更多可访问 zyao89.cn
Copyright 2017 zyao89
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.