|
| 1 | +[](https://jitpack.io/#LinweiJ/LoadingDialog) |
| 2 | + |
| 3 | +#如何使用它? |
| 4 | + |
| 5 | +先在 project的build.gradle 添加: |
| 6 | +``` |
| 7 | +allprojects { |
| 8 | + repositories { |
| 9 | + ... |
| 10 | + maven { url "https://jitpack.io" } |
| 11 | + } |
| 12 | + } |
| 13 | +``` |
| 14 | +然后在module的build.gradle 添加: |
| 15 | +``` |
| 16 | +dependencies { |
| 17 | + compile 'com.github.LinweiJ:LoadingDialog:V0.0.1' |
| 18 | + } |
| 19 | +``` |
| 20 | + |
| 21 | + |
| 22 | +## 效果图 |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +##简单使用 |
| 27 | + |
| 28 | +```java |
| 29 | +LoadingDialog loadingDialog = new LoadingDialog(context); |
| 30 | +//或 LoadingDialog loadingDialog = new LoadingDialog.Builder(context).create(); |
| 31 | +//显示加载框 |
| 32 | +loadingDialog.loading(); |
| 33 | +//直接取消加载框 |
| 34 | +loadingDialog.cancel(); |
| 35 | +//显示加载成功后取消加载框 |
| 36 | +loadingDialog.loadSuccess(); |
| 37 | +//显示加载失败后取消加载框 |
| 38 | +loadingDialog.loadFail(); |
| 39 | +``` |
| 40 | + |
| 41 | +## 自定义文字 |
| 42 | + |
| 43 | +### 方法一: |
| 44 | +```java |
| 45 | +LoadingDialog loadingDialog = new LoadingDialog(context); |
| 46 | +//显示加载框 |
| 47 | +loadingDialog.loading("处理中..."); |
| 48 | +//显示处理成功后取消加载框 |
| 49 | +loadingDialog.loadSuccess("处理成功"); |
| 50 | +//显示处理失败后取消加载框 |
| 51 | +loadingDialog.loadFail("处理失败"); |
| 52 | +//显示处理完成后取消加载框 |
| 53 | +//loadSuccess("处理成功") loadFail("处理失败") 都是调用该方法 |
| 54 | +loadingDialog.loadComplete("处理完成"); |
| 55 | +``` |
| 56 | + |
| 57 | +###方法二: |
| 58 | + |
| 59 | +```java |
| 60 | +LoadingDialog.Builder builder = new LoadingDialog.Builder(context); |
| 61 | +builder.setLoading_text("处理中...") |
| 62 | + .setFail_text("处理失败") |
| 63 | + .setSuccess_text("处理成功"); |
| 64 | +LoadingDialog customloadingDialog = builder.create(); |
| 65 | +``` |
| 66 | + |
| 67 | +#License |
| 68 | + |
| 69 | +``` |
| 70 | +Copyright 2017 LinWeiJia |
| 71 | +
|
| 72 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 73 | +you may not use this file except in compliance with the License. |
| 74 | +You may obtain a copy of the License at |
| 75 | +
|
| 76 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 77 | +
|
| 78 | +Unless required by applicable law or agreed to in writing, software |
| 79 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 80 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 81 | +See the License for the specific language governing permissions and |
| 82 | +limitations under the License. |
| 83 | +``` |
0 commit comments