LoadingView and LoadingDialog.
APACHE-2.0 License
一个MD风格的LoadingView,它来自项目LoadingDrawable,因为我的开源项目需要用到Loading,所以我把它扣出来了,只是为了我的其它开源项目方便使用,推荐使用原作者的LoadingDrawable。
compile 'com.yanzhenjie:loading:1.0.2'
<dependency>
<groupId>com.yanzhenjie</groupId>
<artifactId>loading</artifactId>
<version>1.0.2</version>
<type>pom</type>
</dependency>
XML或者Java中:
<com.yanzhenjie.loading.LoadingView
android:id="@+id/loading_view"
android:layout_width="150dp"
android:layout_height="150dp" />
// 或者Java:
LoadingView loadView = new LoadingView(context);
默认是一个白色的圆,你也可以改变颜色:
LoadingView loadView;
loadView.setCircleColors(color1, color2, color3);
使用默认的Dialog:
Dialog mWaitDialog = new LoadingDialog(context);
mWaitDialog.setMessage(R.string.loading_wait);
// mWaitDialog.setMessage("请求稍等");
mWaitDialog.setCircleColors(color1, color2, color3);
mWaitDialog.show();
Copyright © Yan Zhenjie
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.