Skip to content

Commit 2c32d68

Browse files
Add docs
1 parent 76af5e0 commit 2c32d68

File tree

10 files changed

+1110
-0
lines changed

10 files changed

+1110
-0
lines changed

docs/.nojekyll

Whitespace-only changes.

docs/README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# ViewBindingKTX
2+
3+
[![](https://www.jitpack.io/v/DylanCaiCoding/ViewBindingKTX.svg)](https://www.jitpack.io/#DylanCaiCoding/ViewBindingKTX)
4+
[![](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://github.com/DylanCaiCoding/ViewBindingKtx/blob/master/LICENSE)
5+
[![GitHub Repo stars](https://img.shields.io/github/stars/DylanCaiCoding/ViewBindingKTX?style=social)](https://github.com/DylanCaiCoding/ViewBindingKTX)
6+
7+
[ViewBinding](https://developer.android.com/topic/libraries/view-binding) 相对于 Kotlin synthetics、ButterKnife、findViewById,能减少 id 写错或类型写错导致的异常,官方和 JakeWharton 都推荐使用。但是 ViewBinding 直接使用会有点繁琐,所以本库能**帮助你在各种使用场景用尽可能少的代码来使用 ViewBinding**
8+
9+
## Feature
10+
11+
- 支持 Kotlin 和 Java 用法
12+
- 支持多种使用反射和不使用反射的用法
13+
- 支持封装改造自己的基类,使其用上 ViewBinding
14+
- 支持 BaseRecyclerViewAdapterHelper
15+
- 支持 Activity、Fragment、Dialog、Adapter
16+
- 支持在 Fragment 自动释放绑定类的实例对象
17+
- 支持实现自定义组合控件
18+
- 支持 TabLayout 实现自定义标签布局
19+
- 支持 NavigationView 设置头部控件
20+
- 支持 DataBinding 自动设置 lifecycleOwner
21+
22+
## Gradle
23+
24+
在根目录的 build.gradle 添加:
25+
26+
```groovy
27+
allprojects {
28+
repositories {
29+
// ...
30+
maven { url 'https://www.jitpack.io' }
31+
}
32+
}
33+
```
34+
35+
添加配置和依赖:
36+
37+
```groovy
38+
android {
39+
buildFeatures {
40+
viewBinding = true
41+
}
42+
}
43+
44+
dependencies {
45+
// 以下都是可选,请根据需要进行添加
46+
implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-ktx:1.2.6'
47+
implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-nonreflection-ktx:1.2.6'
48+
implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-base:1.2.6'
49+
implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-brvah:1.2.6'
50+
}
51+
```
52+
53+
## 作者其它的库
54+
55+
|| 简介 |
56+
| ------------------------------------------------------------ | ---------------------------------------------- |
57+
| [Longan](https://github.com/DylanCaiCoding/Longan) | 简化 Android 开发的 Kotlin 工具类集合 |
58+
| [LoadingStateView](https://github.com/DylanCaiCoding/LoadingStateView) | 深度解耦标题栏或加载中、加载失败、无数据等视图 |
59+
| [MMKV-KTX](https://github.com/DylanCaiCoding/MMKV-KTX) | 用属性委托的方式使用 MMKV |
60+
| [ActivityResultLauncher](https://github.com/DylanCaiCoding/ActivityResultLauncher) | 优雅地替代 `startActivityForResult()` |
61+
62+
## License
63+
64+
```
65+
Copyright (C) 2020. Dylan Cai
66+
67+
Licensed under the Apache License, Version 2.0 (the "License");
68+
you may not use this file except in compliance with the License.
69+
You may obtain a copy of the License at
70+
71+
http://www.apache.org/licenses/LICENSE-2.0
72+
73+
Unless required by applicable law or agreed to in writing, software
74+
distributed under the License is distributed on an "AS IS" BASIS,
75+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
76+
See the License for the specific language governing permissions and
77+
limitations under the License.
78+
```

docs/_sidebar.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
* [介绍](/)
2+
3+
* Kotlin 用法
4+
* [使用属性委托](/kotlin/propertydelegate)
5+
* [封装到基类](/kotlin/baseclass)
6+
* [兼容 BRVAH](/kotlin/brvah)
7+
8+
* Java 用法
9+
* [封装到基类](/java/baseclass)
10+
* [兼容 BRVAH](/java/brvah)
11+
12+
* 其它
13+
* [Q&A](/others/q&a)

docs/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Document</title>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7+
<meta name="description" content="Description">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
9+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
10+
</head>
11+
<body>
12+
<div id="app"></div>
13+
<script>
14+
window.$docsify = {
15+
name: 'ViewBindingKTX',
16+
repo: 'https://github.com/DylanCaiCoding/ViewBindingKTX',
17+
loadSidebar: true
18+
}
19+
</script>
20+
<!-- Docsify v4 -->
21+
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)