这是一个自定义控件合集。目前包含Loading View。持续更新中...
- Gradle方式引用
compile 'com.zyao89:zloading:1.0.8'
- 1.0.6 增加字号设置,颜色设置, 解决#2 补充说明:设置字号后,提示文字不再有动画
- 1.0.7 新增 SINGLE_CIRCLE 类型动画, 修复 TEXT 类型简单缺陷。 增加 TEXT、RotateCircleBuilder 类型的使用说明。
- 1.0.8 新增 SNAKE_CIRCLE 类型动画(详细见下方展示图)。
- 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 |
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 |
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.