Skip to content

Commit ee3e3ab

Browse files
committed
viewbinding-ktx: 4.2.1-0
1 parent d2448fc commit ee3e3ab

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

buildSrc/src/main/kotlin/dependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object jetbrains {
1616
object androidx {
1717
const val activity = "androidx.activity:activity:1.2.3"
1818
const val annotation = "androidx.annotation:annotation:1.2.0"
19-
const val viewbinding = "androidx.databinding:viewbinding:4.1.2"
19+
const val viewbinding = "androidx.databinding:viewbinding:4.2.1"
2020

2121
object appcompat : Group("androidx.appcompat", version = "1.3.0") {
2222
val resources by this

viewbinding-ktx/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
## Unreleased
22

3+
## 4.2.1-0 (2021-06-27)
4+
5+
### Dependencies
6+
7+
- kotlin-stdlib-jdk8 1.4.32 -> kotlin-stdlib 1.5.20
8+
- androidx.databinding:viewbinding 4.1.2 -> 4.2.1
9+
- androidx.fragment 1.3.0 -> 1.3.5
10+
- androidx.lifecycle 2.3.0 -> 2.3.1
11+
312
## 4.1.2-2 (2021-03-08)
413

514
### Fixed

viewbinding-ktx/README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ A set of Kotlin extensions for dealing with ViewBinding.
77
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
88
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
99

10-
1110
- [Installation](#installation)
1211
- [Usage](#usage)
1312
- [Delegate](#delegate)
@@ -19,30 +18,27 @@ A set of Kotlin extensions for dealing with ViewBinding.
1918
## Installation
2019

2120
Add the dependency:
22-
```groovy
21+
22+
```kotlin
2323
repositories {
2424
mavenCentral()
2525
google()
2626
}
2727

2828
dependencies {
29-
implementation("com.redmadrobot.extensions:viewbinding-ktx:4.1.2-2")
29+
implementation("com.redmadrobot.extensions:viewbinding-ktx:4.2.1-0")
3030
}
3131
```
3232

3333
Enable ViewBinding in build script:
34-
```groovy
35-
android {
36-
// For Android Gradle Plugin 3.6
37-
viewBinding.isEnabled = true
3834

35+
```kotlin
36+
android {
3937
// For Android Gradle Plugin 4.0+
4038
buildFeatures.viewBinding = true
41-
}
4239

43-
// Optional: disable synthetics for views, keep only parcelize
44-
androidExtensions {
45-
features = ["parcelize"]
40+
// For Android Gradle Plugin prior to 3.6
41+
viewBinding.isEnabled = true
4642
}
4743
```
4844

@@ -53,6 +49,7 @@ androidExtensions {
5349
For Fragments' layouts use `ViewBinding` delegate.
5450
Resulting binding bounded to Fragment View's lifecycle.
5551
It will be cleared after `onDestroyView`.
52+
5653
```kotlin
5754
class ProfileFragment : Fragment(R.layout.fragment_profile) {
5855

@@ -71,6 +68,7 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
7168
### Extensions
7269

7370
Inflate `ViewBinding` using `LayoutInflater`:
71+
7472
```kotlin
7573
class PickDateFragment : DialogFragment() {
7674

@@ -88,6 +86,7 @@ class PickDateFragment : DialogFragment() {
8886
```
8987

9088
Inflate `ViewBinding` using `Context`:
89+
9190
```kotlin
9291
fun createDetailsView(card: Card): MaterialTextView {
9392
return requireContext().inflateViewBinding<ViewCardDetailsBinding>().apply {
@@ -98,6 +97,7 @@ fun createDetailsView(card: Card): MaterialTextView {
9897
```
9998

10099
Inflate `ViewBinding` and attach it to `ViewGroup`:
100+
101101
```kotlin
102102
class ErrorView @JvmOverloads constructor(
103103
context: Context,
@@ -110,6 +110,7 @@ class ErrorView @JvmOverloads constructor(
110110
```
111111

112112
Obtain `ViewBinding` from inflated view:
113+
113114
```kotlin
114115
class TransactionsItem : Item {
115116

@@ -127,6 +128,7 @@ class TransactionsItem : Item {
127128
```
128129

129130
## Contributing
131+
130132
Merge requests are welcome.
131133
For major changes, please open an issue first to discuss what you would like to change.
132134

viewbinding-ktx/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
id("redmadrobot.publish")
77
}
88

9-
version = "4.1.2-2"
9+
version = "4.2.1-0"
1010
description = "A set of Kotlin extensions for dealing with ViewBinding"
1111

1212
android {

0 commit comments

Comments
 (0)