Skip to content

Commit bc0861a

Browse files
committed
Merge remote-tracking branch 'origin/develop'
# Conflicts: # README.md
2 parents 7ef9e63 + f01534e commit bc0861a

File tree

580 files changed

+3331
-18270
lines changed

Some content is hidden

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

580 files changed

+3331
-18270
lines changed

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.
File renamed without changes.

app/build.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'kotlin-kapt'
5+
id 'com.google.devtools.ksp'
6+
}
7+
8+
android {
9+
namespace 'com.omegar.mvp'
10+
compileSdk 33
11+
12+
defaultConfig {
13+
applicationId "com.omegar.mvp"
14+
minSdk 21
15+
targetSdk 33
16+
versionCode 1
17+
versionName "1.0"
18+
19+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20+
}
21+
22+
buildTypes {
23+
release {
24+
minifyEnabled false
25+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26+
}
27+
}
28+
compileOptions {
29+
sourceCompatibility JavaVersion.VERSION_1_8
30+
targetCompatibility JavaVersion.VERSION_1_8
31+
}
32+
kotlinOptions {
33+
jvmTarget = '1.8'
34+
}
35+
}
36+
37+
dependencies {
38+
39+
implementation 'androidx.core:core-ktx:1.9.0'
40+
implementation 'androidx.appcompat:appcompat:1.5.1'
41+
implementation 'com.google.android.material:material:1.7.0'
42+
43+
implementation project(":moxy:androidx")
44+
45+
ksp project(":moxy:compiler")
46+
47+
testImplementation 'junit:junit:4.13.2'
48+
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
49+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
50+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.omegar.mvp
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
19+
@Test
20+
fun useAppContext() {
21+
// Context of the app under test.
22+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
23+
assertEquals("com.omegar.mvp", appContext.packageName)
24+
}
25+
}
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="example.com.moxy_androidx_sample">
3+
xmlns:tools="http://schemas.android.com/tools">
44

55
<application
66
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
79
android:icon="@mipmap/ic_launcher"
810
android:label="@string/app_name"
911
android:roundIcon="@mipmap/ic_launcher_round"
1012
android:supportsRtl="true"
11-
android:theme="@style/AppTheme">
12-
<activity android:name="example.com.moxy_androidx_sample.MainActivity">
13+
android:theme="@style/Theme.OmegaMoxy"
14+
tools:targetApi="31">
15+
16+
<activity android:name=".MoxyActivity"
17+
android:exported="true">
1318
<intent-filter>
14-
<action android:name="android.intent.action.MAIN"/>
19+
<action android:name="android.intent.action.MAIN" />
1520

16-
<category android:name="android.intent.category.LAUNCHER"/>
21+
<category android:name="android.intent.category.LAUNCHER" />
1722
</intent-filter>
1823
</activity>
24+
1925
</application>
2026

2127
</manifest>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.omegar.mvp
2+
3+
interface Addon<N> {
4+
5+
var addon: N?
6+
get() = null
7+
set(value) {
8+
TODO()
9+
}
10+
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.omegar.mvp
2+
3+
4+
/**
5+
* Created by Anton Knyazev on 09.06.2023.
6+
* Copyright (c) 2023 Omega https://omega-r.com
7+
*/
8+
@InjectViewState
9+
open class BasePresenter<T: Number, VIEW: BaseView>: MvpPresenter<VIEW>() {
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.omegar.mvp
2+
3+
4+
/**
5+
* Created by Anton Knyazev on 09.06.2023.
6+
* Copyright (c) 2023 Omega https://omega-r.com
7+
*/
8+
interface BaseView: MvpView {
9+
10+
fun base() {}
11+
12+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.omegar.mvp
2+
3+
import android.os.Bundle
4+
import android.widget.Toast
5+
import com.omegar.mvp.ktx.providePresenter
6+
import kotlin.time.Duration
7+
import kotlin.time.Duration.Companion.seconds
8+
9+
class MoxyActivity: MvpAppCompatActivity(R.layout.activity_moxy), MoxyView {
10+
11+
companion object {
12+
var first: Boolean = true
13+
}
14+
15+
private val presenter: MoxyPresenter by providePresenter {
16+
MoxyPresenter()
17+
}
18+
19+
override var duration: Duration = 0.seconds
20+
21+
override fun onCreate(savedInstanceState: Bundle?) {
22+
super.onCreate(savedInstanceState)
23+
if (savedInstanceState == null) {
24+
supportFragmentManager.beginTransaction()
25+
.replace(R.id.test, MoxyFragment())
26+
.commit()
27+
}
28+
}
29+
30+
override fun test(count: Int) {
31+
Toast.makeText(this, "Test", Toast.LENGTH_LONG).show()
32+
}
33+
34+
override fun showToast(message: String) {
35+
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
36+
}
37+
38+
}

0 commit comments

Comments
 (0)