From 1ea37a82ab8df841af037fd89cbef205e60feafa Mon Sep 17 00:00:00 2001 From: Zhuinden Date: Thu, 24 Dec 2020 01:50:46 +0100 Subject: [PATCH] 1.2.0: Update Event-Emitter to 1.2.0, update Kotlin to 1.4.21 --- CHANGELOG.md | 8 + README.md | 2 +- build.gradle | 5 +- gradle/wrapper/gradle-wrapper.properties | 4 +- live-event-sample/build.gradle | 25 +-- .../application/MainActivity.kt | 9 +- .../features/words/NewWordKey.kt | 2 +- .../features/words/WordListAdapter.kt | 7 +- .../features/words/WordListKey.kt | 2 +- .../src/main/res/layout/activity_main.xml | 2 +- live-event/build.gradle | 9 +- live-event/command-queue-command-queue.iml | 171 ------------------ live-event/event-emitter-event-emitter.iml | 147 --------------- .../java/com/zhuinden/liveevent/LiveEvent.kt | 5 +- local.properties | 4 +- 15 files changed, 41 insertions(+), 361 deletions(-) delete mode 100644 live-event/command-queue-command-queue.iml delete mode 100644 live-event/event-emitter-event-emitter.iml diff --git a/CHANGELOG.md b/CHANGELOG.md index 324e44c..04ac4de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change log +-Live-Event 1.2.0 (2020-12-24) +-------------------------------- +- Update event-emitter to 1.2.0 (transitively update command-queue to 1.2.0). + +- Update Kotlin to 1.4.21. + +- Use `` as per new standards in Kotlin 1.4.21. + -Live-Event 1.1.0 (2020-10-23) -------------------------------- - BREAKING (-_-) CHANGE: Package was changed from `com.zhuinden.liveeventsample.utils` to `com.zhuinden.liveevent`, so it's advised to change the imports. diff --git a/README.md b/README.md index bbce734..6d3f9dd 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ In order to use Live Event, you need to add jitpack to your project root gradle: and add the compile dependency to your module level gradle. - implementation 'com.github.Zhuinden:live-event:1.1.0' + implementation 'com.github.Zhuinden:live-event:1.2.0' ## License diff --git a/build.gradle b/build.gradle index c1c1b5f..5edd59d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.0' repositories { google() mavenCentral() @@ -11,9 +10,9 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.1' + classpath 'com.android.tools.build:gradle:4.1.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 966de82..1ba5756 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Aug 27 18:02:55 CEST 2020 +#Thu Dec 24 01:45:10 CET 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip diff --git a/live-event-sample/build.gradle b/live-event-sample/build.gradle index e895469..36f6224 100644 --- a/live-event-sample/build.gradle +++ b/live-event-sample/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-parcelize' apply plugin: 'kotlin-kapt' android { @@ -35,20 +35,11 @@ android { } } -kapt { - generateStubs = true -} - -androidExtensions { - experimental = true -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(path: ':live-event') - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.3.1' + implementation 'androidx.core:core-ktx:1.3.2' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' @@ -57,20 +48,18 @@ dependencies { implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0" implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'com.google.android.material:material:1.2.0' + implementation 'com.google.android.material:material:1.2.1' androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { exclude group: 'com.android.support', module: 'support-annotations' }) - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.1' - implementation "io.reactivex.rxjava2:rxjava:2.2.19" + implementation "io.reactivex.rxjava2:rxjava:2.2.20" implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'com.jakewharton.rxbinding2:rxbinding:2.2.0' implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1' - implementation 'com.github.Zhuinden:simple-stack:2.4.0' - implementation 'com.github.Zhuinden:simple-stack-extensions:2.0.0' - - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation 'com.github.Zhuinden:simple-stack:2.5.0' + implementation 'com.github.Zhuinden:simple-stack-extensions:2.1.0' } \ No newline at end of file diff --git a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/application/MainActivity.kt b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/application/MainActivity.kt index d2b6463..a867cc3 100644 --- a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/application/MainActivity.kt +++ b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/application/MainActivity.kt @@ -1,16 +1,17 @@ package com.zhuinden.liveeventsample.application import android.os.Bundle +import android.view.Window import androidx.appcompat.app.AppCompatActivity import com.zhuinden.simplestack.History import com.zhuinden.simplestack.StateChange import com.zhuinden.simplestack.navigator.Navigator import com.zhuinden.liveeventsample.R +import com.zhuinden.liveeventsample.databinding.ActivityMainBinding import com.zhuinden.liveeventsample.features.words.WordListKey import com.zhuinden.simplestack.SimpleStateChanger import com.zhuinden.simplestackextensions.fragments.DefaultFragmentStateChanger import com.zhuinden.simplestackextensions.services.DefaultServiceProvider -import kotlinx.android.synthetic.main.activity_main.* /** * Created by Zhuinden on 2020. @@ -23,12 +24,14 @@ class MainActivity : AppCompatActivity(), SimpleStateChanger.NavigationHandler { setContentView(R.layout.activity_main) - fragmentStateChanger = DefaultFragmentStateChanger(supportFragmentManager, R.id.root) + val binding = ActivityMainBinding.bind(findViewById(Window.ID_ANDROID_CONTENT)) + + fragmentStateChanger = DefaultFragmentStateChanger(supportFragmentManager, R.id.fragmentRoot) Navigator.configure() .setStateChanger(SimpleStateChanger(this)) .setScopedServices(DefaultServiceProvider()) - .install(this, root, History.of(WordListKey())) + .install(this, binding.fragmentRoot, History.of(WordListKey())) } override fun onBackPressed() { diff --git a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/NewWordKey.kt b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/NewWordKey.kt index 8cad5d0..e1b6aec 100644 --- a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/NewWordKey.kt +++ b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/NewWordKey.kt @@ -2,7 +2,7 @@ package com.zhuinden.liveeventsample.features.words import androidx.fragment.app.Fragment import com.zhuinden.simplestackextensions.fragments.DefaultFragmentKey -import kotlinx.android.parcel.Parcelize +import kotlinx.parcelize.Parcelize /** * Created by Zhuinden on 2020. diff --git a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListAdapter.kt b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListAdapter.kt index a111aa9..a269b83 100644 --- a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListAdapter.kt +++ b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListAdapter.kt @@ -2,11 +2,10 @@ package com.zhuinden.liveeventsample.features.words import android.view.View import android.view.ViewGroup +import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.zhuinden.liveeventsample.R import com.zhuinden.liveeventsample.utils.inflate -import kotlinx.android.extensions.LayoutContainer -import kotlinx.android.synthetic.main.word_list_item.* import java.util.* class WordListAdapter : RecyclerView.Adapter() { @@ -26,7 +25,9 @@ class WordListAdapter : RecyclerView.Adapter() { holder.bind(list[position]) } - class ViewHolder(override val containerView: View) : RecyclerView.ViewHolder(containerView), LayoutContainer { + class ViewHolder(containerView: View) : RecyclerView.ViewHolder(containerView) { + private val text = containerView.findViewById(R.id.text) + fun bind(word: String) { text.text = word } diff --git a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListKey.kt b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListKey.kt index 72cf08c..3193192 100644 --- a/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListKey.kt +++ b/live-event-sample/src/main/java/com/zhuinden/liveeventsample/features/words/WordListKey.kt @@ -7,7 +7,7 @@ import com.zhuinden.simplestackextensions.services.DefaultServiceProvider import com.zhuinden.simplestackextensions.servicesktx.add import com.zhuinden.simplestackextensions.servicesktx.get import com.zhuinden.simplestackextensions.servicesktx.rebind -import kotlinx.android.parcel.Parcelize +import kotlinx.parcelize.Parcelize /** * Created by Zhuinden on 2020. diff --git a/live-event-sample/src/main/res/layout/activity_main.xml b/live-event-sample/src/main/res/layout/activity_main.xml index e8b9dc9..e77a2f8 100644 --- a/live-event-sample/src/main/res/layout/activity_main.xml +++ b/live-event-sample/src/main/res/layout/activity_main.xml @@ -6,7 +6,7 @@ android:orientation="vertical"> diff --git a/live-event/build.gradle b/live-event/build.gradle index 0286484..7fd2d24 100644 --- a/live-event/build.gradle +++ b/live-event/build.gradle @@ -26,19 +26,16 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - api "com.google.code.findbugs:jsr305:3.0.2" api "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0" api "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0" - api 'com.github.Zhuinden:event-emitter:1.1.0' + api 'com.github.Zhuinden:event-emitter:1.2.0' - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.1' testImplementation 'org.assertj:assertj-core:3.16.1' testImplementation 'org.mockito:mockito-core:3.4.4' - testImplementation 'org.robolectric:robolectric:3.4.2' testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3' - androidTestImplementation 'junit:junit:4.13' + androidTestImplementation 'junit:junit:4.13.1' androidTestImplementation 'com.github.Zhuinden:espresso-helper:1.0.0' } diff --git a/live-event/command-queue-command-queue.iml b/live-event/command-queue-command-queue.iml deleted file mode 100644 index 9ba9e7b..0000000 --- a/live-event/command-queue-command-queue.iml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/live-event/event-emitter-event-emitter.iml b/live-event/event-emitter-event-emitter.iml deleted file mode 100644 index aa721f2..0000000 --- a/live-event/event-emitter-event-emitter.iml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/live-event/src/main/java/com/zhuinden/liveevent/LiveEvent.kt b/live-event/src/main/java/com/zhuinden/liveevent/LiveEvent.kt index 98046ab..3c2a3f0 100644 --- a/live-event/src/main/java/com/zhuinden/liveevent/LiveEvent.kt +++ b/live-event/src/main/java/com/zhuinden/liveevent/LiveEvent.kt @@ -61,9 +61,10 @@ internal class LiveEvent constructor( } } -inline fun EventSource.observe(lifecycleOwner: LifecycleOwner, crossinline eventObserver: (T) -> Unit) { +inline fun EventSource.observe(lifecycleOwner: LifecycleOwner, crossinline eventObserver: (T) -> Unit) { LiveEvent( this, lifecycleOwner, - EventSource.EventObserver { event -> eventObserver.invoke(event) }) + EventSource.EventObserver { event -> eventObserver.invoke(event) } + ) } \ No newline at end of file diff --git a/local.properties b/local.properties index 968eacb..982d75d 100644 --- a/local.properties +++ b/local.properties @@ -4,5 +4,5 @@ # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -#Mon Dec 10 15:14:59 CET 2018 -sdk.dir=/Users/zhuinden/Library/Android/sdk +#Fri Oct 23 14:34:31 CEST 2020 +sdk.dir=G\:\\Android\\sdk