Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
LDRAlighieri committed Aug 24, 2019
2 parents 98bb053 + 6a02840 commit 5b58772
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 66 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# ChangeLog

# ChangeLog


## Version 1.0.0

* New: Added a small sample.
* Update: Kotlin modules dependency to v1.3.50.
* Update: Kotlin coroutine modules dependency to v1.3.0.
* Fix: Fixed confusion with `Chip` extension name `clicks`, the correct name is `closeIconClicks`.
* Fix: Added `@RequiresApi(Build.VERSION_CODES.JELLY_BEAN)` annotation for one of the `View` `draws` extensions.


## Version 1.0.0-RC

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ This library is for Android applications only. Help you to transform Android UI

Platform bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind:1.0.0'
```

AndroidX library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-core:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-core:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.0.0'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.0.0'
```

Google 'material' library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-material:1.0.0-RC'
implementation 'ru.ldralighieri.corbind:corbind-material:1.0.0'
```


Expand Down
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ buildscript {

ext {
versions = [
'kotlin' : '1.3.41',
'kotlin_coroutines' : '1.3.0-RC2',
'kotlin' : '1.3.50',
'kotlin_coroutines' : '1.3.0',
'android_gradle' : '3.5.0',
'androidx' : [
'core' : '1.0.2',
Expand All @@ -43,6 +43,7 @@ buildscript {
'jdk8': "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}"
],
'coroutines': [
'core': "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlin_coroutines}",
'jdk8': "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${versions.kotlin_coroutines}",
'android': "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlin_coroutines}"
]
Expand Down Expand Up @@ -87,9 +88,9 @@ buildscript {


plugins {
id "com.diffplug.gradle.spotless" version "3.24.0"
id "com.diffplug.gradle.spotless" version "3.24.2"
id 'com.github.ben-manes.versions' version '0.22.0'
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC16"
id "io.gitlab.arturbosch.detekt" version "1.0.0"
}


Expand Down Expand Up @@ -140,7 +141,7 @@ subprojects {


detekt {
toolVersion = "1.0.0-RC16"
toolVersion = "1.0.0"

failFast = false
buildUponDefaultConfig = true
Expand Down
2 changes: 1 addition & 1 deletion corbind/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {

dependencies {
api deps.kotlin.stdlib.jdk8
api deps.kotlin.coroutines.jdk8
api deps.kotlin.coroutines.core
api deps.kotlin.coroutines.android

api deps.androidx.annotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,16 @@ import kotlinx.coroutines.isActive
import ru.ldralighieri.corbind.corbindReceiveChannel
import ru.ldralighieri.corbind.offerElement

/**
* [ViewGroup] hierarchy change event
*/
sealed class ViewGroupHierarchyChangeEvent {
abstract val view: ViewGroup
abstract val child: View
}

/**
* A child view add event on a [ViewGroup].
*/
data class ViewGroupHierarchyChildViewAddEvent(
override val view: ViewGroup,
override val child: View
) : ViewGroupHierarchyChangeEvent()

/**
* A child view remove event on a [ViewGroup].
*/
data class ViewGroupHierarchyChildViewRemoveEvent(
override val view: ViewGroup,
override val child: View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fun View.draws(
/**
* Create a flow for draws on [View].
*/
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
@CheckResult
fun View.draws(): Flow<Unit> = channelFlow {
val listener = listener(this, ::offer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ fun View.globalLayouts(

val listener = listener(scope, events::offer)
viewTreeObserver.addOnGlobalLayoutListener(listener)
events.invokeOnClose { viewTreeObserver.removeOnGlobalLayoutListener(listener) }
events.invokeOnClose {
@Suppress("DEPRECATION") // Correct when minSdk 16
viewTreeObserver.removeGlobalOnLayoutListener(listener)
}
}

/**
Expand All @@ -71,7 +74,10 @@ suspend fun View.globalLayouts(

val listener = listener(this, events::offer)
viewTreeObserver.addOnGlobalLayoutListener(listener)
events.invokeOnClose { viewTreeObserver.removeOnGlobalLayoutListener(listener) }
events.invokeOnClose {
@Suppress("DEPRECATION") // Correct when minSdk 16
viewTreeObserver.removeGlobalOnLayoutListener(listener)
}
}

/**
Expand All @@ -87,7 +93,10 @@ fun View.globalLayouts(
): ReceiveChannel<Unit> = corbindReceiveChannel(capacity) {
val listener = listener(scope, ::offerElement)
viewTreeObserver.addOnGlobalLayoutListener(listener)
invokeOnClose { viewTreeObserver.removeOnGlobalLayoutListener(listener) }
invokeOnClose {
@Suppress("DEPRECATION") // Correct when minSdk 16
viewTreeObserver.removeGlobalOnLayoutListener(listener)
}
}

/**
Expand All @@ -97,7 +106,10 @@ fun View.globalLayouts(
fun View.globalLayouts(): Flow<Unit> = channelFlow {
val listener = listener(this, ::offer)
viewTreeObserver.addOnGlobalLayoutListener(listener)
awaitClose { viewTreeObserver.removeOnGlobalLayoutListener(listener) }
awaitClose {
@Suppress("DEPRECATION") // Correct when minSdk 16
viewTreeObserver.removeGlobalOnLayoutListener(listener)
}
}

@CheckResult
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=ru.ldralighieri.corbind
VERSION_NAME=1.0.0-RC
VERSION_NAME=1.0.0

POM_DESCRIPTION=Kotlin Coroutine binding APIs for Android UI widgets from the platform and support libraries.

Expand Down
52 changes: 21 additions & 31 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ dependencies {
implementation project(":corbind")
implementation project(":corbind-swiperefreshlayout")

implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.41'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.0-RC2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0-RC2'

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'com.google.android.material:material:1.1.0-alpha09'
Expand Down

0 comments on commit 5b58772

Please sign in to comment.