Skip to content

Commit

Permalink
1.2.0: Update Event-Emitter to 1.2.0, update Kotlin to 1.4.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Dec 24, 2020
1 parent 692c138 commit 1ea37a8
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 361 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 `<T: Any>` 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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
25 changes: 7 additions & 18 deletions live-event-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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'

Expand All @@ -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'
}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<WordListAdapter.ViewHolder>() {
Expand All @@ -26,7 +25,9 @@ class WordListAdapter : RecyclerView.Adapter<WordListAdapter.ViewHolder>() {
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<TextView>(R.id.text)

fun bind(word: String) {
text.text = word
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion live-event-sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:orientation="vertical">

<FrameLayout
android:id="@+id/root"
android:id="@+id/fragmentRoot"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
Expand Down
9 changes: 3 additions & 6 deletions live-event/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Loading

0 comments on commit 1ea37a8

Please sign in to comment.