1
1
# ViewBindingKTX
2
2
3
- English | [ 中文] ( https://github.com/DylanCaiCoding/ViewBindingKtx/blob/master/README_CN .md)
3
+ English | [ 中文] ( README_ZH .md)
4
4
5
5
[ ![ ] ( https://www.jitpack.io/v/DylanCaiCoding/ViewBindingKTX.svg )] ( https://www.jitpack.io/#DylanCaiCoding/ViewBindingKTX ) [ ![ ] ( https://img.shields.io/badge/License-Apache--2.0-blue.svg )] ( https://github.com/DylanCaiCoding/ViewBindingKtx/blob/master/LICENSE )
6
6
@@ -43,16 +43,16 @@ android {
43
43
44
44
dependencies {
45
45
// The following are optional, please add as needed
46
- implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-ktx:2.0.5 '
47
- implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-nonreflection-ktx:2.0.5 '
48
- implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-base:2.0.5 '
49
- implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-brvah:2.0.5 '
46
+ implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-ktx:2.0.6 '
47
+ implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-nonreflection-ktx:2.0.6 '
48
+ implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-base:2.0.6 '
49
+ implementation 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-brvah:2.0.6 '
50
50
}
51
51
```
52
52
53
53
## Usage
54
54
55
- :pencil : ** [ Usage documentation] ( https://dylancaicoding.github.io/ViewBindingKTX/#/en/ ) **
55
+ :pencil : ** [ >> Usage documentation << ] ( https://dylancaicoding.github.io/ViewBindingKTX/#/en/ ) **
56
56
57
57
## Sample
58
58
@@ -62,7 +62,6 @@ Get the binding instance using the Kotlin property delegate:
62
62
class MainActivity : AppCompatActivity () {
63
63
64
64
private val binding: ActivityMainBinding by binding()
65
- // private val binding by binding(ActivityMainBinding::inflate)
66
65
67
66
override fun onCreate (savedInstanceState : Bundle ? ) {
68
67
super .onCreate(savedInstanceState)
@@ -75,11 +74,8 @@ class MainActivity : AppCompatActivity() {
75
74
class HomeFragment : Fragment (R .layout.fragment_home) {
76
75
77
76
private val binding: FragmentHomeBinding by binding()
78
- // private val binding by binding(FragmentHomeBinding::bind)
79
-
80
77
private val childBinding: LayoutChildBinding by binding(Method .INFLATE )
81
- // private val childBinding by binding { LayoutChildBinding.inflate(layoutInflater) }
82
-
78
+
83
79
override fun onViewCreated (view : View , savedInstanceState : Bundle ? ) {
84
80
super .onViewCreated(view, savedInstanceState)
85
81
binding.container.addView(childBinding.root)
@@ -132,7 +128,7 @@ See the [usage documentation](https://dylancaicoding.github.io/ViewBindingKTX) f
132
128
133
129
| Library | Description |
134
130
| ------------------------------------------------------------ | ------------------------------------------------------------ |
135
- | [ Longan] ( https://github.com/DylanCaiCoding/Longan ) | A collection of Kotlin utils |
131
+ | [ Longan] ( https://github.com/DylanCaiCoding/Longan ) | Probably the best Kotlin utils library for Android. |
136
132
| [ LoadingStateView] ( https://github.com/DylanCaiCoding/LoadingStateView ) | Decoupling the code of toolbar or loading status view. |
137
133
| [ MMKV-KTX] ( https://github.com/DylanCaiCoding/MMKV-KTX ) | Use MMKV with property delegates. |
138
134
| [ Tracker] ( https://github.com/DylanCaiCoding/Tracker ) | A lightweight tracking framework based on the tracking idea of Buzzvideo.|
0 commit comments