Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
LDRAlighieri committed Jan 25, 2023
2 parents e20b5d6 + 5122790 commit 50832a4
Show file tree
Hide file tree
Showing 48 changed files with 1,150 additions and 206 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build the sample app to verify it works
run: ./gradlew sample:assemble
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
push:
branches:
- master
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build the sample app to verify it works
run: ./gradlew sample:assemble

- name: Deploy to Sonatype
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: ./gradlew publish --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@

# ChangeLog


## Version 1.7.0

* New: Bindings list:
* Google "material" library bindings:
* `corbind-material`:
* `HideBottomViewOnScrollBehavior`:
* `bottomViewScrollStateChanges`
* `SearchBar`:
* `navigationClicks`
* `SearchView`:
* `transitionStateChanges`
* `transitionStateChangeEvents`
* `SideSheetBehavior`:
* `sideSheetSlides`
* `sideSheetStateChanges`
* Update: Kotlin modules dependency to v1.8.0.
* Update: Material components dependency to v1.8.0.
* Update: Minor update of other libraries.


## Version 1.6.0

* New: Fragment module
Expand Down Expand Up @@ -222,7 +241,7 @@ single selection flag.
* `Snackbar`:
* `shown`
* `SwipeDismissBehavior`:
* 'dragStateChanges`
* `dragStateChanges`
* Fix: Fixed sources jars generation (#6).


Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -186,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2019] [Vladimir Raupov]
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
90 changes: 48 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,91 @@
[![Corbind](logo.svg)](https://ldralighieri.github.io/Corbind)

[![Maven Central](https://img.shields.io/maven-central/v/ru.ldralighieri.corbind/corbind.svg)](https://search.maven.org/search?q=g:ru.ldralighieri.corbind)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.7.20-blue.svg)](https://kotlinlang.org)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.8.0-blue.svg?logo=kotlin)](https://kotlinlang.org)
[![Kotlin Coroutines Version](https://img.shields.io/badge/Coroutines-v1.6.4-blue.svg)](https://kotlinlang.org/docs/reference/coroutines-overview.html)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a1c9a1b1d1ce4ca7a201ab93492bf6e0)](https://app.codacy.com/gh/LDRAlighieri/Corbind)
[![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)

[![Google Dev Library](https://img.shields.io/badge/Featured%20in%20devlibrary.withgoogle.com-Corbind-blue)](https://devlibrary.withgoogle.com/products/android/repos/LDRAlighieri-Corbind)
[![Google Dev Library](https://img.shields.io/badge/Google_DevLibrary-Corbind-blue)](https://devlibrary.withgoogle.com/products/android/repos/LDRAlighieri-Corbind)
[![Android Weekly](https://androidweekly.net/issues/issue-377/badge)](https://androidweekly.net/issues/issue-377)

<br>

Kotlin Coroutines binding APIs for Android UI widgets from the platform and support libraries. **Supports Flow, ReceiveChannel and Actor**.
Kotlin Coroutines binding APIs for Android UI widgets from the platform and support libraries. **Supports Flow, ReceiveChannel and Actor**.


## Description

This library is for Android applications only. Help you to transform Android UI events into cold [Flow][flow], hot [ReceiveChannel][channel] or just perform an action through an [Actor][actor].
This library is for Android applications only. Help you to transform Android UI events into cold [Flow][flow], hot [ReceiveChannel][channel] or just perform an action through an [Actor][actor]. Please consider giving this repository a star ⭐ if you like the project.


## Download
## Using in your projects

Platform bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind:1.6.0'
```kotlin
dependencies {
implementation("ru.ldralighieri.corbind:corbind:1.7.0")
}
```

AndroidX library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-activity:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-core:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-fragment:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-lifecycle:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-navigation:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.6.0'
implementation 'ru.ldralighieri.corbind:corbind-viewpager2:1.6.0'
```kotlin
dependencies {
implementation("ru.ldralighieri.corbind:corbind-activity:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-appcompat:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-core:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-drawerlayout:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-fragment:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-leanback:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-lifecycle:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-navigation:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-recyclerview:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-slidingpanelayout:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-viewpager:1.7.0")
implementation("ru.ldralighieri.corbind:corbind-viewpager2:1.7.0")
}
```

Google 'material' library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-material:1.6.0'
```kotlin
dependencies {
implementation("ru.ldralighieri.corbind:corbind-material:1.7.0")
}
```

Snapshot build:
```groovy
```kotlin
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
implementation 'ru.ldralighieri.corbind:{module}:1.6.1-SNAPSHOT'
implementation("ru.ldralighieri.corbind:{module}:1.8.0-SNAPSHOT")
}
```


## List of extensions

You can find a list of extensions in the description of each module:
[corbind]
[corbind-activity]
[corbind-appcompat]
[corbind-core]
[corbind-drawerlayout]
[corbind-fragment]
[corbind-leanback]
[corbind-lifecycle]
[corbind-material]
[corbind-navigation]
[corbind-recyclerview]
[corbind-slidingpanelayout]
[corbind-swiperefreshlayout]
[corbind-viewpager]
[corbind-viewpager2]
* [corbind]
* [corbind-activity]
* [corbind-appcompat]
* [corbind-core]
* [corbind-drawerlayout]
* [corbind-fragment]
* [corbind-leanback]
* [corbind-lifecycle]
* [corbind-material]
* [corbind-navigation]
* [corbind-recyclerview]
* [corbind-slidingpanelayout]
* [corbind-swiperefreshlayout]
* [corbind-viewpager]
* [corbind-viewpager2]


## How to use it?
Expand Down Expand Up @@ -146,7 +152,7 @@ If I forgot something or you have any ideas what can be added or corrected, plea
## License

```
Copyright 2019-2022 Vladimir Raupov
Copyright 2019-2023 Vladimir Raupov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ plugins {
group = "ru.ldralighieri.corbind.buildlogic"

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DokkaConventionPlugin : Plugin<Project> {

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.named("main") {
jdkVersion.set(JavaVersion.VERSION_11.majorVersion.toInt())
jdkVersion.set(JavaVersion.VERSION_17.majorVersion.toInt())

skipDeprecated.set(false)
reportUndocumented.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class SpotlessConventionPlugin : Plugin<Project> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")

ktlint(libs.findVersion("ktlint").get().toString())
.editorConfigOverride(mapOf("disabled_rules" to "filename"))

licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ internal fun Project.configureKotlinAndroid(
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()

// Treat all Kotlin warnings as errors
allWarningsAsErrors = true
Expand Down
4 changes: 4 additions & 0 deletions build-logic/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Gradle
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
Binary file added build-logic/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions build-logic/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Dec 04 14:00:15 VLAT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
1 change: 1 addition & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ dependencyResolutionManagement {
}
}

rootProject.name = "build-logic"
include(":convention")
15 changes: 7 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.gitlab.arturbosch.detekt.Detekt

buildscript {
dependencies {
classpath(libs.bundles.plugins)
}
}

plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.gver)
}
Expand Down Expand Up @@ -55,7 +54,7 @@ detekt {
}

tasks.withType<Detekt>().configureEach {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
reports {
html.required.set(true)
xml.required.set(false)
Expand All @@ -66,7 +65,7 @@ tasks.withType<Detekt>().configureEach {

// Dependency updates
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL").any { version.toUpperCase().contains(it) }
val stableKeyword = listOf("RELEASE", "FINAL").any { version.contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
Expand Down
8 changes: 5 additions & 3 deletions corbind-activity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

To add androidx activity bindings, import `corbind-activity` module:

```groovy
implementation 'ru.ldralighieri.corbind:corbind-activity:1.6.0'
```kotlin
dependencies {
implementation("ru.ldralighieri.corbind:corbind-activity:1.7.0")
}
```

## List of extensions
Expand All @@ -17,7 +19,7 @@ Component | Extension | Description
## Simple examples

```kotlin
onBackPressedDispatcher.backPresses(lifecycleOwner = this)
onBackPressedDispatcher.backPresses(lifecycleOwner = this) // Flow<Unit>
.onEach { /* handle onBackPressed event */ }
.flowWithLifecycle(lifecycle)
.launchIn(lifecycleScope) // lifecycle-runtime-ktx
Expand Down
6 changes: 4 additions & 2 deletions corbind-appcompat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

To add androidx appcompat bindings, import `corbind-appcompat` module:

```groovy
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.6.0'
```kotlin
dependencies {
implementation("ru.ldralighieri.corbind:corbind-appcompat:1.7.0")
}
```

## List of extensions
Expand Down
Loading

0 comments on commit 50832a4

Please sign in to comment.