Skip to content

Commit e92fd06

Browse files
author
Vadim Vasyanin
committed
chage to moxy community
1 parent 528739e commit e92fd06

17 files changed

Lines changed: 67 additions & 52 deletions

File tree

app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ apply plugin: 'kotlin-kapt'
44
apply plugin: 'kotlin-android-extensions'
55

66
android {
7+
compileOptions {
8+
sourceCompatibility 1.8
9+
targetCompatibility 1.8
10+
}
711
compileSdkVersion 29
812
defaultConfig {
913
applicationId "com.infeez.androidmoduleexample"
@@ -36,5 +40,5 @@ dependencies {
3640
androidTestImplementation 'androidx.test:runner:1.2.0'
3741
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3842

39-
kapt 'tech.schoolhelper:moxy-x-compiler:1.7.0'
43+
kapt 'com.github.moxy-community:moxy-compiler:2.0.2'
4044
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools" package="com.infeez.androidmoduleexample">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
6+
57
<application
68
android:name=".MainApplication"
79
android:allowBackup="true"

app/src/main/java/com/infeez/androidmoduleexample/MainActivity.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package com.infeez.androidmoduleexample
22

33
import android.os.Bundle
4-
import com.arellomobile.mvp.MvpAppCompatActivity
5-
import com.arellomobile.mvp.presenter.InjectPresenter
6-
import com.arellomobile.mvp.presenter.ProvidePresenter
74
import com.infeez.androidmoduleexample.navigation.Navigator
5+
import moxy.MvpAppCompatActivity
6+
import moxy.presenter.InjectPresenter
7+
import moxy.presenter.ProvidePresenter
88
import org.koin.android.ext.android.get
99
import org.koin.android.ext.android.inject
10-
import ru.terrakok.cicerone.NavigatorHolder
1110
import ru.terrakok.cicerone.android.support.SupportAppNavigator
12-
import ru.terrakok.cicerone.commands.Command
1311

1412
class MainActivity : MvpAppCompatActivity(), MainView {
1513

app/src/main/java/com/infeez/androidmoduleexample/MainApplication.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package com.infeez.androidmoduleexample
22

33
import android.app.Application
4-
import com.arellomobile.mvp.RegisterMoxyReflectorPackages
54
import org.koin.android.ext.koin.androidContext
65
import org.koin.android.ext.koin.androidLogger
7-
import org.koin.android.logger.AndroidLogger
86
import org.koin.core.context.startKoin
97

10-
@RegisterMoxyReflectorPackages("com.infeez.androidmoduleexample.features", "com.infeez.androidmoduleexample.feature")
8+
// @RegisterMoxyReflectorPackages("com.infeez.androidmoduleexample.features", "com.infeez.androidmoduleexample.feature")
119
class MainApplication : Application() {
1210

1311
override fun onCreate() {

app/src/main/java/com/infeez/androidmoduleexample/MainPresenter.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package com.infeez.androidmoduleexample
22

3-
import com.arellomobile.mvp.InjectViewState
4-
import com.arellomobile.mvp.MvpPresenter
53
import com.infeez.androidmoduleexample.navigation.Navigator
4+
import moxy.InjectViewState
5+
import moxy.MvpPresenter
66
import org.koin.core.KoinComponent
77
import org.koin.core.inject
8-
import ru.terrakok.cicerone.Router
98

109
@InjectViewState
1110
class MainPresenter : MvpPresenter<MainView>(), KoinComponent {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.infeez.androidmoduleexample
22

3-
import com.arellomobile.mvp.MvpView
3+
import moxy.MvpView
44

55
interface MainView : MvpView

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.3.31'
4+
ext.kotlin_version = '1.3.41'
55
repositories {
66
google()
77
jcenter()
88

99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.4.1'
11+
classpath 'com.android.tools.build:gradle:3.5.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1313
// NOTE: Do not place your application dependencies here; they belong
1414
// in the individual module build.gradle files

core/build.gradle

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44

55
android {
6+
compileOptions {
7+
sourceCompatibility 1.8
8+
targetCompatibility 1.8
9+
}
610
compileSdkVersion 29
7-
8-
911
defaultConfig {
1012
minSdkVersion 21
1113
targetSdkVersion 29
@@ -28,12 +30,17 @@ android {
2830
dependencies {
2931
implementation fileTree(dir: 'libs', include: ['*.jar'])
3032

31-
api 'androidx.appcompat:appcompat:1.0.2'
32-
api 'tech.schoolhelper:moxy-x:1.7.0'
33-
api 'tech.schoolhelper:moxy-x-androidx:1.7.0'
33+
api 'androidx.appcompat:appcompat:1.1.0'
34+
api 'com.github.moxy-community:moxy:2.0.2'
35+
api 'com.github.moxy-community:moxy-ktx:2.0.2'
36+
api 'com.github.moxy-community:moxy-android:2.0.2'
37+
api 'com.github.moxy-community:moxy-androidx:2.0.2'
3438
api 'org.koin:koin-androidx-scope:2.0.1'
3539
api 'ru.terrakok.cicerone:cicerone:5.0.0'
36-
api 'androidx.core:core-ktx:1.0.2'
40+
api 'androidx.core:core-ktx:1.1.0'
41+
api 'com.squareup.retrofit2:retrofit:2.6.0'
42+
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.1'
43+
api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1'
3744

3845
testImplementation 'junit:junit:4.12'
3946
androidTestImplementation 'androidx.test:runner:1.2.0'

feature/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ apply plugin: 'kotlin-kapt'
44
apply plugin: 'kotlin-android-extensions'
55

66
android {
7+
compileOptions {
8+
sourceCompatibility 1.8
9+
targetCompatibility 1.8
10+
}
711
compileSdkVersion 29
8-
912
defaultConfig {
1013
minSdkVersion 21
1114
targetSdkVersion 29
@@ -37,5 +40,5 @@ dependencies {
3740
testImplementation 'io.mockk:mockk:1.9'
3841
testImplementation 'junit:junit:4.12'
3942

40-
kapt 'tech.schoolhelper:moxy-x-compiler:1.7.0'
43+
kapt 'com.github.moxy-community:moxy-compiler:2.0.2'
4144
}

feature/src/main/java/com/infeez/androidmoduleexample/feature/FeatureFragment.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import android.view.View
66
import android.view.ViewGroup
77
import android.widget.Toast
88
import androidx.core.os.bundleOf
9-
import com.arellomobile.mvp.MvpAppCompatFragment
10-
import com.arellomobile.mvp.presenter.InjectPresenter
11-
import com.arellomobile.mvp.presenter.ProvidePresenter
129
import com.infeez.androidmoduleexample.R
1310
import kotlinx.android.synthetic.main.fr_feature.*
11+
import moxy.MvpAppCompatFragment
12+
import moxy.presenter.InjectPresenter
13+
import moxy.presenter.ProvidePresenter
1414

1515
class FeatureFragment : MvpAppCompatFragment(), FeatureView {
1616

@@ -20,8 +20,11 @@ class FeatureFragment : MvpAppCompatFragment(), FeatureView {
2020
@ProvidePresenter
2121
fun providePresenter() = FeaturePresenter(arguments!!.getInt(ID), arguments!!.getString(DATA))
2222

23-
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? =
24-
inflater.inflate(R.layout.fr_feature, container, false)
23+
override fun onCreateView(
24+
inflater: LayoutInflater,
25+
container: ViewGroup?,
26+
savedInstanceState: Bundle?
27+
): View? = inflater.inflate(R.layout.fr_feature, container, false)
2528

2629
override fun showLongMessage(text: String) {
2730
Toast.makeText(activity, text, Toast.LENGTH_LONG).show()

0 commit comments

Comments
 (0)