# WanLibrary
**Repository Path**: zhongya666/WanLibrary
## Basic Information
- **Project Name**: WanLibrary
- **Description**: 自己封装Android万能库
- **Primary Language**: Android
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 2
- **Forks**: 0
- **Created**: 2021-02-19
- **Last Updated**: 2022-10-25
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 玩库
## 项目由来
Android开发已经5年,发现代码大多数代码都一个样,来吧大佬我要整合轮子了。
关注不迷路,我会持续更新...
## 项目打造
1.WanLibrary的使用教程在我的另一个项目中配合使用,其代码简单易懂,这么说吧,会写Hello World人都能看懂:sunglasses: :sunglasses: :sunglasses: 。
2.欢迎浏览我的另一个项目[WanApk](https://gitee.com/zhongya666/WanApk.git)里面有最简单的案例演示。
## 效果图

## 依赖我,让你省时省力。
```
implementation 'com.gitee.zhongya666:WanLibrary:1.0.9'
```
## 使用说明(按照组件字母排序)
### BasicDialog
```
var dialog = BasicDialog(requireContext())
dialog.setContent("我真的很帅")
dialog.show()
dialog.setAction {
ToastUtil.show("是的,你做出了正确的选择")
}
/**
* 修改弹框宽度 1 - 10 (int)
* 高度是自适应的不支持修改
*/
var dialog = BasicDialog(requireContext(),6)
dialog.setContent("我真的很帅")
dialog.show()
dialog.setActionWhich {
if (it ==0){
ToastUtil.show("嗯,我知道你手误了")
}else{
ToastUtil.show("是的,你做出了正确的选择")
}
}
/**
* 一般修改确定按钮背景色比较多,特写此方法
*/
var dialog = BasicDialog(requireContext())
dialog.setContent("我真的很帅")
dialog.setAgreeBackgroundColor(ContextCompat.getColor(requireContext(),R.color.blue))
dialog.setAgreeTextColor(ContextCompat.getColor(requireContext(),R.color.white))
dialog.show()
```
### TimeButton
##### 方式一 动态设置
```
/**
* 这种方式可以不用在xml中写shape代码,更加方便
* normalBackgroundColor 正常时的背景色
* runBackgroundColor 执行时的背景色
* radius 圆角大小
*/
setEasyAttr(
ContextCompat.getColor(context,R.color.yellow_f2),
ContextCompat.getColor(context,R.color.color_999),
10f
)
/**
* 务必使用这个点击事件
*/
setTimeButtonClickListener {
}
```
##### 方式二 静态xml
```
TimeButton 继承了TextView
自定义以下属性
countDownTime 倒计时时间
textNormalColor 未点击时的字体颜色
textRunColor 点击后的字体颜色
textNormal 未点击时的字体
textRun 点击后的字体
normalBackgroundResource 未点击时的背景资源
runBackgroundColorResource 点击后的背景资源
```
## 联系方式
* 可能会因为工作忙碌原因没有及时回复,请联系我的个人微信号:`zhongya_666`