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 13, 2022
2 parents 8d643de + e307fbe commit 85fbaba
Show file tree
Hide file tree
Showing 161 changed files with 564 additions and 635 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# ChangeLog


## Version 1.5.3

* Update: Kotlin modules dependency to v1.6.10.
* Update: Kotlin coroutines modules dependency to v1.6.0.
* Update: Material components dependency to v1.5.0.
* Update: Minor update of other libraries.
* Add: Version catalogs.


## Version 1.5.2

* Update: `BottomNavigationView` extensions replaced by `NavigationBarView` extensions.
Expand Down
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![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.5.20-blue.svg)](https://kotlinlang.org)
[![Kotlin Coroutines Version](https://img.shields.io/badge/Coroutines-v1.5.0-blue.svg)](https://kotlinlang.org/docs/reference/coroutines-overview.html)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.6.10-blue.svg)](https://kotlinlang.org)
[![Kotlin Coroutines Version](https://img.shields.io/badge/Coroutines-v1.6.0-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://www.codacy.com/app/LDRAlighieri/Corbind?utm_source=github.com&utm_medium=referral&utm_content=LDRAlighieri/Corbind&utm_campaign=Badge_Grade)
Expand All @@ -25,28 +25,28 @@ This library is for Android applications only. Help you to transform Android UI

Platform bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind:1.5.3'
```

AndroidX library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-activity:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-core:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-lifecycle:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-navigation:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-viewpager2:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-activity:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-core:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-lifecycle:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-navigation:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.5.3'
implementation 'ru.ldralighieri.corbind:corbind-viewpager2:1.5.3'
```

Google 'material' library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-material:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-material:1.5.3'
```

Snapshot build:
Expand All @@ -56,12 +56,13 @@ repositories {
}
dependencies {
implementation 'ru.ldralighieri.corbind:{module}:1.5.3-SNAPSHOT'
implementation 'ru.ldralighieri.corbind:{module}:1.5.4-SNAPSHOT'
}
```


## List of extensions

You can find a list of extensions in the description of each module:
[corbind]
[corbind-activity]
Expand All @@ -86,6 +87,7 @@ If you need to get a text change events of EditText widget, simple use case with
findViewById<EditText>(R.id.et_name)
.textChanges() // Flow<CharSequence>
.onEach { /* handle text change events */ }
.flowWithLifecycle(lifecycle)
.launchIn(lifecycleScope) // lifecycle-runtime-ktx
```

Expand Down Expand Up @@ -122,6 +124,7 @@ combine(
transform = { email, password -> email && password }
)
.onEach { bt_login.isEnabled = it }
.flowWithLifecycle(lifecycle)
.launchIn(lifecycleScope) // lifecycle-runtime-ktx
```

Expand All @@ -141,7 +144,7 @@ If I forgot something or you have any ideas what can be added or corrected, plea
## License

```
Copyright 2019-2021 Vladimir Raupov
Copyright 2019-2022 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
166 changes: 63 additions & 103 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,117 +14,51 @@
* limitations under the License.
*/

buildscript {

ext {
versions = [
'kotlin': '1.5.20',
'kotlin_coroutines': '1.5.0',
'android_gradle': '4.2.2',
'androidx': [
'core': '1.6.0',
'annotation': '1.2.0',
'appcompat': '1.3.0',
'drawerlayout': '1.1.1',
'leanback': '1.0.0',
'navigation': '2.3.5',
'recyclerview': '1.2.1',
'slidingpanelayout': '1.1.0',
'swiperefreshlayout': '1.1.0',
'viewpager': '1.0.0',
'viewpager2': '1.0.0',
'lifecycle': '2.3.1',
'activity': '1.2.3'
],
'material': '1.4.0',
'ktlint': '0.40.0',
'dokka': '0.10.1'
]

deps = [
'kotlin': [
'stdlib': [
'jdk6': "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}",
'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}"
]
],
'androidx': [
'core': "androidx.core:core:${versions.androidx.core}",
'annotation': "androidx.annotation:annotation:${versions.androidx.annotation}",
'appcompat': "androidx.appcompat:appcompat:${versions.androidx.appcompat}",
'drawerlayout': "androidx.drawerlayout:drawerlayout:${versions.androidx.drawerlayout}",
'leanback': "androidx.leanback:leanback:${versions.androidx.leanback}",
'navigation': "androidx.navigation:navigation-runtime:${versions.androidx.navigation}",
'recyclerview': "androidx.recyclerview:recyclerview:${versions.androidx.recyclerview}",
'slidingpanelayout': "androidx.slidingpanelayout:slidingpanelayout:${versions.androidx.slidingpanelayout}",
'swiperefreshlayout': "androidx.swiperefreshlayout:swiperefreshlayout:${versions.androidx.swiperefreshlayout}",
'viewpager': "androidx.viewpager:viewpager:${versions.androidx.viewpager}",
'viewpager2': "androidx.viewpager2:viewpager2:${versions.androidx.viewpager2}",
'lifecycle': "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx.lifecycle}",
'activity': "androidx.activity:activity:${versions.androidx.activity}"
],
'material': "com.google.android.material:material:${versions.material}"
]

buildConfig = [
'compileSdk': 30,
'minSdk': 14,
'targetSdk': 30
]
}
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.dokka.gradle.DokkaTask

buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
google()
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
// Android gradle
classpath "com.android.tools.build:gradle:${versions.android_gradle}"

// Kotlin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"

// Dokka
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath(libs.bundles.plugins)
}

}


plugins {
id "com.diffplug.spotless" version "5.14.0"
id 'com.github.ben-manes.versions' version '0.39.0'
id "io.gitlab.arturbosch.detekt" version "1.17.1"
alias(libs.plugins.spotless)
alias(libs.plugins.gver)
alias(libs.plugins.detekt)
alias(libs.plugins.dokka)
}


allprojects {

repositories {
mavenCentral()
google()
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}

}


subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11

group = GROUP
version = VERSION_NAME
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true

// Enable experimental coroutines APIs
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ObsoleteCoroutinesApi"
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
}
}

apply plugin: 'com.diffplug.spotless'
spotless {
Expand All @@ -133,33 +67,55 @@ subprojects {
targetExclude("$buildDir/**/*.kt")
targetExclude('bin/**/*.kt')

ktlint(versions.ktlint)
ktlint(libs.versions.ktlint.get())
licenseHeaderFile rootProject.file('spotless/copyright.kt')
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true

// Enable experimental coroutines APIs
freeCompilerArgs += "-Xuse-experimental=kotlinx.coroutines.ObsoleteCoroutinesApi"
freeCompilerArgs += "-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"
apply plugin: 'org.jetbrains.dokka'
tasks.withType(DokkaTask).configureEach {
dokkaSourceSets {
named("main") {
jdkVersion.set(JavaVersion.VERSION_11.majorVersion.toInteger())
skipDeprecated.set(false)
reportUndocumented.set(false)
skipEmptyPackages.set(true)

sourceLink {
def relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
localDirectory.set(new File("src/main/kotlin"))
remoteUrl.set(new URL("https://github.com/LDRAlighieri/Corbind/tree/master/$relPath/src/main/kotlin"))
remoteLineSuffix.set("#L")
}

externalDocumentationLink {
url.set(new URL("https://developer.android.com/reference/"))
packageListUrl.set(new URL("https://developer.android.com/reference/package-list"))
}

externalDocumentationLink {
url.set(new URL("https://developer.android.com/reference/"))
packageListUrl.set(new URL("https://developer.android.com/reference/androidx/package-list"))
}

externalDocumentationLink {
url.set(new URL("https://developer.android.com/reference/"))
packageListUrl.set(new URL("https://developer.android.com/reference/com/google/android/material/package-list"))
}
}
}
}

}


detekt {
toolVersion = "1.16.0"
toolVersion = libs.versions.detekt.get()

failFast = false
allRules = false
buildUponDefaultConfig = true

config = files("default-detekt-config.yml")
input = files(
source = files(
"corbind/src/main/kotlin",
"corbind-activity/src/main/kotlin",
"corbind-appcompat/src/main/kotlin",
Expand All @@ -176,11 +132,15 @@ detekt {
"corbind-viewpager2/src/main/kotlin"
)
parallel = true
}

tasks.withType(Detekt).configureEach {
jvmTarget = JavaVersion.VERSION_11
reports {
html.enabled = true
xml.enabled = false
txt.enabled = false
html.required.set(true)
xml.required.set(false)
txt.required.set(false)
sarif.required.set(false)
}
}

Expand All @@ -191,7 +151,7 @@ configurations.all {
// Force all Kotlin stdlib artifacts to use the same version.
if (details.requested.group == 'org.jetbrains.kotlin'
&& details.requested.name.startsWith('kotlin-stdlib')) {
details.useVersion versions.kotlin
details.useVersion libs.versions.kotlin.get()
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion corbind-activity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
To add androidx activity bindings, import `corbind-activity` module:

```groovy
implementation 'ru.ldralighieri.corbind:corbind-activity:1.5.2'
implementation 'ru.ldralighieri.corbind:corbind-activity:1.5.3'
```

## List of extensions
Expand All @@ -19,6 +19,7 @@ Component | Extension | Description
```kotlin
requireActivity().onBackPressedDispatcher.backPresses()
.onEach { /* handle onBackPressed event */ }
.flowWithLifecycle(lifecycle)
.launchIn(lifecycleScope) // lifecycle-runtime-ktx
```

Expand Down
Loading

0 comments on commit 85fbaba

Please sign in to comment.