Skip to content

Commit

Permalink
Merge pull request #16 from LDRAlighieri/add/readme-links
Browse files Browse the repository at this point in the history
Add README links
  • Loading branch information
LDRAlighieri authored Jun 15, 2023
2 parents 27c4e98 + b612aa9 commit 67f5d59
Show file tree
Hide file tree
Showing 20 changed files with 306 additions and 180 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ jobs:
- name: Setup Gradle
uses: gradle/[email protected]

- name: Check spotless
run: ./gradlew spotlessCheck --no-configuration-cache

- name: Build the sample app to verify it works
run: ./gradlew sample:assemble
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Setup Gradle
uses: gradle/[email protected]

- name: Check spotless
run: ./gradlew spotlessCheck --no-configuration-cache

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import com.android.build.api.dsl.CommonExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.provideDelegate
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

internal fun Project.configureKotlinAndroid(
Expand All @@ -38,25 +40,29 @@ internal fun Project.configureKotlinAndroid(
this.minSdk = minSdk.toInt()
}

kotlin {
jvmToolchain(17)
}

// Remove this after https://issuetracker.google.com/issues/260059413 is fixed
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()

// Treat all Kotlin warnings as errors
allWarningsAsErrors = true

freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
"-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi"
)
}
}
}

private fun Project.kotlin(action: KotlinAndroidProjectExtension.() -> Unit) =
extensions.configure(action)

private fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
}
40 changes: 0 additions & 40 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@
*/

import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.gitlab.arturbosch.detekt.Detekt

// https://youtrack.jetbrains.com/issue/KTIJ-19369
@Suppress("DSL_SCOPE_VIOLATION")
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.binary.compatibility.validator)
alias(libs.plugins.detekt)
alias(libs.plugins.gver)
}

Expand All @@ -36,42 +32,6 @@ apiValidation {
ignoredPackages.add("ru/ldralighieri/corbind/internal")
}

// Detekt
detekt {
allRules = false
buildUponDefaultConfig = true

config = files("default-detekt-config.yml")
source = files(
"corbind/src/main/kotlin",
"corbind-activity/src/main/kotlin",
"corbind-appcompat/src/main/kotlin",
"corbind-core/src/main/kotlin",
"corbind-drawerlayout/src/main/kotlin",
"corbind-fragment/src/main/kotlin",
"corbind-leanback/src/main/kotlin",
"corbind-lifecycle/src/main/kotlin",
"corbind-material/src/main/kotlin",
"corbind-navigation/src/main/kotlin",
"corbind-recyclerview/src/main/kotlin",
"corbind-slidingpanelayout/src/main/kotlin",
"corbind-swiperefreshlayout/src/main/kotlin",
"corbind-viewpager/src/main/kotlin",
"corbind-viewpager2/src/main/kotlin"
)
parallel = true
}

tasks.withType<Detekt>().configureEach {
jvmTarget = JavaVersion.VERSION_17.toString()
reports {
html.required.set(true)
xml.required.set(false)
txt.required.set(false)
sarif.required.set(false)
}
}

// Dependency updates
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL").any { version.contains(it) }
Expand Down
4 changes: 3 additions & 1 deletion corbind-activity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

Component | Extension | Description
--|---|--
**OnBackPressedDispatcher** | `backPresses` | Called when OnBackPressedDispatcher.onBackPressed triggered.
**OnBackPressedDispatcher** | [`backPresses`][OnBackPressedDispatcher_backPresses] | Called when OnBackPressedDispatcher.onBackPressed triggered.


## Simple examples
Expand All @@ -26,3 +26,5 @@ onBackPressedDispatcher.backPresses(lifecycleOwner = this) // Flow<Unit>
```

More examples in source code

[OnBackPressedDispatcher_backPresses]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-activity/src/main/kotlin/ru/ldralighieri/corbind/activity/OnBackPressedDispatcherBackPresses.kt
22 changes: 15 additions & 7 deletions corbind-appcompat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ dependencies {

Component | Extension | Description
--|---|--
**ActionMenuView** | `itemClicks` | Called when a menu item is clicked if the item itself did not already handle the event.
**PopupMenu** | `dismisses` | Called when the associated menu has been dismissed.
  | `itemClicks` | Called when a menu item is clicked if the item itself did not already handle the event.
**SearchView** | `queryTextChanges` | Called when the query text is changed by the user.
  | `queryTextChangeEvents` | A more advanced version of the `queryTextChanges`.
**Toolbar** | `itemClicks` | Called when a menu item is clicked if the item itself did not already handle the event.
  | `navigationClicks` | Called whenever the user clicks the navigation button at the start of the toolbar.
**ActionMenuView** | [`itemClicks`][ActionMenuView_itemClicks] | Called when a menu item is clicked if the item itself did not already handle the event.
**PopupMenu** | [`dismisses`][PopupMenu_dismisses] | Called when the associated menu has been dismissed.
  | [`itemClicks`][PopupMenu_itemClicks] | Called when a menu item is clicked if the item itself did not already handle the event.
**SearchView** | [`queryTextChanges`][SearchView_queryTextChanges] | Called when the query text is changed by the user.
  | [`queryTextChangeEvents`][SearchView_queryTextChangeEvents] | A more advanced version of the `queryTextChanges`.
**Toolbar** | [`itemClicks`][Toolbar_itemClicks] | Called when a menu item is clicked if the item itself did not already handle the event.
  | [`navigationClicks`][Toolbar_navigationClicks] | Called whenever the user clicks the navigation button at the start of the toolbar.


## Example
Expand All @@ -32,3 +32,11 @@ toolbar.itemClicks() // Flow<MenuItem>
```

More examples in source code

[ActionMenuView_itemClicks]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/ActionMenuViewItemClicks.kt
[PopupMenu_dismisses]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/PopupMenuDismisses.kt
[PopupMenu_itemClicks]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/PopupMenuItemClicks.kt
[SearchView_queryTextChanges]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/SearchViewQueryTextChanges.kt
[SearchView_queryTextChangeEvents]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/SearchViewQueryTextChangeEvents.kt
[Toolbar_itemClicks]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/ToolbarItemClicks.kt
[Toolbar_navigationClicks]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-appcompat/src/main/kotlin/ru/ldralighieri/corbind/appcompat/ToolbarNavigationClicks.kt
4 changes: 3 additions & 1 deletion corbind-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

Component | Extension | Description
--|---|--
**NestedScrollView** | `scrollChangeEvents` | Called when the scroll position of a view changes.
**NestedScrollView** | [`scrollChangeEvents`][NestedScrollView_scrollChangeEvents] | Called when the scroll position of a view changes.


## Example
Expand All @@ -26,3 +26,5 @@ scrollView.scrollChangeEvents() // Flow<ViewScrollChangeEvent>
```

More examples in source code

[NestedScrollView_scrollChangeEvents]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-core/src/main/kotlin/ru/ldralighieri/corbind/core/NestedScrollViewScrollChangeEvents.kt
4 changes: 3 additions & 1 deletion corbind-drawerlayout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

Component | Extension | Description
--|---|--
**DrawerLayout** | `drawerOpens` | Called when a drawer has settled in a completely open or close state.
**DrawerLayout** | [`drawerOpens`][DrawerLayout_drawerOpens] | Called when a drawer has settled in a completely open or close state.


## Example
Expand All @@ -28,3 +28,5 @@ drawer.drawerOpens() // Flow<Boolean>
```

More examples in source code

[DrawerLayout_drawerOpens]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-drawerlayout/src/main/kotlin/ru/ldralighieri/corbind/drawerlayout/DrawerLayoutDrawerOpen.kt
4 changes: 3 additions & 1 deletion corbind-fragment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

Component | Extension | Description
--|---|--
**FragmentManager** | `resultEvents` | Called when any results set by setFragmentResult using the same requestKey.
**FragmentManager** | [`resultEvents`][FragmentManager_resultEvents] | Called when any results set by setFragmentResult using the same requestKey.


## Simple examples
Expand All @@ -30,3 +30,5 @@ lifecycleScope.launchWhenStarted {
```

More examples in source code

[FragmentManager_resultEvents]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-fragment/src/main/kotlin/ru/ldralighieri/corbind/fragment/FragmentManagerResultEvents.kt
10 changes: 7 additions & 3 deletions corbind-leanback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ dependencies {

Component | Extension | Description
--|---|--
**SearchBar** | `searchQueryChanges` | Called when the search bar detects a change in the query.
  | `searchQueryChangeEvents` | A more advanced version of the `searchQueryChanges`.
**SearchEditText** | `keyboardDismisses` | Called when the keyboard is dismissed.
**SearchBar** | [`searchQueryChanges`][SearchBar_searchQueryChanges] | Called when the search bar detects a change in the query.
  | [`searchQueryChangeEvents`][SearchBar_searchQueryChangeEvents] | A more advanced version of the `searchQueryChanges`.
**SearchEditText** | [`keyboardDismisses`][SearchEditText_keyboardDismisses] | Called when the keyboard is dismissed.


## Example
Expand All @@ -29,3 +29,7 @@ search.searchQueryChanges() // Flow<String>
```

More examples in source code

[SearchBar_searchQueryChanges]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-leanback/src/main/kotlin/ru/ldralighieri/corbind/leanback/SearchBarSearchQueryChanges.kt
[SearchBar_searchQueryChangeEvents]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-leanback/src/main/kotlin/ru/ldralighieri/corbind/leanback/SearchBarSearchQueryChangeEvents.kt
[SearchEditText_keyboardDismisses]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-leanback/src/main/kotlin/ru/ldralighieri/corbind/leanback/SearchEditTextKeyboardDismisses.kt
4 changes: 3 additions & 1 deletion corbind-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

Component | Extension | Description
--|---|--
**Lifecycle** | `events` | Called when any lifecycle event change.
**Lifecycle** | [`events`][Lifecycle_events] | Called when any lifecycle event change.


## Simple examples
Expand All @@ -27,3 +27,5 @@ lifecycle.events() // Flow<Lifecycle.Event>
```

More examples in source code

[Lifecycle_events]: https://github.com/LDRAlighieri/Corbind/blob/master/corbind-lifecycle/src/main/kotlin/ru/ldralighieri/corbind/lifecycle/LifecycleEvents.kt
Loading

0 comments on commit 67f5d59

Please sign in to comment.