diff --git a/app/build.gradle b/app/build.gradle index 97a40d1..30bbd72 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,6 @@ android { dependencies { implementation "com.google.android.material:material:$versions.googleMaterial" - implementation "androidx.constraintlayout:constraintlayout:$versions.constraintVersion" implementation "androidx.fragment:fragment-ktx:$versions.fragmentVersion" implementation "com.github.bumptech.glide:glide:$versions.glideVersion" diff --git a/app/src/main/java/com/skydoves/bindablesdemo/BindableApp.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/BindableApp.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/BindableApp.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/BindableApp.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/MainActivity.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/MainActivity.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/MainActivity.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/MainActivity.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/MainViewModel.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/MainViewModel.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/MainViewModel.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/MainViewModel.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/MockUtil.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/MockUtil.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/MockUtil.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/MockUtil.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/binding/RecyclerViewBinding.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/binding/RecyclerViewBinding.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/binding/RecyclerViewBinding.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/binding/RecyclerViewBinding.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/binding/ViewBinding.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/binding/ViewBinding.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/binding/ViewBinding.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/binding/ViewBinding.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/fragments/HomeFragment.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/HomeFragment.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/fragments/HomeFragment.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/HomeFragment.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/fragments/LibraryFragment.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/LibraryFragment.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/fragments/LibraryFragment.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/LibraryFragment.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/fragments/MainPagerAdapter.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/MainPagerAdapter.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/fragments/MainPagerAdapter.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/MainPagerAdapter.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/fragments/RadioFragment.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/RadioFragment.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/fragments/RadioFragment.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/fragments/RadioFragment.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/recycler/Poster.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/Poster.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/recycler/Poster.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/Poster.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterAdapter.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterAdapter.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterAdapter.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterAdapter.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterCircleAdapter.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterCircleAdapter.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterCircleAdapter.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterCircleAdapter.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterDiffUtil.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterDiffUtil.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterDiffUtil.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterDiffUtil.kt diff --git a/app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterLineAdapter.kt b/app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterLineAdapter.kt similarity index 100% rename from app/src/main/java/com/skydoves/bindablesdemo/recycler/PosterLineAdapter.kt rename to app/src/main/kotlin/com/skydoves/bindablesdemo/recycler/PosterLineAdapter.kt diff --git a/bindables/build.gradle b/bindables/build.gradle index 7c5bac1..0415cf8 100644 --- a/bindables/build.gradle +++ b/bindables/build.gradle @@ -64,7 +64,6 @@ dependencies { implementation "androidx.appcompat:appcompat:$versions.androidxAppcompat" api "androidx.lifecycle:lifecycle-viewmodel-ktx:$versions.lifecycleVersion" api "androidx.lifecycle:lifecycle-viewmodel-savedstate:$versions.lifecycleVersion" - api "androidx.recyclerview:recyclerview:$versions.recyclerView" } apply plugin: "com.vanniktech.maven.publish" diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingActivity.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingActivity.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingActivity.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingActivity.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingBottomSheetDialogFragment.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingBottomSheetDialogFragment.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingBottomSheetDialogFragment.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingBottomSheetDialogFragment.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingComponentActivity.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingComponentActivity.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingComponentActivity.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingComponentActivity.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingDialogFragment.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingDialogFragment.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingDialogFragment.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingDialogFragment.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingExtensions.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingExtensions.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingExtensions.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingExtensions.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingFragment.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingFragment.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingFragment.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingFragment.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingFragmentActivity.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingFragmentActivity.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingFragmentActivity.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingFragmentActivity.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingInitProvider.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingInitProvider.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingInitProvider.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingInitProvider.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingListAdapter.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingListAdapter.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingListAdapter.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingListAdapter.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingManager.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingManager.kt similarity index 88% rename from bindables/src/main/java/com/skydoves/bindables/BindingManager.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingManager.kt index 24ae6ce..8297e00 100644 --- a/bindables/src/main/java/com/skydoves/bindables/BindingManager.kt +++ b/bindables/src/main/kotlin/com/skydoves/bindables/BindingManager.kt @@ -73,11 +73,11 @@ public object BindingManager { it.getter.hasAnnotation() } ?: throw IllegalArgumentException("KProperty: ${property.name} must be annotated with the `@Bindable` annotation on the getter.") - val propertyName = bindingProperty.name.decapitalize(Locale.ENGLISH) + val propertyName = bindingProperty.name.replaceFirstChar { it.lowercase(Locale.ENGLISH) } val bindingPropertyName = propertyName .takeIf { it.startsWith(JAVA_BEANS_BOOLEAN) } ?.replaceFirst(JAVA_BEANS_BOOLEAN, String()) - ?.decapitalize(Locale.ENGLISH) ?: propertyName + ?.replaceFirstChar { it.lowercase(Locale.ENGLISH) } ?: propertyName return bindingFieldsMap[bindingPropertyName] ?: BR._all } @@ -91,13 +91,22 @@ public object BindingManager { it.hasAnnotation() } ?: throw IllegalArgumentException("KFunction: ${function.name} must be annotated with the `@Bindable` annotation.") - val functionName = bindingFunction.name.decapitalize(Locale.ENGLISH) + val functionName = bindingFunction.name.replaceFirstChar { it.lowercase(Locale.ENGLISH) } val bindingFunctionName = when { - functionName.startsWith(JAVA_BEANS_GETTER) -> functionName.replaceFirst(JAVA_BEANS_GETTER, String()) - functionName.startsWith(JAVA_BEANS_SETTER) -> functionName.replaceFirst(JAVA_BEANS_SETTER, String()) - functionName.startsWith(JAVA_BEANS_BOOLEAN) -> functionName.replaceFirst(JAVA_BEANS_BOOLEAN, String()) + functionName.startsWith(JAVA_BEANS_GETTER) -> functionName.replaceFirst( + JAVA_BEANS_GETTER, + String() + ) + functionName.startsWith(JAVA_BEANS_SETTER) -> functionName.replaceFirst( + JAVA_BEANS_SETTER, + String() + ) + functionName.startsWith(JAVA_BEANS_BOOLEAN) -> functionName.replaceFirst( + JAVA_BEANS_BOOLEAN, + String() + ) else -> throw IllegalArgumentException("@Bindable associated with method must follow JavaBeans convention $functionName") - }.decapitalize(Locale.ENGLISH) + }.replaceFirstChar { it.lowercase(Locale.ENGLISH) } return bindingFieldsMap[bindingFunctionName] ?: BR._all } } diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingModel.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingModel.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingModel.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingModel.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingObservable.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingObservable.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingObservable.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingObservable.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingOnly.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingOnly.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingOnly.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingOnly.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingProperty.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingProperty.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingProperty.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingProperty.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingPropertyDelegate.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingPropertyDelegate.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingPropertyDelegate.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingPropertyDelegate.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingRecyclerViewAdapter.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingRecyclerViewAdapter.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingRecyclerViewAdapter.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingRecyclerViewAdapter.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/BindingViewModel.kt b/bindables/src/main/kotlin/com/skydoves/bindables/BindingViewModel.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/BindingViewModel.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/BindingViewModel.kt diff --git a/bindables/src/main/java/com/skydoves/bindables/FlowBindingProperty.kt b/bindables/src/main/kotlin/com/skydoves/bindables/FlowBindingProperty.kt similarity index 100% rename from bindables/src/main/java/com/skydoves/bindables/FlowBindingProperty.kt rename to bindables/src/main/kotlin/com/skydoves/bindables/FlowBindingProperty.kt diff --git a/dependencies.gradle b/dependencies.gradle index 654fba5..e76f2c2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -20,22 +20,20 @@ ext.versions = [ versionName : '1.0.9', gradleBuildTool : '7.0.2', - spotlessGradle : '5.15.0', + spotlessGradle : '6.1.0', ktlintGradle : '0.41.0', dokkaGradle : '1.4.32', binaryValidator : '0.7.1', mavenPublish : '0.15.1', - kotlin : '1.5.10', - androidxAppcompat: '1.4.0-alpha03', + kotlin : '1.5.32', + androidxAppcompat: '1.4.0', googleMaterial : '1.4.0', - lifecycleVersion : '2.3.1', - recyclerView : '1.2.1', + lifecycleVersion : '2.4.0', // for demo - constraintVersion: '2.0.4', fragmentVersion : '1.2.5', - hiltCoreVersion : '2.38.1', + hiltCoreVersion : '2.40.5', hiltVersion : '1.0.0', glideVersion : '4.12.0', whatIfVersion : '1.1.0',