Skip to content

Commit 6859883

Browse files
Merge pull request #49 from Omega-R/develop
Develop
2 parents e161083 + acd314a commit 6859883

File tree

22 files changed

+592
-85
lines changed

22 files changed

+592
-85
lines changed

Crash/build.gradle

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ android {
77
compileSdkVersion 31
88

99
defaultConfig {
10-
minSdkVersion 16
10+
minSdkVersion 19
1111
targetSdkVersion 31
12-
versionCode 1
13-
versionName "1.0"
1412

1513
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1614
consumerProguardFiles "consumer-rules.pro"
@@ -23,11 +21,8 @@ android {
2321
}
2422
}
2523
compileOptions {
26-
sourceCompatibility JavaVersion.VERSION_1_8
27-
targetCompatibility JavaVersion.VERSION_1_8
28-
}
29-
kotlinOptions {
30-
jvmTarget = '1.8'
24+
sourceCompatibility JavaVersion.VERSION_17
25+
targetCompatibility JavaVersion.VERSION_17
3126
}
3227
}
3328

annotations/src/main/java/com/omega_r/base/annotations/AutoPresenterLauncher.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ android {
3232

3333

3434
compileOptions {
35-
sourceCompatibility JavaVersion.VERSION_1_8
36-
targetCompatibility JavaVersion.VERSION_1_8
35+
sourceCompatibility JavaVersion.VERSION_17
36+
targetCompatibility JavaVersion.VERSION_17
3737
}
3838

39-
kotlinOptions.jvmTarget = "1.8"
4039

4140
}
4241

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
package com.omega_r.base.simple
22

33
import android.os.SystemClock
4-
import com.omega_r.base.annotations.AutoPresenterLauncher
54
import com.omega_r.base.mvp.presenters.OmegaPresenter
5+
import com.omega_r.base.simple.dialog_fragment.DialogScreenFactory
66
import com.omega_r.libs.omegatypes.Text
7-
import com.omegar.mvp.InjectViewState
87
import java.io.Serializable
98

109
/**
1110
* Created by Anton Knyazev on 06.05.19.
1211
*/
1312
typealias TestEntity2 = TestEntity
14-
@AutoPresenterLauncher(MainActivity::class, TestFragment::class)
15-
@InjectViewState
1613
class MainPresenter(testEntity: TestEntity?, t2: TestEntity2?): OmegaPresenter<MainView>() {
1714

1815
companion object {
@@ -25,8 +22,7 @@ class MainPresenter(testEntity: TestEntity?, t2: TestEntity2?): OmegaPresenter<M
2522
lastTime = SystemClock.elapsedRealtime()
2623

2724
if (testEntity == null) {
28-
// MainActivity::class.createLauncher(testEntity, t2).launch()
29-
MainPresenterFactory.createMainActivityLauncher(TestEntity(), TestEntity()).launch()
25+
MainScreenFactory.createLauncher(TestEntity(), TestEntity()).launch()
3026
} else {
3127
println("TestAnt: $time")
3228
viewState.showToast(Text.from(time.toString()))
@@ -45,8 +41,7 @@ class MainPresenter(testEntity: TestEntity?, t2: TestEntity2?): OmegaPresenter<M
4541
// }
4642
// }
4743

48-
// DialogDialogFragment.createLauncher()
49-
// .launch()
44+
DialogScreenFactory.createLauncher().launch()
5045
// viewState.showMe
5146
// log {
5247
// "Message"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.omega_r.base.simple
2+
3+
import com.omega_r.base.settings.BaseSettings
4+
import com.omega_r.base.settings.SettingStorage
5+
import com.squareup.moshi.Moshi
6+
import com.squareup.moshi.adapter
7+
8+
class Settings(setting: SettingStorage, moshi: Moshi): BaseSettings(setting) {
9+
10+
var firstLaunch by provideBoolean(key = "jklh", defaultValue = false, label = "possim")
11+
12+
@OptIn(ExperimentalStdlibApi::class)
13+
var session: Session? by provideAnyJson(key = "", defaultValue = null, label = "sdf", moshi.adapter())
14+
15+
class Session(val token: String, val refreshToken: String)
16+
17+
}

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@ 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.ktx.providePresenter
109

1110
/**
1211
* Created by Anton Knyazev on 10.03.2020.
1312
*/
1413
@OmegaContentView(R.layout.activity_main)
1514
class DialogDialogFragment : OmegaDialogFragment(), DialogView {
1615

17-
companion object {
18-
fun createLauncher() = createDialogFragmentLauncher()
19-
}
2016

21-
override val presenter: DialogPresenter by providePresenter {
22-
DialogPresenter()
23-
}
17+
override val presenter: DialogPresenter by providePresenter()
2418

2519
override fun onCreate(savedInstanceState: Bundle?) {
2620
super.onCreate(savedInstanceState)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
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
54

65
/**
76
* Created by Anton Knyazev on 10.03.2020.
87
*/
9-
@InjectViewState
108
class DialogPresenter : OmegaPresenter<DialogView>() {
119

1210
}

build.gradle

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

77
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
@@ -10,8 +10,8 @@ buildscript {
1010
}
1111
}
1212
plugins {
13-
id 'com.android.application' version '7.3.0' apply false
14-
id 'com.android.library' version '7.3.0' apply false
13+
id 'com.android.application' version '7.4.2' apply false
14+
id 'com.android.library' version '7.4.2' apply false
1515
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
1616
id 'org.jetbrains.kotlin.jvm' version '1.9.0' apply false
1717
id 'com.google.devtools.ksp' version '1.9.0-1.0.11' apply false

core/build.gradle

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ android {
3636
defaultConfig {
3737
minSdkVersion 21
3838
targetSdkVersion 31
39-
versionCode 1
40-
versionName "1.0"
4139

4240
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4341

@@ -51,20 +49,10 @@ android {
5149
}
5250

5351
compileOptions {
54-
sourceCompatibility JavaVersion.VERSION_1_8
55-
targetCompatibility JavaVersion.VERSION_1_8
52+
sourceCompatibility JavaVersion.VERSION_17
53+
targetCompatibility JavaVersion.VERSION_17
5654
}
5755

58-
kotlinOptions.jvmTarget = "1.8"
59-
60-
kapt {
61-
arguments {
62-
arg("moxyReflectorPackage", 'com.omega_r.base')
63-
}
64-
}
65-
ksp {
66-
arg("moxyReflectorPackage", 'com.omega_r.base')
67-
}
6856
}
6957

7058

@@ -90,7 +78,7 @@ dependencies {
9078
api 'com.github.Omega-R.OmegaIntentBuilder:core:1.3.4'
9179
api 'com.github.Omega-R.OmegaLaunchers:omegalauncherslib:1.0.6'
9280
api 'com.github.Omega-R:OmegaExtensions:1.0.6'
93-
api 'com.github.Omega-R.OmegaIntentBuilder:annotations:1.0.5'
81+
api 'com.github.Omega-R.OmegaIntentBuilder:annotations:1.3.4'
9482
api 'com.github.Omega-R:OmegaBind:1.0.5'
9583
api 'com.github.Omega-R:OmegaClicks:1.0.0'
9684
api 'com.github.Omega-R:OmegaAdapters:1.0.3'
@@ -99,7 +87,7 @@ dependencies {
9987
api project(':annotations')
10088

10189
api "com.squareup.retrofit2:retrofit:2.9.0"
102-
api "com.squareup.moshi:moshi-kotlin:1.11.0"
90+
api "com.squareup.moshi:moshi-kotlin:1.14.0"
10391

10492
// define any required OkHttp artifacts without version
10593
api "com.squareup.okhttp3:okhttp:3.14.9"

core/src/main/java/com/omega_r/base/data/OmegaBaseRepository.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ open class OmegaBaseRepository<SOURCE : Source>(
2727

2828
protected val coroutineScope = CoroutineScope(Dispatchers.Background + job)
2929

30+
override var mockMode: Boolean = false
31+
3032
protected val remoteSource: SOURCE? = sources.firstOrNull { it.type == Source.Type.REMOTE }
3133

3234
protected val memorySource: SOURCE?
@@ -49,6 +51,9 @@ open class OmegaBaseRepository<SOURCE : Source>(
4951
return result
5052
}
5153

54+
private val generalSource: SOURCE?
55+
get() = if (mockMode) mockSource else remoteSource
56+
5257
protected fun <R> createChannel(strategy: Strategy, block: suspend SOURCE.() -> R): ReceiveChannel<R> {
5358
return coroutineScope.produce {
5459
try {

0 commit comments

Comments
 (0)