Skip to content

Commit e093e03

Browse files
Merge pull request #42 from Omega-R/develop
Develop
2 parents 8ee235b + 1f0b6e7 commit e093e03

File tree

85 files changed

+1689
-2923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1689
-2923
lines changed

.idea/compiler.xml

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

.idea/modules.xml

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

app/build.gradle

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

66
android {
7-
compileSdkVersion 28
7+
compileSdkVersion 30
88
defaultConfig {
99
applicationId "com.omega_r.omegabase.simple"
1010
multiDexEnabled true
11-
minSdkVersion 14
12-
targetSdkVersion 28
11+
minSdkVersion 16
12+
targetSdkVersion 30
1313
versionCode 1
1414
versionName "1.0"
1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -25,6 +25,7 @@ android {
2525
pickFirst 'META-INF/kotlinx-io.kotlin_module'
2626
pickFirst 'META-INF/atomicfu.kotlin_module'
2727
pickFirst 'META-INF/kotlinx-coroutines-io.kotlin_module'
28+
pickFirst 'META-INF/library_release.kotlin_module'
2829
}
2930

3031

@@ -48,7 +49,7 @@ dependencies {
4849
implementation 'androidx.recyclerview:recyclerview:1.1.0'
4950

5051
implementation project(':core')
51-
kapt 'com.github.Omega-R.OmegaMoxy:moxy-compiler:1.7.1'
52+
kapt 'com.github.Omega-R.OmegaMoxy:moxy-compiler:2.2.0'
5253
kapt project(':processor')
5354

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

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
android:label="@string/app_name"
1212
android:roundIcon="@mipmap/ic_launcher_round"
1313
android:supportsRtl="true"
14+
android:name=".SampleApp"
1415
android:theme="@style/AppTheme">
1516
<activity android:name="com.omega_r.base.simple.MainActivity">
1617
<intent-filter>

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ package com.omega_r.base.simple
33
import android.os.Bundle
44
import android.view.View
55
import androidx.recyclerview.widget.RecyclerView
6-
import com.omega_r.base.adapters.OmegaAutoAdapter
7-
import com.omega_r.base.adapters.OmegaListAdapter
8-
import com.omega_r.base.annotations.OmegaContentView
9-
import com.omega_r.base.binders.IdHolder
6+
import com.omega_r.adapters.OmegaListAdapter
107
import com.omega_r.base.components.OmegaActivity
8+
import com.omega_r.bind.adapters.OmegaAutoAdapter
9+
import com.omega_r.bind.delegates.IdHolder
10+
import com.omega_r.bind.model.binders.bindImage
1111
import com.omega_r.libs.omegatypes.Text
1212
import com.omega_r.libs.omegatypes.image.Image
1313
import com.omega_r.libs.omegatypes.image.from
1414
import com.omegar.libs.omegalaunchers.createActivityLauncher
1515
import com.omegar.libs.omegalaunchers.tools.put
16-
import com.omegar.mvp.presenter.InjectPresenter
16+
import com.omegar.mvp.ktx.providePresenter
1717

1818
class MainActivity : OmegaActivity(R.layout.activity_main), MainView {
1919

@@ -27,8 +27,7 @@ class MainActivity : OmegaActivity(R.layout.activity_main), MainView {
2727

2828
}
2929

30-
@InjectPresenter
31-
override lateinit var presenter: MainPresenter
30+
override val presenter: MainPresenter by providePresenter()
3231

3332
private val adapter = OmegaAutoAdapter.create(R.layout.item_test_3, ::onClickItem) {
3433
bindImage(R.id.imageview)
@@ -70,13 +69,13 @@ class MainActivity : OmegaActivity(R.layout.activity_main), MainView {
7069
showToast(Text.from(it.id.toString()))
7170
}
7271

73-
7472
override fun onCreate(savedInstanceState: Bundle?) {
7573
super.onCreate(savedInstanceState)
76-
title = intent.getStringExtra(EXTRA_TITLE)
77-
setOnClickListener(R.id.button) {
74+
title = this[EXTRA_TITLE]
75+
setClickListener(R.id.button) {
7876
showToast(Text.from("Test"))
7977
}
78+
setMenu(R.menu.menu_main, R.id.action_test to { showToast(Text.from("Test")) })
8079
}
8180

8281
private fun onClickItem(item: Image) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.omega_r.base.mvp.model.Action
77
import com.omega_r.base.mvp.presenters.OmegaPresenter
88
import com.omega_r.base.simple.dialog_fragment.DialogDialogFragment
99
import com.omega_r.libs.omegatypes.Text
10-
import com.omegar.mvp.InjectViewState
1110
import kotlinx.coroutines.Dispatchers
1211
import kotlinx.coroutines.delay
1312
import kotlinx.coroutines.launch
@@ -16,7 +15,6 @@ import java.io.Serializable
1615
/**
1716
* Created by Anton Knyazev on 06.05.19.
1817
*/
19-
@InjectViewState
2018
class MainPresenter : OmegaPresenter<MainView>() {
2119

2220
init {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.omega_r.base.simple
2+
3+
import android.app.Application
4+
5+
class SampleApp : Application() {
6+
7+
override fun onCreate() {
8+
super.onCreate()
9+
}
10+
11+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DialogDialogFragment : OmegaDialogFragment(), DialogView {
2323

2424
override fun onCreate(savedInstanceState: Bundle?) {
2525
super.onCreate(savedInstanceState)
26-
setOnClickListener(R.id.button) {
26+
setClickListener(R.id.button) {
2727
showToast(Text.from("Test from dialog"))
2828
}
2929
}
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
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item android:id="@+id/action_test"
5+
android:title="@string/app_name"/>
6+
7+
</menu>

0 commit comments

Comments
 (0)