Skip to content

Commit 768b85c

Browse files
committed
Upgrade OmegaMoxy
1 parent 8bc4dc5 commit 768b85c

File tree

15 files changed

+151
-66
lines changed

15 files changed

+151
-66
lines changed

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
43
apply plugin: 'kotlin-kapt'
54
apply plugin: 'com.google.devtools.ksp'
5+
apply plugin: 'kotlin-parcelize'
66

77
android {
88
compileSdkVersion 33
@@ -58,7 +58,7 @@ dependencies {
5858

5959
implementation project(':core')
6060

61-
kapt "com.github.Omega-R.OmegaMoxy:moxy-compiler:${omegaMoxy_version}"
61+
ksp "com.github.Omega-R.OmegaMoxy:moxy-compiler:${omegaMoxy_version}"
6262
kapt project(':processor')
6363

6464
implementation 'com.github.bumptech.glide:glide:4.9.0'

app/src/main/java/com/omega_r/base/simple/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MainActivity : OmegaActivity(R.layout.activity_main), MainView {
5656
}
5757

5858
private val maps: Map<Field, View> by bind(Field.values()) {
59-
showToast(Text.from(it.id.toString()))
59+
//showToast(Text.from(it.id.toString()))
6060
}
6161

6262
override var list: String = ""

app/src/main/java/com/omega_r/base/simple/MainPresenter.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import android.os.SystemClock
44
import com.omega_r.base.annotations.AutoPresenterLauncher
55
import com.omega_r.base.mvp.presenters.OmegaPresenter
66
import com.omega_r.libs.omegatypes.Text
7+
import com.omegar.mvp.InjectViewState
78
import java.io.Serializable
89

910
/**
1011
* Created by Anton Knyazev on 06.05.19.
1112
*/
1213
typealias TestEntity2 = TestEntity
1314
@AutoPresenterLauncher(MainActivity::class, TestFragment::class)
15+
@InjectViewState
1416
class MainPresenter(testEntity: TestEntity?, t2: TestEntity2?): OmegaPresenter<MainView>() {
1517

1618
companion object {
@@ -23,11 +25,13 @@ class MainPresenter(testEntity: TestEntity?, t2: TestEntity2?): OmegaPresenter<M
2325
lastTime = SystemClock.elapsedRealtime()
2426

2527
if (testEntity == null) {
28+
// MainActivity::class.createLauncher(testEntity, t2).launch()
2629
MainPresenterFactory.createMainActivityLauncher(TestEntity(), TestEntity()).launch()
2730
} else {
2831
println("TestAnt: $time")
32+
viewState.showToast(Text.from(time.toString()))
33+
2934
}
30-
viewState.showToast(Text.from(System.getProperty("http.agent")))
3135
viewState.enabled = false
3236
// launch {
3337
// try {
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package com.omega_r.base.simple
22

3-
import android.os.Parcel
43
import android.os.Parcelable
5-
import android.os.Parcelable.Creator
6-
import kotlinx.android.parcel.Parcelize
4+
import kotlinx.parcelize.Parcelize
75
import java.io.Serializable
86

97
@Parcelize
10-
class TestEntity() : Parcelable, Serializable {
8+
class TestEntity : Parcelable, Serializable {
119

1210

1311
}

app/src/main/java/com/omega_r/base/simple/dialog_fragment/DialogDialogFragment.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.omega_r.base.components.OmegaDialogFragment
66
import com.omega_r.base.simple.R
77
import com.omega_r.libs.omegatypes.Text
88
import com.omegar.libs.omegalaunchers.createDialogFragmentLauncher
9-
import com.omegar.mvp.presenter.InjectPresenter
9+
import com.omegar.mvp.ktx.providePresenter
1010

1111
/**
1212
* Created by Anton Knyazev on 10.03.2020.
@@ -18,8 +18,9 @@ class DialogDialogFragment : OmegaDialogFragment(), DialogView {
1818
fun createLauncher() = createDialogFragmentLauncher()
1919
}
2020

21-
@InjectPresenter
22-
override lateinit var presenter: DialogPresenter
21+
override val presenter: DialogPresenter by providePresenter {
22+
DialogPresenter()
23+
}
2324

2425
override fun onCreate(savedInstanceState: Bundle?) {
2526
super.onCreate(savedInstanceState)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.omega_r.base.simple.dialog_fragment
22

33
import com.omega_r.base.mvp.presenters.OmegaPresenter
4+
import com.omegar.mvp.InjectViewState
45

56
/**
67
* Created by Anton Knyazev on 10.03.2020.
78
*/
9+
@InjectViewState
810
class DialogPresenter : OmegaPresenter<DialogView>() {
911

1012
}

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
buildscript {
22
ext {
33
omegaRecyclerView = '1.10.0'
4-
omegaMoxy_version = 'ac9b694b'
4+
omegaMoxy_version = 'fa92b335a3'
55
kotlinCorutines_version = '1.5.0'
66

77
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
@@ -12,9 +12,9 @@ buildscript {
1212
plugins {
1313
id 'com.android.application' version '7.3.0' apply false
1414
id 'com.android.library' version '7.3.0' apply false
15-
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
16-
id 'org.jetbrains.kotlin.jvm' version '1.7.21' apply false
17-
id 'com.google.devtools.ksp' version '1.7.21-1.0.8' apply false
15+
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
16+
id 'org.jetbrains.kotlin.jvm' version '1.9.0' apply false
17+
id 'com.google.devtools.ksp' version '1.9.0-1.0.11' apply false
1818

1919
}
2020

core/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-kapt'
4-
apply plugin: 'kotlin-android-extensions'
4+
apply plugin: 'com.google.devtools.ksp'
55

66
apply plugin: 'maven-publish'
77

@@ -50,10 +50,6 @@ android {
5050
}
5151
}
5252

53-
androidExtensions {
54-
experimental = true
55-
}
56-
5753
compileOptions {
5854
sourceCompatibility JavaVersion.VERSION_1_8
5955
targetCompatibility JavaVersion.VERSION_1_8
@@ -66,6 +62,9 @@ android {
6662
arg("moxyReflectorPackage", 'com.omega_r.base')
6763
}
6864
}
65+
ksp {
66+
arg("moxyReflectorPackage", 'com.omega_r.base')
67+
}
6968
}
7069

7170

@@ -82,7 +81,7 @@ dependencies {
8281

8382
api "com.github.Omega-R.OmegaMoxy:moxy:${omegaMoxy_version}"
8483
api "com.github.Omega-R.OmegaMoxy:moxy-androidx:${omegaMoxy_version}"
85-
kapt "com.github.Omega-R.OmegaMoxy:moxy-compiler:${omegaMoxy_version}"
84+
ksp "com.github.Omega-R.OmegaMoxy:moxy-compiler:${omegaMoxy_version}"
8685

8786

8887
api "com.github.Omega-R.OmegaRecyclerView:omegarecyclerview:${omegaRecyclerView}@aar"

0 commit comments

Comments
 (0)