diff --git a/README.md b/README.md index 88628785..b540dbfc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Moxy -[![Maven Central](https://img.shields.io/maven-central/v/com.arello-mobile/moxy.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.arello-mobile%22%20AND%20(a%3A%22moxy%22%20OR%20a%3A%22moxy-compiler%22%20OR%20a%3A%22moxy-android%22%20OR%20a%3A%22moxy-app-compat%22)) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT) +[![](https://jitpack.io/v/Omega-R/OmegaMoxy.svg)](https://jitpack.io/#Omega-R/OmegaMoxy) +[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT) Moxy is a library that helps to use MVP pattern when you do the Android Application. _Without problems of lifecycle and boilerplate code!_ @@ -72,27 +73,46 @@ Templates located in [/moxy-templates](https://github.com/Arello-Mobile/Moxy/tre [FAQ](https://github.com/Arello-Mobile/Moxy/wiki/FAQ) ## Integration + +Add the JitPack repository to your build file: +```groovy +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} +``` + Base modules integration: ```groovy dependencies { ... - compile 'com.arello-mobile:moxy:1.5.5' - annotationProcessor 'com.arello-mobile:moxy-compiler:1.5.5' + implementation 'com.github.Omega-R.OmegaMoxy:moxy:1.5.7' + annotationProcessor 'com.github.Omega-R.OmegaMoxy:moxy-compiler:1.5.7' } ``` For additional base view classes `MvpActivity` and `MvpFragment` add this: ```groovy dependencies { ... - compile 'com.arello-mobile:moxy-android:1.5.5' + implementation 'com.github.Omega-R.OmegaMoxy:moxy-android:1.5.7' +} +``` + +If you are planning to use AndroidX, then you can use `MvpAppCompatActivity` and `MvpAppCompatFragment`. Then add this: +```groovy +dependencies { + ... + implementation 'com.github.Omega-R.OmegaMoxy:moxy-androidx:1.5.7' } ``` If you are planning to use AppCompat, then you can use `MvpAppCompatActivity` and `MvpAppCompatFragment`. Then add this: ```groovy dependencies { ... - compile 'com.arello-mobile:moxy-app-compat:1.5.5' - compile 'com.android.support:appcompat-v7:$support_version' + implementation 'com.github.Omega-R.OmegaMoxy:moxy-app-compat:1.5.7' + implementation 'com.android.support:appcompat-v7:$support_version' } ``` ### Kotlin @@ -102,7 +122,7 @@ apply plugin: 'kotlin-kapt' dependencies { ... - kapt 'com.arello-mobile:moxy-compiler:1.5.5' + kapt 'com.github.Omega-R.OmegaMoxy:moxy-compiler:1.5.7' } ``` diff --git a/build.gradle b/build.gradle index 6e919f67..8faa5f89 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,8 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' } } @@ -16,25 +17,32 @@ allprojects { jcenter() mavenCentral() google() + maven { url 'https://jitpack.io' } } } ext { - targetVersionCode = 45 - targetVersionName = "1.5.5" + targetVersionCode = 46 + targetVersionName = "1.5.6" + kotlin_version = '1.3.50' + def autoServiceVersion = '1.0-rc5' + def gradleIncapHelperVersion = '0.2' deps = [ - android : 'com.google.android:android:1.6_r2', - javapoet : 'com.squareup:javapoet:1.10.0', - junit : 'junit:junit:4.12', - mockito : 'org.mockito:mockito-core:1.10.19', - truth : 'com.google.truth:truth:0.34', - robolectric : 'org.robolectric:robolectric:3.0', - compiletesting: 'com.google.testing.compile:compile-testing:0.15', - asm : ['org.ow2.asm:asm:6.0', 'org.ow2.asm:asm-util:6.0'], - autoservice : 'com.google.auto.service:auto-service:1.0-rc4', - autocommon : 'com.google.auto:auto-common:0.10', - guava : 'com.google.guava:guava:21.0', + android : 'com.google.android:android:1.6_r2', + javapoet : 'com.squareup:javapoet:1.10.0', + junit : 'junit:junit:4.12', + mockito : 'org.mockito:mockito-core:1.10.19', + truth : 'com.google.truth:truth:0.34', + robolectric : 'org.robolectric:robolectric:3.0', + compiletesting : 'com.google.testing.compile:compile-testing:0.15', + asm : ['org.ow2.asm:asm:6.0', 'org.ow2.asm:asm-util:6.0'], + autoservice : "com.google.auto.service:auto-service:$autoServiceVersion", + autoserviceAnnotations : "com.google.auto.service:auto-service-annotations:$autoServiceVersion", + autocommon : 'com.google.auto:auto-common:0.10', + guava : 'com.google.guava:guava:21.0', + gradleIncapHelperAnnotations: "net.ltgt.gradle.incap:incap:$gradleIncapHelperVersion", + gradleIncapHelperProcessor : "net.ltgt.gradle.incap:incap-processor:$gradleIncapHelperVersion" ] } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 87f8b4ca..fd97bee2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Nov 24 23:06:24 NOVT 2018 +#Wed Oct 09 11:52:42 MSK 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/moxy-android/src/main/java/com/arellomobile/mvp/MvpActivity.java b/moxy-android/src/main/java/com/omegar/mvp/MvpActivity.java similarity index 97% rename from moxy-android/src/main/java/com/arellomobile/mvp/MvpActivity.java rename to moxy-android/src/main/java/com/omegar/mvp/MvpActivity.java index ad577c76..b1f62909 100644 --- a/moxy-android/src/main/java/com/arellomobile/mvp/MvpActivity.java +++ b/moxy-android/src/main/java/com/omegar/mvp/MvpActivity.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.app.Activity; import android.os.Bundle; diff --git a/moxy-android/src/main/java/com/arellomobile/mvp/MvpApplication.java b/moxy-android/src/main/java/com/omegar/mvp/MvpApplication.java similarity index 88% rename from moxy-android/src/main/java/com/arellomobile/mvp/MvpApplication.java rename to moxy-android/src/main/java/com/omegar/mvp/MvpApplication.java index 90119d80..6e5947e1 100644 --- a/moxy-android/src/main/java/com/arellomobile/mvp/MvpApplication.java +++ b/moxy-android/src/main/java/com/omegar/mvp/MvpApplication.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.app.Application; diff --git a/moxy-android/src/main/java/com/arellomobile/mvp/MvpDialogFragment.java b/moxy-android/src/main/java/com/omegar/mvp/MvpDialogFragment.java similarity index 98% rename from moxy-android/src/main/java/com/arellomobile/mvp/MvpDialogFragment.java rename to moxy-android/src/main/java/com/omegar/mvp/MvpDialogFragment.java index fdb8c148..b4740260 100644 --- a/moxy-android/src/main/java/com/arellomobile/mvp/MvpDialogFragment.java +++ b/moxy-android/src/main/java/com/omegar/mvp/MvpDialogFragment.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.app.DialogFragment; import android.app.Fragment; diff --git a/moxy-android/src/main/java/com/arellomobile/mvp/MvpFragment.java b/moxy-android/src/main/java/com/omegar/mvp/MvpFragment.java similarity index 98% rename from moxy-android/src/main/java/com/arellomobile/mvp/MvpFragment.java rename to moxy-android/src/main/java/com/omegar/mvp/MvpFragment.java index f3b9502b..a3f98774 100644 --- a/moxy-android/src/main/java/com/arellomobile/mvp/MvpFragment.java +++ b/moxy-android/src/main/java/com/omegar/mvp/MvpFragment.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.app.Fragment; import android.os.Build; diff --git a/moxy-androidx-sapmle/.gitignore b/moxy-androidx-sample/.gitignore similarity index 100% rename from moxy-androidx-sapmle/.gitignore rename to moxy-androidx-sample/.gitignore diff --git a/moxy-androidx-sapmle/build.gradle b/moxy-androidx-sample/build.gradle similarity index 80% rename from moxy-androidx-sapmle/build.gradle rename to moxy-androidx-sample/build.gradle index 658eb036..64f4375c 100644 --- a/moxy-androidx-sapmle/build.gradle +++ b/moxy-androidx-sample/build.gradle @@ -1,5 +1,4 @@ buildscript { - ext.kotlin_version = '1.3.10' repositories { google() jcenter() @@ -19,13 +18,13 @@ android { compileSdkVersion 28 defaultConfig { - applicationId "com.arellomobile.mvp.sample.androidx" + applicationId "com.omegar.mvp.sample.androidx" minSdkVersion 16 targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "android.support.generateInfos.runner.AndroidJUnitRunner" } sourceSets { @@ -41,7 +40,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation project(':moxy') implementation project(':moxy-androidx') kapt project(':moxy-compiler') diff --git a/moxy-androidx-sapmle/gradle.properties b/moxy-androidx-sample/gradle.properties similarity index 100% rename from moxy-androidx-sapmle/gradle.properties rename to moxy-androidx-sample/gradle.properties diff --git a/moxy-androidx-sapmle/proguard-rules.pro b/moxy-androidx-sample/proguard-rules.pro similarity index 100% rename from moxy-androidx-sapmle/proguard-rules.pro rename to moxy-androidx-sample/proguard-rules.pro diff --git a/moxy-androidx-sapmle/src/main/AndroidManifest.xml b/moxy-androidx-sample/src/main/AndroidManifest.xml similarity index 82% rename from moxy-androidx-sapmle/src/main/AndroidManifest.xml rename to moxy-androidx-sample/src/main/AndroidManifest.xml index 3c55fb75..ede65ff8 100644 --- a/moxy-androidx-sapmle/src/main/AndroidManifest.xml +++ b/moxy-androidx-sample/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="example.com.moxy_androidx_sample"> - + diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/BaseActivity.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/BaseActivity.java new file mode 100644 index 00000000..238bf45f --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/BaseActivity.java @@ -0,0 +1,23 @@ +package example.com.moxy_androidx_sample; + +import androidx.annotation.ContentView; +import androidx.annotation.LayoutRes; +import com.omegar.mvp.MvpAppCompatActivity; + +public abstract class BaseActivity extends MvpAppCompatActivity implements BaseView { + + public BaseActivity() { + super(); + } + + @ContentView + public BaseActivity(@LayoutRes int contentLayoutId) { + super(contentLayoutId); + } + + @Override + public void testFunction() { + + } + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/BaseView.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/BaseView.java new file mode 100644 index 00000000..4a424be3 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/BaseView.java @@ -0,0 +1,12 @@ +package example.com.moxy_androidx_sample; + +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +public interface BaseView extends MvpView { + + @StateStrategyType(AddToEndSingleStrategy.class) + void testFunction(); + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/MainActivity.kt b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/MainActivity.kt new file mode 100644 index 00000000..18cd8699 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/MainActivity.kt @@ -0,0 +1,54 @@ +package example.com.moxy_androidx_sample + +import android.location.Location +import android.os.Bundle +import android.util.Log +import com.omegar.mvp.presenter.InjectPresenter +import example.com.moxy_androidx_sample.contract.Contract +import example.com.moxy_androidx_sample.packagee.Item + +class MainActivity : BaseActivity(R.layout.activity_main), Contract.MainView, SecondInterface { + override fun fourth(item: String?) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun firstLog(m: Item?) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun firstCopyMethod(item: MutableList?) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun thirdMethod() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun secondMethod() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun firstMethod(item: List) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + @InjectPresenter + internal lateinit var presenter: MainPresenter + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) +// setContentView(R.layout.activity_main) + } + + override fun printLog(msg: Double?, log: String?) { + Log.e(TAG, "printLog : msg : $msg activity hash code : ${hashCode()}") + } + + override fun second() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + companion object { + const val TAG = "MoxyDebug" + } +} diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/MainPresenter.kt b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/MainPresenter.kt new file mode 100644 index 00000000..42a1539b --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/MainPresenter.kt @@ -0,0 +1,16 @@ +package example.com.moxy_androidx_sample + +import android.util.Log +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter +import example.com.moxy_androidx_sample.contract.Contract + +class MainPresenter : MvpPresenter() { + + override fun onFirstViewAttach() { + super.onFirstViewAttach() + Log.e(MainActivity.TAG, "presenter hash code : ${hashCode()}") + viewState.printLog(10.0, "Kek") + } + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainActivity.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainActivity.java new file mode 100644 index 00000000..0916c6c8 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainActivity.java @@ -0,0 +1,9 @@ +package example.com.moxy_androidx_sample; + +public class NotMainActivity extends BaseActivity implements NotMainView { + + @Override + public void notMainFunction() { + + } +} diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainPresenter.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainPresenter.java new file mode 100644 index 00000000..5988d375 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainPresenter.java @@ -0,0 +1,7 @@ +package example.com.moxy_androidx_sample; + +public class NotMainPresenter { + + + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainView.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainView.java new file mode 100644 index 00000000..313b1f7c --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/NotMainView.java @@ -0,0 +1,7 @@ +package example.com.moxy_androidx_sample; + +public interface NotMainView { + + void notMainFunction(); + +} diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/SecondInterface.kt b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/SecondInterface.kt new file mode 100644 index 00000000..9fbdd825 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/SecondInterface.kt @@ -0,0 +1,7 @@ +package example.com.moxy_androidx_sample + +interface SecondInterface { + + fun second() + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/contract/Contract.kt b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/contract/Contract.kt new file mode 100644 index 00000000..ac4614db --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/contract/Contract.kt @@ -0,0 +1,19 @@ +package example.com.moxy_androidx_sample.contract + +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy +import com.omegar.mvp.viewstate.strategy.StateStrategyType +import example.com.moxy_androidx_sample.fifth.Contract +import example.com.moxy_androidx_sample.first.FirstView +import example.com.moxy_androidx_sample.packagee.Item +import example.com.moxy_androidx_sample.second.SecondView + +interface Contract { + + interface MainView : FirstView, SecondView, Contract.FifthView { + + @StateStrategyType(AddToEndSingleStrategy::class) + fun printLog(msg: Double?, log: String?) + + } + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/fifth/Contract.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/fifth/Contract.java new file mode 100644 index 00000000..83d9134e --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/fifth/Contract.java @@ -0,0 +1,14 @@ +package example.com.moxy_androidx_sample.fifth; + +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +import example.com.moxy_androidx_sample.fourth.FourthView; + +public interface Contract { + + interface FifthView extends FourthView { + + } + +} diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/first/FirstView.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/first/FirstView.java new file mode 100644 index 00000000..1d80efcf --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/first/FirstView.java @@ -0,0 +1,24 @@ +package example.com.moxy_androidx_sample.first; + +import android.location.Location; + +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +import java.util.List; + +import example.com.moxy_androidx_sample.BaseView; +import example.com.moxy_androidx_sample.third.ThirdView; + +public interface FirstView extends BaseView, ThirdView { + + @StateStrategyType(AddToEndSingleStrategy.class) + void firstMethod(List item); + + @StateStrategyType(AddToEndSingleStrategy.class) + void firstCopyMethod(List item); + + @StateStrategyType(AddToEndSingleStrategy.class) + void firstLog(M m); + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/fourth/FourthView.kt b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/fourth/FourthView.kt new file mode 100644 index 00000000..e6af7063 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/fourth/FourthView.kt @@ -0,0 +1,12 @@ +package example.com.moxy_androidx_sample.fourth + +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy +import com.omegar.mvp.viewstate.strategy.StateStrategyType +import example.com.moxy_androidx_sample.BaseView + +interface FourthView : BaseView { + + @StateStrategyType(AddToEndSingleStrategy::class) + fun fourth(item: R) + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/packagee/Item.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/packagee/Item.java new file mode 100644 index 00000000..648464fa --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/packagee/Item.java @@ -0,0 +1,4 @@ +package example.com.moxy_androidx_sample.packagee; + +public class Item { +} diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/second/SecondView.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/second/SecondView.java new file mode 100644 index 00000000..9d2b3606 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/second/SecondView.java @@ -0,0 +1,13 @@ +package example.com.moxy_androidx_sample.second; + +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +import example.com.moxy_androidx_sample.BaseView; + +public interface SecondView extends BaseView { + + @StateStrategyType(AddToEndSingleStrategy.class) + void secondMethod(); + +} \ No newline at end of file diff --git a/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/third/ThirdView.java b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/third/ThirdView.java new file mode 100644 index 00000000..440f47c7 --- /dev/null +++ b/moxy-androidx-sample/src/main/kotlin/example/com/moxy_androidx_sample/third/ThirdView.java @@ -0,0 +1,13 @@ +package example.com.moxy_androidx_sample.third; + +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +import example.com.moxy_androidx_sample.BaseView; + +public interface ThirdView extends BaseView { + + @StateStrategyType(AddToEndSingleStrategy.class) + void thirdMethod(); + +} diff --git a/moxy-androidx-sapmle/src/main/res/drawable-v24/ic_launcher_foreground.xml b/moxy-androidx-sample/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to moxy-androidx-sample/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/moxy-androidx-sapmle/src/main/res/drawable/ic_launcher_background.xml b/moxy-androidx-sample/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/drawable/ic_launcher_background.xml rename to moxy-androidx-sample/src/main/res/drawable/ic_launcher_background.xml diff --git a/moxy-androidx-sapmle/src/main/res/layout/activity_main.xml b/moxy-androidx-sample/src/main/res/layout/activity_main.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/layout/activity_main.xml rename to moxy-androidx-sample/src/main/res/layout/activity_main.xml diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/moxy-androidx-sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to moxy-androidx-sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/moxy-androidx-sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to moxy-androidx-sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-hdpi/ic_launcher.png b/moxy-androidx-sample/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-hdpi/ic_launcher.png rename to moxy-androidx-sample/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-hdpi/ic_launcher_round.png b/moxy-androidx-sample/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to moxy-androidx-sample/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-mdpi/ic_launcher.png b/moxy-androidx-sample/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-mdpi/ic_launcher.png rename to moxy-androidx-sample/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-mdpi/ic_launcher_round.png b/moxy-androidx-sample/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to moxy-androidx-sample/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-xhdpi/ic_launcher.png b/moxy-androidx-sample/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-xhdpi/ic_launcher.png rename to moxy-androidx-sample/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/moxy-androidx-sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to moxy-androidx-sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-xxhdpi/ic_launcher.png b/moxy-androidx-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to moxy-androidx-sample/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/moxy-androidx-sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to moxy-androidx-sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/moxy-androidx-sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to moxy-androidx-sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/moxy-androidx-sapmle/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/moxy-androidx-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from moxy-androidx-sapmle/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to moxy-androidx-sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/moxy-androidx-sapmle/src/main/res/values/colors.xml b/moxy-androidx-sample/src/main/res/values/colors.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/values/colors.xml rename to moxy-androidx-sample/src/main/res/values/colors.xml diff --git a/moxy-androidx-sapmle/src/main/res/values/strings.xml b/moxy-androidx-sample/src/main/res/values/strings.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/values/strings.xml rename to moxy-androidx-sample/src/main/res/values/strings.xml diff --git a/moxy-androidx-sapmle/src/main/res/values/styles.xml b/moxy-androidx-sample/src/main/res/values/styles.xml similarity index 100% rename from moxy-androidx-sapmle/src/main/res/values/styles.xml rename to moxy-androidx-sample/src/main/res/values/styles.xml diff --git a/moxy-androidx-sapmle/src/main/kotlin/example/com/moxy_androidx_sapmle/MainActivity.kt b/moxy-androidx-sapmle/src/main/kotlin/example/com/moxy_androidx_sapmle/MainActivity.kt deleted file mode 100644 index 68fd1ef1..00000000 --- a/moxy-androidx-sapmle/src/main/kotlin/example/com/moxy_androidx_sapmle/MainActivity.kt +++ /dev/null @@ -1,31 +0,0 @@ -package example.com.moxy_androidx_sapmle - -import android.os.Bundle -import android.util.Log -import androidx.appcompat.app.AppCompatActivity -import com.arellomobile.mvp.MvpAppCompatActivity -import com.arellomobile.mvp.MvpView -import com.arellomobile.mvp.presenter.InjectPresenter - -interface MainView : MvpView { - fun printLog(msg: String) -} - -class MainActivity : MvpAppCompatActivity(), MainView { - - @InjectPresenter - internal lateinit var presenter: MainPresenter - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - } - - override fun printLog(msg: String) { - Log.e(TAG, "printLog : msg : $msg activity hash code : ${hashCode()}") - } - - companion object { - const val TAG = "MoxyDebug" - } -} diff --git a/moxy-androidx-sapmle/src/main/kotlin/example/com/moxy_androidx_sapmle/MainPresenter.kt b/moxy-androidx-sapmle/src/main/kotlin/example/com/moxy_androidx_sapmle/MainPresenter.kt deleted file mode 100644 index 6c37df14..00000000 --- a/moxy-androidx-sapmle/src/main/kotlin/example/com/moxy_androidx_sapmle/MainPresenter.kt +++ /dev/null @@ -1,16 +0,0 @@ -package example.com.moxy_androidx_sapmle - -import android.util.Log -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter - -@InjectViewState -class MainPresenter : MvpPresenter() { - - override fun onFirstViewAttach() { - super.onFirstViewAttach() - Log.e(MainActivity.TAG, "presenter hash code : ${hashCode()}") - viewState.printLog("TEST") - } - -} \ No newline at end of file diff --git a/moxy-androidx/src/main/java/com/arellomobile/mvp/MvpAppCompatActivity.java b/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatActivity.java similarity index 85% rename from moxy-androidx/src/main/java/com/arellomobile/mvp/MvpAppCompatActivity.java rename to moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatActivity.java index f28fa328..85e4b6d5 100755 --- a/moxy-androidx/src/main/java/com/arellomobile/mvp/MvpAppCompatActivity.java +++ b/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatActivity.java @@ -1,9 +1,12 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.os.Bundle; +import androidx.annotation.ContentView; +import androidx.annotation.LayoutRes; import androidx.appcompat.app.AppCompatActivity; + /** * Date: 25-July-18 * Time: 2:51 @@ -14,6 +17,11 @@ public class MvpAppCompatActivity extends AppCompatActivity { private MvpDelegate mMvpDelegate; + public MvpAppCompatActivity() { super(); } + + @ContentView + public MvpAppCompatActivity(@LayoutRes int contentLayoutId) { super(contentLayoutId); } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatDialogFragment.java b/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatDialogFragment.java new file mode 100644 index 00000000..9d1fd2b4 --- /dev/null +++ b/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatDialogFragment.java @@ -0,0 +1,95 @@ +package com.omegar.mvp; + +import android.os.Build; +import android.os.Bundle; + +import androidx.appcompat.app.AppCompatDialogFragment; +import androidx.fragment.app.Fragment; + +public class MvpAppCompatDialogFragment extends AppCompatDialogFragment { + + private boolean mIsStateSaved; + private MvpDelegate mMvpDelegate; + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + getMvpDelegate().onCreate(savedInstanceState); + } + + public void onResume() { + super.onResume(); + + mIsStateSaved = false; + + getMvpDelegate().onAttach(); + } + + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + + mIsStateSaved = true; + + getMvpDelegate().onSaveInstanceState(outState); + getMvpDelegate().onDetach(); + } + + @Override + public void onStop() { + super.onStop(); + + getMvpDelegate().onDetach(); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + + getMvpDelegate().onDetach(); + getMvpDelegate().onDestroyView(); + } + + @Override + public void onDestroy() { + super.onDestroy(); + + //We leave the screen and respectively all fragments will be destroyed + if (getActivity().isFinishing()) { + getMvpDelegate().onDestroy(); + return; + } + + // When we rotate device isRemoving() return true for fragment placed in backstack + // http://stackoverflow.com/questions/34649126/fragment-back-stack-and-isremoving + if (mIsStateSaved) { + mIsStateSaved = false; + return; + } + + // See https://github.com/Arello-Mobile/Moxy/issues/24 + boolean anyParentIsRemoving = false; + + if (Build.VERSION.SDK_INT >= 17) { + Fragment parent = getParentFragment(); + while (!anyParentIsRemoving && parent != null) { + anyParentIsRemoving = parent.isRemoving(); + parent = parent.getParentFragment(); + } + } + + if (isRemoving() || anyParentIsRemoving) { + getMvpDelegate().onDestroy(); + } + } + + /** + * @return The {@link MvpDelegate} being used by this Fragment. + */ + public MvpDelegate getMvpDelegate() { + if (mMvpDelegate == null) { + mMvpDelegate = new MvpDelegate<>(this); + } + + return mMvpDelegate; + } +} diff --git a/moxy-androidx/src/main/java/com/arellomobile/mvp/MvpAppCompatFragment.java b/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatFragment.java similarity index 90% rename from moxy-androidx/src/main/java/com/arellomobile/mvp/MvpAppCompatFragment.java rename to moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatFragment.java index 16799c15..96a06507 100644 --- a/moxy-androidx/src/main/java/com/arellomobile/mvp/MvpAppCompatFragment.java +++ b/moxy-androidx/src/main/java/com/omegar/mvp/MvpAppCompatFragment.java @@ -1,6 +1,9 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.os.Bundle; + +import androidx.annotation.ContentView; +import androidx.annotation.LayoutRes; import androidx.fragment.app.Fragment; /** @@ -17,6 +20,11 @@ public class MvpAppCompatFragment extends Fragment { private MvpDelegate mMvpDelegate; + public MvpAppCompatFragment() { super(); } + + @ContentView + public MvpAppCompatFragment(@LayoutRes int contentLayoutId) { super(contentLayoutId); } + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/moxy-androidx/src/main/java/com/omegar/mvp/MvpBottomSheetDialogFragment.java b/moxy-androidx/src/main/java/com/omegar/mvp/MvpBottomSheetDialogFragment.java new file mode 100644 index 00000000..bf70340f --- /dev/null +++ b/moxy-androidx/src/main/java/com/omegar/mvp/MvpBottomSheetDialogFragment.java @@ -0,0 +1,97 @@ +package com.omegar.mvp; + +import android.os.Build; +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomsheet.BottomSheetDialogFragment; + +public class MvpBottomSheetDialogFragment extends BottomSheetDialogFragment { + + private boolean mIsStateSaved; + private MvpDelegate mMvpDelegate; + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + getMvpDelegate().onCreate(savedInstanceState); + } + + public void onResume() { + super.onResume(); + + mIsStateSaved = false; + + getMvpDelegate().onAttach(); + } + + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + + mIsStateSaved = true; + + getMvpDelegate().onSaveInstanceState(outState); + getMvpDelegate().onDetach(); + } + + @Override + public void onStop() { + super.onStop(); + + getMvpDelegate().onDetach(); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + + getMvpDelegate().onDetach(); + getMvpDelegate().onDestroyView(); + } + + @Override + public void onDestroy() { + super.onDestroy(); + + //We leave the screen and respectively all fragments will be destroyed + if (getActivity().isFinishing()) { + getMvpDelegate().onDestroy(); + return; + } + + // When we rotate device isRemoving() return true for fragment placed in backstack + // http://stackoverflow.com/questions/34649126/fragment-back-stack-and-isremoving + if (mIsStateSaved) { + mIsStateSaved = false; + return; + } + + // See https://github.com/Arello-Mobile/Moxy/issues/24 + boolean anyParentIsRemoving = false; + + if (Build.VERSION.SDK_INT >= 17) { + Fragment parent = getParentFragment(); + while (!anyParentIsRemoving && parent != null) { + anyParentIsRemoving = parent.isRemoving(); + parent = parent.getParentFragment(); + } + } + + if (isRemoving() || anyParentIsRemoving) { + getMvpDelegate().onDestroy(); + } + } + + /** + * @return The {@link MvpDelegate} being used by this Fragment. + */ + public MvpDelegate getMvpDelegate() { + if (mMvpDelegate == null) { + mMvpDelegate = new MvpDelegate<>(this); + } + + return mMvpDelegate; + } + +} diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/annotation/ContentView.java b/moxy-androidx/stub-androidx/src/main/java/androidx/annotation/ContentView.java new file mode 100644 index 00000000..f5b7d6ac --- /dev/null +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/annotation/ContentView.java @@ -0,0 +1,12 @@ +package androidx.annotation; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.RetentionPolicy.CLASS; + +@Retention(CLASS) +@Target({CONSTRUCTOR}) +public @interface ContentView { +} \ No newline at end of file diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/annotation/LayoutRes.java b/moxy-androidx/stub-androidx/src/main/java/androidx/annotation/LayoutRes.java new file mode 100644 index 00000000..9e4757b1 --- /dev/null +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/annotation/LayoutRes.java @@ -0,0 +1,17 @@ +package androidx.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.LOCAL_VARIABLE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.RetentionPolicy.CLASS; + +@Documented +@Retention(CLASS) +@Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE}) +public @interface LayoutRes { +} diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatActivity.java b/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatActivity.java index abc8929a..811867d0 100755 --- a/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatActivity.java +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatActivity.java @@ -2,6 +2,11 @@ import android.os.Bundle; +import androidx.annotation.ContentView; +import androidx.annotation.LayoutRes; +import androidx.fragment.app.FragmentActivity; + + /** * Date: 25-July-18 * Time: 2:51 @@ -9,7 +14,16 @@ * @author Vova Stelmashchuk */ -public class AppCompatActivity { +public class AppCompatActivity extends FragmentActivity { + + public AppCompatActivity() { + super(); + } + + @ContentView + public AppCompatActivity(@LayoutRes int contentLayoutId) { + super(contentLayoutId); + } protected void onCreate(Bundle savedInstanceState) { throw new RuntimeException("Stub!"); diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java b/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java new file mode 100644 index 00000000..3cd337eb --- /dev/null +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java @@ -0,0 +1,13 @@ +package androidx.appcompat.app; + +import androidx.fragment.app.DialogFragment; + +/** + * Date: 22-March-19 + * Time: 09:18 + * + * @author R12rus + */ +public class AppCompatDialogFragment extends DialogFragment { + +} \ No newline at end of file diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/DialogFragment.java b/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/DialogFragment.java new file mode 100644 index 00000000..125a4921 --- /dev/null +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/DialogFragment.java @@ -0,0 +1,11 @@ +package androidx.fragment.app; + +/** + * Date: 22-March-19 + * Time: 08:58 + * + * @author R12rus + */ +public class DialogFragment extends Fragment { + +} \ No newline at end of file diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/Fragment.java b/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/Fragment.java index 3c396732..642ddc4c 100644 --- a/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/Fragment.java +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/Fragment.java @@ -2,6 +2,8 @@ import android.os.Bundle; +import androidx.annotation.LayoutRes; + /** * Date: 25-July-18 * Time: 4:38 @@ -10,6 +12,10 @@ */ public class Fragment { + public Fragment() { super(); } + + public Fragment(@LayoutRes int contentLayoutId) { super(); } + public void onCreate(Bundle savedInstanceState) { throw new RuntimeException("Stub!"); } diff --git a/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/FragmentActivity.java b/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/FragmentActivity.java index ff2e0765..98a35c26 100644 --- a/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/FragmentActivity.java +++ b/moxy-androidx/stub-androidx/src/main/java/androidx/fragment/app/FragmentActivity.java @@ -1,5 +1,7 @@ package androidx.fragment.app; +import androidx.annotation.LayoutRes; + /** * Date: 25-July-18 * Time: 4:41 @@ -8,6 +10,14 @@ */ public class FragmentActivity { + + public FragmentActivity() { + super(); + } + public FragmentActivity(@LayoutRes int contentLayoutId) { + super(); + } + public boolean isFinishing() { throw new RuntimeException("Stub!"); } diff --git a/moxy-androidx/stub-androidx/src/main/java/com/google/android/material/bottomsheet/BottomSheetDialogFragment.java b/moxy-androidx/stub-androidx/src/main/java/com/google/android/material/bottomsheet/BottomSheetDialogFragment.java new file mode 100644 index 00000000..49b22940 --- /dev/null +++ b/moxy-androidx/stub-androidx/src/main/java/com/google/android/material/bottomsheet/BottomSheetDialogFragment.java @@ -0,0 +1,7 @@ +package com.google.android.material.bottomsheet; + +import androidx.appcompat.app.AppCompatDialogFragment; + +public class BottomSheetDialogFragment extends AppCompatDialogFragment { + +} \ No newline at end of file diff --git a/moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatActivity.java b/moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatActivity.java similarity index 97% rename from moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatActivity.java rename to moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatActivity.java index c464e4b8..42035469 100644 --- a/moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatActivity.java +++ b/moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatActivity.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; diff --git a/moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatDialogFragment.java b/moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatDialogFragment.java similarity index 98% rename from moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatDialogFragment.java rename to moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatDialogFragment.java index 8deff68b..772c5cf0 100644 --- a/moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatDialogFragment.java +++ b/moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatDialogFragment.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.os.Bundle; import android.support.v4.app.Fragment; diff --git a/moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatFragment.java b/moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatFragment.java similarity index 98% rename from moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatFragment.java rename to moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatFragment.java index 184724c4..45f06c24 100644 --- a/moxy-app-compat/src/main/java/com/arellomobile/mvp/MvpAppCompatFragment.java +++ b/moxy-app-compat/src/main/java/com/omegar/mvp/MvpAppCompatFragment.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import android.os.Bundle; import android.support.v4.app.Fragment; diff --git a/moxy-compiler/build.gradle b/moxy-compiler/build.gradle index 7a34e47f..286503f3 100644 --- a/moxy-compiler/build.gradle +++ b/moxy-compiler/build.gradle @@ -251,8 +251,11 @@ dependencies { implementation deps.javapoet compileOnly deps.autocommon - compileOnly deps.autoservice + compileOnly deps.autoserviceAnnotations + annotationProcessor deps.autoservice compileOnly deps.guava + compileOnly deps.gradleIncapHelperAnnotations + annotationProcessor deps.gradleIncapHelperProcessor javadocDeps project(':moxy') javadocDeps deps.javapoet @@ -263,6 +266,6 @@ dependencies { testImplementation deps.compiletesting testImplementation deps.asm - // workaround to use test resources (https://stackoverflow.com/q/24870464) + // workaround to use generateInfos resources (https://stackoverflow.com/q/24870464) testRuntime files(sourceSets.test.output.resourcesDir) } \ No newline at end of file diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewInterfaceInfo.java b/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewInterfaceInfo.java deleted file mode 100644 index d5069fb1..00000000 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewInterfaceInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.arellomobile.mvp.compiler.viewstate; - -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeVariableName; - -import java.util.List; -import java.util.stream.Collectors; - -import javax.lang.model.element.TypeElement; - -/** - * Date: 27-Jul-2017 - * Time: 13:04 - * - * @author Evgeny Kursakov - */ -class ViewInterfaceInfo { - private final TypeElement element; - private final ClassName name; - private final List typeVariables; - private final List methods; - - ViewInterfaceInfo(TypeElement element, List methods) { - this.element = element; - this.name = ClassName.get(element); - this.methods = methods; - - this.typeVariables = element.getTypeParameters().stream() - .map(TypeVariableName::get) - .collect(Collectors.toList()); - } - - public TypeElement getElement() { - return element; - } - - ClassName getName() { - return name; - } - - TypeName getNameWithTypeVariables() { - if (typeVariables.isEmpty()) { - return name; - } else { - TypeVariableName[] names = new TypeVariableName[typeVariables.size()]; - typeVariables.toArray(names); - - return ParameterizedTypeName.get(name, names); - } - } - - List getTypeVariables() { - return typeVariables; - } - - List getMethods() { - return methods; - } -} diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewStateClassGenerator.java b/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewStateClassGenerator.java deleted file mode 100644 index c6463429..00000000 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewStateClassGenerator.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.arellomobile.mvp.compiler.viewstate; - -import com.arellomobile.mvp.MvpProcessor; -import com.arellomobile.mvp.compiler.JavaFilesGenerator; -import com.arellomobile.mvp.compiler.MvpCompiler; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.MethodSpec; -import com.squareup.javapoet.ParameterSpec; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; - -import java.util.Collections; -import java.util.List; -import java.util.Random; - -import javax.lang.model.element.Modifier; -import javax.lang.model.type.DeclaredType; - -import static com.arellomobile.mvp.compiler.Util.decapitalizeString; - -/** - * Date: 18.12.2015 - * Time: 13:24 - * - * @author Yuri Shmakov - */ -public final class ViewStateClassGenerator extends JavaFilesGenerator { - - @Override - public List generate(ViewInterfaceInfo viewInterfaceInfo) { - ClassName viewName = viewInterfaceInfo.getName(); - TypeName nameWithTypeVariables = viewInterfaceInfo.getNameWithTypeVariables(); - DeclaredType viewInterfaceType = (DeclaredType) viewInterfaceInfo.getElement().asType(); - - TypeSpec.Builder classBuilder = TypeSpec.classBuilder(viewName.simpleName() + MvpProcessor.VIEW_STATE_SUFFIX) - .addModifiers(Modifier.PUBLIC) - .superclass(ParameterizedTypeName.get(ClassName.get(MvpViewState.class), nameWithTypeVariables)) - .addSuperinterface(nameWithTypeVariables) - .addTypeVariables(viewInterfaceInfo.getTypeVariables()); - - for (ViewMethod method : viewInterfaceInfo.getMethods()) { - TypeSpec commandClass = generateCommandClass(method, nameWithTypeVariables); - classBuilder.addType(commandClass); - classBuilder.addMethod(generateMethod(viewInterfaceType, method, nameWithTypeVariables, commandClass)); - } - - JavaFile javaFile = JavaFile.builder(viewName.packageName(), classBuilder.build()) - .indent("\t") - .build(); - return Collections.singletonList(javaFile); - } - - private TypeSpec generateCommandClass(ViewMethod method, TypeName viewTypeName) { - MethodSpec applyMethod = MethodSpec.methodBuilder("apply") - .addAnnotation(Override.class) - .addModifiers(Modifier.PUBLIC) - .addParameter(viewTypeName, "mvpView") - .addExceptions(method.getExceptions()) - .addStatement("mvpView.$L($L)", method.getName(), method.getArgumentsString()) - .build(); - - TypeSpec.Builder classBuilder = TypeSpec.classBuilder(method.getCommandClassName()) - .addModifiers(Modifier.PUBLIC) // TODO: private and static - .addTypeVariables(method.getTypeVariables()) - .superclass(ParameterizedTypeName.get(ClassName.get(ViewCommand.class), viewTypeName)) - .addMethod(generateCommandConstructor(method)) - .addMethod(applyMethod); - - for (ParameterSpec parameter : method.getParameterSpecs()) { - // TODO: private field - classBuilder.addField(parameter.type, parameter.name, Modifier.PUBLIC, Modifier.FINAL); - } - - return classBuilder.build(); - } - - private MethodSpec generateMethod(DeclaredType enclosingType, ViewMethod method, - TypeName viewTypeName, TypeSpec commandClass) { - // TODO: String commandFieldName = "$cmd"; - String commandFieldName = decapitalizeString(method.getCommandClassName()); - - // Add salt if contains argument with same name - Random random = new Random(); - while (method.getArgumentsString().contains(commandFieldName)) { - commandFieldName += random.nextInt(10); - } - - return MethodSpec.overriding(method.getElement(), enclosingType, MvpCompiler.getTypeUtils()) - .addStatement("$1N $2L = new $1N($3L)", commandClass, commandFieldName, method.getArgumentsString()) - .addStatement("mViewCommands.beforeApply($L)", commandFieldName) - .addCode("\n") - .beginControlFlow("if (mViews == null || mViews.isEmpty())") - .addStatement("return") - .endControlFlow() - .addCode("\n") - .beginControlFlow("for ($T view : mViews)", viewTypeName) - .addStatement("view.$L($L)", method.getName(), method.getArgumentsString()) - .endControlFlow() - .addCode("\n") - .addStatement("mViewCommands.afterApply($L)", commandFieldName) - .build(); - } - - private MethodSpec generateCommandConstructor(ViewMethod method) { - List parameters = method.getParameterSpecs(); - - MethodSpec.Builder builder = MethodSpec.constructorBuilder() - .addParameters(parameters) - .addStatement("super($S, $T.class)", method.getTag(), method.getStrategy()); - - if (parameters.size() > 0) { - builder.addCode("\n"); - } - - for (ParameterSpec parameter : parameters) { - builder.addStatement("this.$1N = $1N", parameter); - } - - return builder.build(); - } - -} diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/AnnotationRule.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/AnnotationRule.java similarity index 97% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/AnnotationRule.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/AnnotationRule.java index 59a4864f..53f3566f 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/AnnotationRule.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/AnnotationRule.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import java.util.Arrays; import java.util.HashSet; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/ElementProcessor.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/ElementProcessor.java similarity index 84% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/ElementProcessor.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/ElementProcessor.java index fd48e23e..84d2430c 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/ElementProcessor.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/ElementProcessor.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import javax.lang.model.element.Element; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/JavaFilesGenerator.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/JavaFilesGenerator.java similarity index 85% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/JavaFilesGenerator.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/JavaFilesGenerator.java index 903c0178..6d762813 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/JavaFilesGenerator.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/JavaFilesGenerator.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import com.squareup.javapoet.JavaFile; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/MvpCompiler.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/MvpCompiler.java similarity index 75% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/MvpCompiler.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/MvpCompiler.java index 4c6f88d1..2b7a7051 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/MvpCompiler.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/MvpCompiler.java @@ -1,19 +1,21 @@ -package com.arellomobile.mvp.compiler; - -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.RegisterMoxyReflectorPackages; -import com.arellomobile.mvp.compiler.presenterbinder.InjectPresenterProcessor; -import com.arellomobile.mvp.compiler.presenterbinder.PresenterBinderClassGenerator; -import com.arellomobile.mvp.compiler.reflector.MoxyReflectorGenerator; -import com.arellomobile.mvp.compiler.viewstate.ViewInterfaceProcessor; -import com.arellomobile.mvp.compiler.viewstate.ViewStateClassGenerator; -import com.arellomobile.mvp.compiler.viewstateprovider.InjectViewStateProcessor; -import com.arellomobile.mvp.compiler.viewstateprovider.ViewStateProviderClassGenerator; -import com.arellomobile.mvp.presenter.InjectPresenter; +package com.omegar.mvp.compiler; + import com.google.auto.service.AutoService; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.RegisterMoxyReflectorPackages; +import com.omegar.mvp.compiler.presenterbinder.InjectPresenterProcessor; +import com.omegar.mvp.compiler.presenterbinder.PresenterBinderClassGenerator; +import com.omegar.mvp.compiler.reflector.MoxyReflectorGenerator; +import com.omegar.mvp.compiler.viewstate.ViewInterfaceProcessor; +import com.omegar.mvp.compiler.viewstate.ViewStateClassGenerator; +import com.omegar.mvp.compiler.viewstateprovider.InjectViewStateProcessor; +import com.omegar.mvp.compiler.viewstateprovider.ViewStateProviderClassGenerator; +import com.omegar.mvp.presenter.InjectPresenter; import com.squareup.javapoet.JavaFile; +import net.ltgt.gradle.incap.IncrementalAnnotationProcessor; +import net.ltgt.gradle.incap.IncrementalAnnotationProcessorType; + import java.io.IOException; import java.lang.annotation.Annotation; import java.util.ArrayList; @@ -48,8 +50,9 @@ @SuppressWarnings("unused") @AutoService(Processor.class) +@IncrementalAnnotationProcessor(IncrementalAnnotationProcessorType.AGGREGATING) public class MvpCompiler extends AbstractProcessor { - public static final String MOXY_REFLECTOR_DEFAULT_PACKAGE = "com.arellomobile.mvp"; + public static final String MOXY_REFLECTOR_DEFAULT_PACKAGE = "com.omegar.mvp"; private static final String OPTION_MOXY_REFLECTOR_PACKAGE = "moxyReflectorPackage"; @@ -91,8 +94,7 @@ public Set getSupportedAnnotationTypes() { Collections.addAll(supportedAnnotationTypes, InjectPresenter.class.getCanonicalName(), InjectViewState.class.getCanonicalName(), - RegisterMoxyReflectorPackages.class.getCanonicalName(), - GenerateViewState.class.getCanonicalName()); + RegisterMoxyReflectorPackages.class.getCanonicalName()); return supportedAnnotationTypes; } @@ -112,7 +114,6 @@ public boolean process(Set annotations, RoundEnvironment } catch (RuntimeException e) { getMessager().printMessage(Diagnostic.Kind.OTHER, "Moxy compilation failed. Could you copy stack trace above and write us (or make issue on Github)?"); e.printStackTrace(); - getMessager().printMessage(Diagnostic.Kind.ERROR, "Moxy compilation failed; see the compiler error output for details (" + e + ")"); } return true; @@ -135,10 +136,8 @@ private boolean throwableProcess(RoundEnvironment roundEnv) { processInjectors(roundEnv, InjectPresenter.class, ElementKind.FIELD, injectPresenterProcessor, presenterBinderClassGenerator); - for (TypeElement usedView : injectViewStateProcessor.getUsedViews()) { - generateCode(usedView, ElementKind.INTERFACE, - viewInterfaceProcessor, viewStateClassGenerator); - } + generateCode(injectViewStateProcessor.getUsedViews(), ElementKind.INTERFACE, + viewInterfaceProcessor, viewStateClassGenerator); String moxyReflectorPackage = sOptions.get(OPTION_MOXY_REFLECTOR_PACKAGE); @@ -204,24 +203,41 @@ private void processInjectors(RoundEnvironment roundEnv, } } - private void generateCode(Element element, - ElementKind kind, - ElementProcessor processor, - JavaFilesGenerator classGenerator) { - if (element.getKind() != kind) { - getMessager().printMessage(Diagnostic.Kind.ERROR, element + " must be " + kind.name()); - } - - //noinspection unchecked - R result = processor.process((E) element); + private void generateCode(Set elementSet, + ElementKind kind, + ElementProcessor> processor, + JavaFilesGenerator> classGenerator) { + Set fileSet = new HashSet<>(); + for (Element element : elementSet) { + List list = generateCode(element, kind, processor); + if (list != null) fileSet.addAll(classGenerator.generate(list)); + } + for (JavaFile file : fileSet) { + createSourceFile(file); + } + } + private void generateCode(Element element, + ElementKind kind, + ElementProcessor processor, + JavaFilesGenerator classGenerator) { + R result = generateCode(element, kind, processor); if (result == null) return; - for (JavaFile file : classGenerator.generate(result)) { createSourceFile(file); } } + private R generateCode(Element element, + ElementKind kind, + ElementProcessor processor) { + if (element.getKind() != kind) { + getMessager().printMessage(Diagnostic.Kind.ERROR, element + " must be " + kind.name()); + } + //noinspection unchecked + return processor.process((E) element); + } + private void createSourceFile(JavaFile file) { try { file.writeTo(processingEnv.getFiler()); diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/PresenterInjectorRules.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/PresenterInjectorRules.java similarity index 94% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/PresenterInjectorRules.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/PresenterInjectorRules.java index 350bfcf2..74cfa436 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/PresenterInjectorRules.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/PresenterInjectorRules.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import java.util.ArrayList; import java.util.Collection; @@ -8,9 +8,9 @@ import java.util.List; import java.util.Map; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.presenter.InjectPresenter; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; @@ -24,7 +24,7 @@ import javax.tools.Diagnostic; -import static com.arellomobile.mvp.compiler.Util.fillGenerics; +import static com.omegar.mvp.compiler.Util.fillGenerics; /** * Date: 17-Feb-16 @@ -106,7 +106,7 @@ private String getViewClassFromGeneric(TypeElement typeElement, DeclaredType dec Map types = new HashMap<>(); for (int i = 0; i < typeArguments.size(); i++) { - types.put(typeParameters.get(i).toString(), fillGenerics(parentTypes, typeArguments.get(i))); + types.put(typeParameters.get(i).toString(), Util.fillGenerics(parentTypes, typeArguments.get(i))); } if (superclassElement.toString().equals(MvpPresenter.class.getCanonicalName())) { @@ -127,7 +127,7 @@ private String getViewClassFromGeneric(TypeElement typeElement, DeclaredType dec return ((DeclaredType) superclass).asElement().getSimpleName().toString(); } // MvpPresenter is typed only on View class - return fillGenerics(parentTypes, typeArguments); + return Util.fillGenerics(parentTypes, typeArguments); } parentTypes = types; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/Util.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/Util.java similarity index 78% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/Util.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/Util.java index 98b3ec95..1fb2a909 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/Util.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/Util.java @@ -14,13 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; +import com.omegar.mvp.MvpView; +import com.squareup.javapoet.ClassName; + +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; +import javax.annotation.Nullable; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.AnnotationValue; import javax.lang.model.element.Element; @@ -33,6 +39,7 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; import javax.lang.model.type.WildcardType; +import javax.tools.Diagnostic; /** * Utilities for handling types in annotation processors @@ -41,6 +48,9 @@ */ @SuppressWarnings("WeakerAccess") public final class Util { + + public static final ClassName MVP_VIEW_CLASS_NAME = ClassName.get(MvpView.class); + public static String fillGenerics(Map types, TypeMirror param) { return fillGenerics(types, Collections.singletonList(param)); } @@ -119,6 +129,16 @@ public static String getFullClassName(TypeElement typeElement) { return packageName + className.replaceAll("\\.", "\\$"); } + public static String getSimpleClassName(TypeElement typeElement) { + String packageName = MvpCompiler.getElementUtils().getPackageOf(typeElement).getQualifiedName().toString(); + if (packageName.length() > 0) { + packageName += "."; + } + + String className = typeElement.toString().substring(packageName.length()); + return className.replaceAll("\\.", "\\$"); + } + public static AnnotationMirror getAnnotation(Element element, String annotationClass) { for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) { if (annotationMirror.getAnnotationType().asElement().toString().equals(annotationClass)) @@ -190,4 +210,37 @@ public static boolean hasEmptyConstructor(TypeElement element) { public static String decapitalizeString(String string) { return string == null || string.isEmpty() ? "" : string.length() == 1 ? string.toLowerCase() : Character.toLowerCase(string.charAt(0)) + string.substring(1); } + + public static boolean isMvpElement(TypeElement element) { + if (element == null) return false; + + ClassName className = ClassName.get(element); + if (className.equals(MVP_VIEW_CLASS_NAME)) return true; + + for (TypeMirror typeMirror : element.getInterfaces()) { + TypeElement interfaceElement = (TypeElement) ((DeclaredType) typeMirror).asElement(); + if (isMvpElement(interfaceElement)) return true; + } + return false; + } + + public static E firstOrNull(@Nullable List list) { + if (list == null || list.isEmpty()) return null; + return list.get(0); + } + + public static E lastOrNull(@Nullable Set set) { + if (set == null || set.isEmpty()) return null; + return lastOrNull(new ArrayList<>(set)); + } + + public static E lastOrNull(@Nullable List list) { + if (list == null || list.isEmpty()) return null; + return list.get(list.size() - 1); + } + + public static TypeElement asElement(TypeMirror mirror) { + return (TypeElement) ((DeclaredType) mirror).asElement(); + } + } diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/InjectPresenterProcessor.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/InjectPresenterProcessor.java similarity index 95% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/InjectPresenterProcessor.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/InjectPresenterProcessor.java index faac2e0e..9b66a09e 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/InjectPresenterProcessor.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/InjectPresenterProcessor.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.compiler.presenterbinder; +package com.omegar.mvp.compiler.presenterbinder; -import com.arellomobile.mvp.compiler.ElementProcessor; -import com.arellomobile.mvp.compiler.Util; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; -import com.arellomobile.mvp.presenter.ProvidePresenterTag; +import com.omegar.mvp.compiler.ElementProcessor; +import com.omegar.mvp.compiler.Util; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenterTag; import java.util.ArrayList; import java.util.List; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/PresenterBinderClassGenerator.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/PresenterBinderClassGenerator.java similarity index 94% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/PresenterBinderClassGenerator.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/PresenterBinderClassGenerator.java index 1165499e..64711bd6 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/PresenterBinderClassGenerator.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/PresenterBinderClassGenerator.java @@ -1,11 +1,11 @@ -package com.arellomobile.mvp.compiler.presenterbinder; - -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpProcessor; -import com.arellomobile.mvp.PresenterBinder; -import com.arellomobile.mvp.compiler.JavaFilesGenerator; -import com.arellomobile.mvp.compiler.Util; -import com.arellomobile.mvp.presenter.PresenterField; +package com.omegar.mvp.compiler.presenterbinder; + +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpProcessor; +import com.omegar.mvp.PresenterBinder; +import com.omegar.mvp.compiler.JavaFilesGenerator; +import com.omegar.mvp.compiler.Util; +import com.omegar.mvp.presenter.PresenterField; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/PresenterProviderMethod.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/PresenterProviderMethod.java similarity index 88% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/PresenterProviderMethod.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/PresenterProviderMethod.java index 43814cc3..4a4c3040 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/PresenterProviderMethod.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/PresenterProviderMethod.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.compiler.presenterbinder; +package com.omegar.mvp.compiler.presenterbinder; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.PresenterType; import javax.lang.model.type.DeclaredType; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TagProviderMethod.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TagProviderMethod.java similarity index 87% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TagProviderMethod.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TagProviderMethod.java index 8e01be05..d83ee5a6 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TagProviderMethod.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TagProviderMethod.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.compiler.presenterbinder; +package com.omegar.mvp.compiler.presenterbinder; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.PresenterType; import javax.lang.model.type.TypeMirror; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TargetClassInfo.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TargetClassInfo.java similarity index 89% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TargetClassInfo.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TargetClassInfo.java index 0c739bd2..89c09793 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TargetClassInfo.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TargetClassInfo.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler.presenterbinder; +package com.omegar.mvp.compiler.presenterbinder; import com.squareup.javapoet.ClassName; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TargetPresenterField.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TargetPresenterField.java similarity index 93% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TargetPresenterField.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TargetPresenterField.java index 71b419e4..fa8e9a3c 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/presenterbinder/TargetPresenterField.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/presenterbinder/TargetPresenterField.java @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.compiler.presenterbinder; +package com.omegar.mvp.compiler.presenterbinder; -import com.arellomobile.mvp.MvpProcessor; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpProcessor; +import com.omegar.mvp.presenter.PresenterType; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/reflector/MoxyReflectorGenerator.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/reflector/MoxyReflectorGenerator.java similarity index 97% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/reflector/MoxyReflectorGenerator.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/reflector/MoxyReflectorGenerator.java index 2bf16a20..9f04e1de 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/reflector/MoxyReflectorGenerator.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/reflector/MoxyReflectorGenerator.java @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.compiler.reflector; +package com.omegar.mvp.compiler.reflector; -import com.arellomobile.mvp.MvpProcessor; -import com.arellomobile.mvp.ViewStateProvider; +import com.omegar.mvp.MvpProcessor; +import com.omegar.mvp.ViewStateProvider; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.CodeBlock; import com.squareup.javapoet.JavaFile; @@ -26,7 +26,7 @@ import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; -import static com.arellomobile.mvp.compiler.MvpCompiler.MOXY_REFLECTOR_DEFAULT_PACKAGE; +import static com.omegar.mvp.compiler.MvpCompiler.MOXY_REFLECTOR_DEFAULT_PACKAGE; /** * Date: 07.12.2016 diff --git a/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewInterfaceInfo.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewInterfaceInfo.java new file mode 100644 index 00000000..d063b0f3 --- /dev/null +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewInterfaceInfo.java @@ -0,0 +1,113 @@ +package com.omegar.mvp.compiler.viewstate; + +import com.omegar.mvp.compiler.Util; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeVariableName; + +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; +import javax.lang.model.element.TypeElement; +import javax.lang.model.type.TypeMirror; + +/** + * Date: 27-Jul-2017 + * Time: 13:04 + * + * @author Evgeny Kursakov + */ +class ViewInterfaceInfo { + @Nullable + private final ViewInterfaceInfo superInterfaceInfo; + private final TypeElement element; + private final ClassName name; + private final List typeVariables; + private final List methods; + private final List superTypeMvpElements; + + ViewInterfaceInfo(TypeElement element, List methods) { + this(null, element, methods); + } + + ViewInterfaceInfo(@Nullable ViewInterfaceInfo superInterfaceInfo, TypeElement element, List methods) { + this.superInterfaceInfo = superInterfaceInfo; + this.element = element; + this.name = ClassName.get(element); + this.methods = methods; + + this.typeVariables = element.getTypeParameters().stream() + .map(TypeVariableName::get) + .collect(Collectors.toList()); + superTypeMvpElements = element.getInterfaces().stream() + .map((Function) Util::asElement) + .filter(Util::isMvpElement) + .collect(Collectors.toList()); + } + + @Nullable + ViewInterfaceInfo getSuperInterfaceInfo() { + return superInterfaceInfo; + } + + public TypeElement getElement() { + return element; + } + + ClassName getName() { + return name; + } + + TypeName getNameWithTypeVariables() { + if (typeVariables.isEmpty()) { + return name; + } else { + TypeVariableName[] names = new TypeVariableName[typeVariables.size()]; + typeVariables.toArray(names); + + return ParameterizedTypeName.get(name, names); + } + } + + List getTypeVariables() { + return typeVariables; + } + + List getMethods() { + return methods; + } + + TypeElement getSuperClassElement() { + return superInterfaceInfo == null ? null : superInterfaceInfo.getElement(); + } + + List getSuperTypeMvpElements() { + return superTypeMvpElements; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ViewInterfaceInfo that = (ViewInterfaceInfo) o; + + return name != null ? name.equals(that.name) : that.name == null; + } + + @Override + public int hashCode() { + return name != null ? name.hashCode() : 0; + } + + @Override + public String toString() { + return "ViewInterfaceInfo{" + + "superInterfaceInfo=" + superInterfaceInfo + + ", element=" + element + + '}'; + } +} diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewInterfaceProcessor.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewInterfaceProcessor.java similarity index 54% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewInterfaceProcessor.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewInterfaceProcessor.java index 18d8a960..389cd44c 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewInterfaceProcessor.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewInterfaceProcessor.java @@ -1,15 +1,16 @@ -package com.arellomobile.mvp.compiler.viewstate; +package com.omegar.mvp.compiler.viewstate; -import com.arellomobile.mvp.compiler.ElementProcessor; -import com.arellomobile.mvp.compiler.MvpCompiler; -import com.arellomobile.mvp.compiler.Util; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.compiler.ElementProcessor; +import com.omegar.mvp.compiler.MvpCompiler; +import com.omegar.mvp.compiler.Util; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; import com.squareup.javapoet.ParameterSpec; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -21,21 +22,23 @@ import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; -import javax.lang.model.element.TypeParameterElement; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.tools.Diagnostic; +import static com.omegar.mvp.compiler.Util.MVP_VIEW_CLASS_NAME; +import static com.omegar.mvp.compiler.Util.asElement; +import static com.omegar.mvp.compiler.Util.isMvpElement; + /** * Date: 27-Jul-2017 * Time: 13:09 * * @author Evgeny Kursakov */ -public class ViewInterfaceProcessor extends ElementProcessor { +public class ViewInterfaceProcessor extends ElementProcessor> { private static final String STATE_STRATEGY_TYPE_ANNOTATION = StateStrategyType.class.getName(); - private static final TypeElement DEFAULT_STATE_STRATEGY = MvpCompiler.getElementUtils().getTypeElement(AddToEndStrategy.class.getCanonicalName()); private TypeElement viewInterfaceElement; private String viewInterfaceName; @@ -46,19 +49,86 @@ public List getUsedStrategies() { } @Override - public ViewInterfaceInfo process(TypeElement element) { + public List process(TypeElement element) { + List list = new ArrayList<>(generateInfos(element)); + fillWithNotInheredMethods(list); + return list; + } + + private void fillWithNotInheredMethods(List list) { + for (ViewInterfaceInfo info : list) { + TypeElement element = info.getElement(); + List infoMethods = info.getMethods(); + + if (info.getSuperTypeMvpElements().size() > 1) { + List inheredMethods = getInheredMethods(info); + for (ViewMethod method : getNotInheredMethods(info, list)) { + if (!inheredMethods.contains(method)) { + infoMethods.add(new ViewMethod((DeclaredType) element.asType(), method)); + } + } + } + } + } + + private List getInheredMethods(ViewInterfaceInfo info) { + List methods = new ArrayList<>(info.getMethods()); + + ViewInterfaceInfo superInterfaceInfo = info.getSuperInterfaceInfo(); + if (superInterfaceInfo != null) methods.addAll(getInheredMethods(superInterfaceInfo)); + + return methods; + } + + private Set getNotInheredMethods(ViewInterfaceInfo info, List infoList) { + List elements = info.getSuperTypeMvpElements(); + if (elements.size() <= 1) return Collections.emptySet(); + + assert info.getSuperInterfaceInfo() != null; + TypeElement superClassElement = info.getSuperInterfaceInfo().getElement(); + + Set methodSet = new LinkedHashSet<>(); + for (TypeElement element : elements) { + if (!element.equals(superClassElement)) { + ViewInterfaceInfo infoByType = getViewInterfaceInfoByTypeElement(infoList, element); + if (infoByType != null) { + methodSet.addAll(getInheredMethods(infoByType)); + methodSet.addAll(getNotInheredMethods(infoByType, infoList)); + } + } + } + return methodSet; + } + + private ViewInterfaceInfo getViewInterfaceInfoByTypeElement(List list, TypeElement element) { + for (ViewInterfaceInfo info : list) { + if (info.getElement().equals(element)) return info; + } + return null; + } + + private Set generateInfos(TypeElement element) { + Set interfaceInfos = new LinkedHashSet<>(); this.viewInterfaceElement = element; viewInterfaceName = element.getSimpleName().toString(); List methods = new ArrayList<>(); - TypeElement interfaceStateStrategyType = getInterfaceStateStrategyType(element); - // Get methods for input class - getMethods(element, interfaceStateStrategyType, new ArrayList<>(), methods); - - // Add methods from super interfaces - methods.addAll(iterateInterfaces(0, element, interfaceStateStrategyType, methods, new ArrayList<>())); + getMethods(element, new ArrayList<>(), methods); + + // Add methods from super interfaces + ViewInterfaceInfo superInterfaceInfo = null; + for (TypeMirror typeMirror : element.getInterfaces()) { + final TypeElement interfaceElement = asElement(typeMirror); + if (isMvpElement(interfaceElement)) { + Set parentInfos = generateInfos(interfaceElement); + if (superInterfaceInfo == null) { + superInterfaceInfo = Util.lastOrNull(parentInfos); + } + interfaceInfos.addAll(parentInfos); + } + } // Allow methods be with same names Map methodsCounter = new HashMap<>(); @@ -75,12 +145,13 @@ public ViewInterfaceInfo process(TypeElement element) { methodsCounter.put(method.getName(), counter); } - return new ViewInterfaceInfo(element, methods); - } + ViewInterfaceInfo info = new ViewInterfaceInfo(superInterfaceInfo, element, methods); + if (!info.getName().equals(MVP_VIEW_CLASS_NAME)) interfaceInfos.add(info); + return interfaceInfos; + } private void getMethods(TypeElement typeElement, - TypeElement defaultStrategy, List rootMethods, List superinterfacesMethods) { for (Element element : typeElement.getEnclosedElements()) { @@ -112,7 +183,19 @@ private void getMethods(TypeElement typeElement, if (strategyClassFromAnnotation != null) { strategyClass = (TypeElement) ((DeclaredType) strategyClassFromAnnotation).asElement(); } else { - strategyClass = defaultStrategy != null ? defaultStrategy : DEFAULT_STATE_STRATEGY; + String message = String.format("You are trying generate ViewState for %s. " + + "But %s interface and \"%s\" method don't provide Strategy type. " + + "Please annotate your %s interface or method with Strategy." + "\n\n" + + "For example:\n@StateStrategyType(AddToEndSingleStrategy::class)" + "\n" + "fun %s", + typeElement.getSimpleName(), + typeElement.getSimpleName(), + methodElement.getSimpleName(), + typeElement.getSimpleName(), + methodElement.getSimpleName() + ); + MvpCompiler.getMessager().printMessage(Diagnostic.Kind.ERROR, message); + return; + } // get tag from annotation @@ -169,38 +252,6 @@ private void checkStrategyAndTagEquals(ViewMethod method, ViewMethod existingMet } } - private List iterateInterfaces(int level, - TypeElement parentElement, - TypeElement parentDefaultStrategy, - List rootMethods, - List superinterfacesMethods) { - for (TypeMirror typeMirror : parentElement.getInterfaces()) { - final TypeElement anInterface = (TypeElement) ((DeclaredType) typeMirror).asElement(); - final List typeArguments = ((DeclaredType) typeMirror).getTypeArguments(); - final List typeParameters = anInterface.getTypeParameters(); - if (typeArguments.size() > typeParameters.size()) { - throw new IllegalArgumentException("Code generation for interface " + anInterface.getSimpleName() + " failed. Simplify your generics."); - } - - TypeElement defaultStrategy = parentDefaultStrategy != null ? parentDefaultStrategy : getInterfaceStateStrategyType(anInterface); - - getMethods(anInterface, defaultStrategy, rootMethods, superinterfacesMethods); - - iterateInterfaces(level + 1, anInterface, defaultStrategy, rootMethods, superinterfacesMethods); - } - - return superinterfacesMethods; - } - - private TypeElement getInterfaceStateStrategyType(TypeElement typeElement) { - AnnotationMirror annotation = Util.getAnnotation(typeElement, STATE_STRATEGY_TYPE_ANNOTATION); - TypeMirror value = Util.getAnnotationValueAsTypeMirror(annotation, "value"); - if (value != null && value.getKind() == TypeKind.DECLARED) { - return (TypeElement) ((DeclaredType) value).asElement(); - } else { - return null; - } - } } diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewMethod.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewMethod.java similarity index 61% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewMethod.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewMethod.java index c4446751..b523292a 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstate/ViewMethod.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewMethod.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.compiler.viewstate; +package com.omegar.mvp.compiler.viewstate; -import com.arellomobile.mvp.compiler.MvpCompiler; +import com.omegar.mvp.compiler.MvpCompiler; import com.squareup.javapoet.ParameterSpec; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeVariableName; @@ -35,6 +35,18 @@ class ViewMethod { private String uniqueSuffix; + ViewMethod(DeclaredType targetInterfaceElement, ViewMethod method) { + this.methodElement = method.getElement(); + this.name = method.name; + this.strategy = method.strategy; + this.tag = method.tag; + this.parameterSpecs = formatParameters(targetInterfaceElement, method.methodElement, method.parameterSpecs); + this.exceptions = method.exceptions; + this.typeVariables = method.typeVariables; + this.argumentsString = method.argumentsString; + this.uniqueSuffix = method.uniqueSuffix; + } + ViewMethod(DeclaredType targetInterfaceElement, ExecutableElement methodElement, TypeElement strategy, @@ -78,6 +90,22 @@ class ViewMethod { this.uniqueSuffix = ""; } + private List formatParameters(DeclaredType enclosingType, ExecutableElement element, + List parameterSpecs) { + List list = new ArrayList<>(); + + ExecutableType executableType = (ExecutableType) MvpCompiler.getTypeUtils().asMemberOf(enclosingType, element); + List resolvedParameterTypes = executableType.getParameterTypes(); + + for (int i = 0; i < parameterSpecs.size(); i++) { + ParameterSpec parameter = parameterSpecs.get(i); + TypeName type = TypeName.get(resolvedParameterTypes.get(i)); + list.add(ParameterSpec.builder(type, parameter.name).build()); + } + + return list; + } + ExecutableElement getElement() { return methodElement; } @@ -134,13 +162,27 @@ public boolean equals(Object o) { ViewMethod that = (ViewMethod) o; - return name.equals(that.name) && parameterSpecs.equals(that.parameterSpecs); + if (methodElement != null ? !methodElement.equals(that.methodElement) : that.methodElement != null) return false; + if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (tag != null ? !tag.equals(that.tag) : that.tag != null) return false; + if (argumentsString != null ? !argumentsString.equals(that.argumentsString) : that.argumentsString != null) return false; + return uniqueSuffix != null ? uniqueSuffix.equals(that.uniqueSuffix) : that.uniqueSuffix == null; } @Override public int hashCode() { - int result = name.hashCode(); - result = 31 * result + parameterSpecs.hashCode(); + int result = methodElement != null ? methodElement.hashCode() : 0; + result = 31 * result + (name != null ? name.hashCode() : 0); + result = 31 * result + (tag != null ? tag.hashCode() : 0); + result = 31 * result + (argumentsString != null ? argumentsString.hashCode() : 0); + result = 31 * result + (uniqueSuffix != null ? uniqueSuffix.hashCode() : 0); return result; } + + @Override + public String toString() { + return "ViewMethod{" + + "name='" + name + '\'' + + '}'; + } } diff --git a/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewStateClassGenerator.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewStateClassGenerator.java new file mode 100644 index 00000000..e9c2bbd5 --- /dev/null +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstate/ViewStateClassGenerator.java @@ -0,0 +1,189 @@ +package com.omegar.mvp.compiler.viewstate; + +import com.omegar.mvp.MvpProcessor; +import com.omegar.mvp.compiler.JavaFilesGenerator; +import com.omegar.mvp.compiler.MvpCompiler; +import com.omegar.mvp.compiler.Util; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; +import com.squareup.javapoet.TypeVariableName; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import javax.lang.model.element.Modifier; +import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.TypeMirror; + +import static com.omegar.mvp.compiler.Util.decapitalizeString; + +/** + * Date: 18.12.2015 + * Time: 13:24 + * + * @author Yuri Shmakov + */ +public final class ViewStateClassGenerator extends JavaFilesGenerator> { + + private static final String VIEW = "Omega$$View"; + private static final TypeVariableName GENERIC_TYPE_VARIABLE_NAME = TypeVariableName.get(VIEW); + private static final ClassName MVP_VIEW_STATE_CLASS_NAME = ClassName.get(MvpViewState.class); + private static final ClassName VIEW_COMMAND_CLASS_NAME = ClassName.get(ViewCommand.class); + private static final ParameterizedTypeName VIEW_COMMAND_TYPE_NAME + = ParameterizedTypeName.get(VIEW_COMMAND_CLASS_NAME, GENERIC_TYPE_VARIABLE_NAME); + private static final ParameterizedTypeName MVP_VIEW_STATE_TYPE_NAME + = ParameterizedTypeName.get(MVP_VIEW_STATE_CLASS_NAME, GENERIC_TYPE_VARIABLE_NAME); + + private Map filesMap = new HashMap<>(); + + @Override + public List generate(List list) { + if (list.isEmpty()) return Collections.emptyList(); + List fileList = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + ViewInterfaceInfo info = list.get(i); + + JavaFile javaFile = filesMap.get(info); + if (javaFile == null) { + javaFile = generate(info); + fileList.add(javaFile); + filesMap.put(info, javaFile); + } + fileList.add(javaFile); + } + return fileList; + } + + private JavaFile generate(ViewInterfaceInfo viewInterfaceInfo) { + ClassName viewName = viewInterfaceInfo.getName(); + TypeName nameWithTypeVariables = viewInterfaceInfo.getNameWithTypeVariables(); + DeclaredType viewInterfaceType = (DeclaredType) viewInterfaceInfo.getElement().asType(); + TypeVariableName variableName = TypeVariableName.get(VIEW, nameWithTypeVariables); + + TypeSpec.Builder classBuilder = TypeSpec.classBuilder(Util.getSimpleClassName(viewInterfaceInfo.getElement()) + MvpProcessor.VIEW_STATE_SUFFIX) + .addModifiers(Modifier.PUBLIC) + .addSuperinterface(nameWithTypeVariables) + .addTypeVariables(new ArrayList(viewInterfaceInfo.getTypeVariables()) {{ + add(0, variableName); + }}); + + ViewInterfaceInfo info = viewInterfaceInfo.getSuperInterfaceInfo(); + JavaFile file = filesMap.get(info); + if (file == null) { + classBuilder.superclass(MVP_VIEW_STATE_TYPE_NAME); + } else { + ClassName superClassName = ClassName.get(file.packageName, file.typeSpec.name); + classBuilder.superclass( + ParameterizedTypeName.get(superClassName, generateSuperClassTypeVariables(viewInterfaceInfo, variableName)) + ); + } + + for (ViewMethod method : viewInterfaceInfo.getMethods()) { + TypeSpec commandClass = generateCommandClass(method); + classBuilder.addType(commandClass); + classBuilder.addMethod(generateMethod(viewInterfaceType, method, nameWithTypeVariables, commandClass)); + } + + return JavaFile.builder(viewName.packageName(), classBuilder.build()) + .indent("\t") + .build(); + } + + private TypeVariableName[] generateSuperClassTypeVariables(ViewInterfaceInfo viewInterfaceInfo, TypeVariableName variableName) { + List parentClassTypeVariables = new ArrayList<>(); + parentClassTypeVariables.add(variableName); + + TypeMirror mirror = Util.firstOrNull(viewInterfaceInfo.getElement().getInterfaces()); + if (mirror != null) { + List typeArguments = ((DeclaredType) mirror).getTypeArguments(); + for (TypeMirror typeMirror : typeArguments) { + TypeName typeName = ClassName.get(typeMirror); + TypeVariableName name = TypeVariableName.get(typeMirror.toString(), typeName); + parentClassTypeVariables.add(name); + } + } + //noinspection ToArrayCallWithZeroLengthArrayArgument + return parentClassTypeVariables.toArray(new TypeVariableName[parentClassTypeVariables.size()]); + } + + private TypeSpec generateCommandClass(ViewMethod method) { + MethodSpec applyMethod = MethodSpec.methodBuilder("apply") + .addAnnotation(Override.class) + .addModifiers(Modifier.PUBLIC) + .addParameter(GENERIC_TYPE_VARIABLE_NAME, "mvpView") + .addExceptions(method.getExceptions()) + .addStatement("mvpView.$L($L)", method.getName(), method.getArgumentsString()) + .build(); + + TypeSpec.Builder classBuilder = TypeSpec.classBuilder(method.getCommandClassName()) + .addModifiers(Modifier.PUBLIC) // TODO: private and static + .addTypeVariables(method.getTypeVariables()) + .superclass(VIEW_COMMAND_TYPE_NAME) + .addMethod(generateCommandConstructor(method)) + .addMethod(applyMethod); + + for (ParameterSpec parameter : method.getParameterSpecs()) { + // TODO: private field + classBuilder.addField(parameter.type, parameter.name, Modifier.PUBLIC, Modifier.FINAL); + } + + return classBuilder.build(); + } + + private MethodSpec generateMethod(DeclaredType enclosingType, ViewMethod method, + TypeName viewTypeName, TypeSpec commandClass) { + // TODO: String commandFieldName = "$cmd"; + String commandFieldName = decapitalizeString(method.getCommandClassName()); + + // Add salt if contains argument with same name + Random random = new Random(); + while (method.getArgumentsString().contains(commandFieldName)) { + commandFieldName += random.nextInt(10); + } + + return MethodSpec.overriding(method.getElement(), enclosingType, MvpCompiler.getTypeUtils()) + .addStatement("$1N $2L = new $1N($3L)", commandClass, commandFieldName, method.getArgumentsString()) + .addStatement("mViewCommands.beforeApply($L)", commandFieldName) + .addCode("\n") + .beginControlFlow("if (mViews == null || mViews.isEmpty())") + .addStatement("return") + .endControlFlow() + .addCode("\n") + .beginControlFlow("for ($T view$$ : mViews)", viewTypeName) + .addStatement("view$$.$L($L)", method.getName(), method.getArgumentsString()) + .endControlFlow() + .addCode("\n") + .addStatement("mViewCommands.afterApply($L)", commandFieldName) + .build(); + } + + private MethodSpec generateCommandConstructor(ViewMethod method) { + List parameters = method.getParameterSpecs(); + + MethodSpec.Builder builder = MethodSpec.constructorBuilder() + .addParameters(parameters) + .addStatement("super($S, $T.class)", method.getTag(), method.getStrategy()); + + if (parameters.size() > 0) { + builder.addCode("\n"); + } + + for (ParameterSpec parameter : parameters) { + builder.addStatement("this.$1N = $1N", parameter); + } + + return builder.build(); + } + +} diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/InjectViewStateProcessor.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/InjectViewStateProcessor.java similarity index 89% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/InjectViewStateProcessor.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/InjectViewStateProcessor.java index 185650f5..e08b49f6 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/InjectViewStateProcessor.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/InjectViewStateProcessor.java @@ -1,18 +1,19 @@ -package com.arellomobile.mvp.compiler.viewstateprovider; +package com.omegar.mvp.compiler.viewstateprovider; -import com.arellomobile.mvp.DefaultView; -import com.arellomobile.mvp.DefaultViewState; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpProcessor; -import com.arellomobile.mvp.compiler.ElementProcessor; -import com.arellomobile.mvp.compiler.MvpCompiler; -import com.arellomobile.mvp.compiler.Util; +import com.omegar.mvp.DefaultView; +import com.omegar.mvp.DefaultViewState; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpProcessor; +import com.omegar.mvp.compiler.ElementProcessor; +import com.omegar.mvp.compiler.MvpCompiler; +import com.omegar.mvp.compiler.Util; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -23,9 +24,8 @@ import javax.lang.model.type.MirroredTypeException; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; -import javax.tools.Diagnostic; -import static com.arellomobile.mvp.compiler.Util.fillGenerics; +import static com.omegar.mvp.compiler.Util.fillGenerics; public class InjectViewStateProcessor extends ElementProcessor { private static final String MVP_PRESENTER_CLASS = MvpPresenter.class.getCanonicalName(); diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/PresenterInfo.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/PresenterInfo.java similarity index 90% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/PresenterInfo.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/PresenterInfo.java index 19339ba8..2d68dec2 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/PresenterInfo.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/PresenterInfo.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler.viewstateprovider; +package com.omegar.mvp.compiler.viewstateprovider; import com.squareup.javapoet.ClassName; diff --git a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/ViewStateProviderClassGenerator.java b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/ViewStateProviderClassGenerator.java similarity index 85% rename from moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/ViewStateProviderClassGenerator.java rename to moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/ViewStateProviderClassGenerator.java index 28477dc0..00979fa4 100644 --- a/moxy-compiler/src/main/java/com/arellomobile/mvp/compiler/viewstateprovider/ViewStateProviderClassGenerator.java +++ b/moxy-compiler/src/main/java/com/omegar/mvp/compiler/viewstateprovider/ViewStateProviderClassGenerator.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.compiler.viewstateprovider; +package com.omegar.mvp.compiler.viewstateprovider; -import com.arellomobile.mvp.MvpProcessor; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.ViewStateProvider; -import com.arellomobile.mvp.compiler.JavaFilesGenerator; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.MvpProcessor; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.ViewStateProvider; +import com.omegar.mvp.compiler.JavaFilesGenerator; +import com.omegar.mvp.viewstate.MvpViewState; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; diff --git a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/CompilerTest.java b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/CompilerTest.java similarity index 99% rename from moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/CompilerTest.java rename to moxy-compiler/src/test/java/com/omegar/mvp/compiler/CompilerTest.java index 052fe9fc..10e6ec03 100644 --- a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/CompilerTest.java +++ b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/CompilerTest.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import com.google.common.base.Joiner; import com.google.testing.compile.Compilation; diff --git a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/MultiModulesTest.java b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/MultiModulesTest.java similarity index 95% rename from moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/MultiModulesTest.java rename to moxy-compiler/src/test/java/com/omegar/mvp/compiler/MultiModulesTest.java index fe767ff8..11cd295c 100644 --- a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/MultiModulesTest.java +++ b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/MultiModulesTest.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import com.google.testing.compile.Compilation; @@ -36,7 +36,7 @@ public void testLibraryModule() throws Exception { public void testRegisterMoxyReflectorPackages() throws Exception { JavaFileObject someClientClass = forSourceLines("multimodules.app.App", "package multimodules.app;", - "import com.arellomobile.mvp.RegisterMoxyReflectorPackages;", + "import RegisterMoxyReflectorPackages;", "@RegisterMoxyReflectorPackages(\"multimodules.lib1\")", "public class App {}" ); diff --git a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/PresentersBinderErrorTest.java b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/PresentersBinderErrorTest.java similarity index 95% rename from moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/PresentersBinderErrorTest.java rename to moxy-compiler/src/test/java/com/omegar/mvp/compiler/PresentersBinderErrorTest.java index 0ebcc7f1..a03cb4a2 100644 --- a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/PresentersBinderErrorTest.java +++ b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/PresentersBinderErrorTest.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import com.google.testing.compile.Compilation; diff --git a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/PresentersBinderTest.java b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/PresentersBinderTest.java similarity index 93% rename from moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/PresentersBinderTest.java rename to moxy-compiler/src/test/java/com/omegar/mvp/compiler/PresentersBinderTest.java index 57fb48b7..042a3e08 100644 --- a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/PresentersBinderTest.java +++ b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/PresentersBinderTest.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; -import com.arellomobile.mvp.MvpProcessor; +import com.omegar.mvp.MvpProcessor; import com.google.testing.compile.Compilation; import org.junit.Test; diff --git a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/ViewStateProviderTest.java b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/ViewStateProviderTest.java similarity index 94% rename from moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/ViewStateProviderTest.java rename to moxy-compiler/src/test/java/com/omegar/mvp/compiler/ViewStateProviderTest.java index 6b1977e0..b98d6f01 100644 --- a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/ViewStateProviderTest.java +++ b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/ViewStateProviderTest.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; -import com.arellomobile.mvp.MvpProcessor; +import com.omegar.mvp.MvpProcessor; import com.google.testing.compile.Compilation; import org.junit.Test; diff --git a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/ViewStateTest.java b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/ViewStateTest.java similarity index 90% rename from moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/ViewStateTest.java rename to moxy-compiler/src/test/java/com/omegar/mvp/compiler/ViewStateTest.java index 253fce4e..4424342b 100644 --- a/moxy-compiler/src/test/java/com/arellomobile/mvp/compiler/ViewStateTest.java +++ b/moxy-compiler/src/test/java/com/omegar/mvp/compiler/ViewStateTest.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; -import com.arellomobile.mvp.MvpProcessor; +import com.omegar.mvp.MvpProcessor; import com.google.testing.compile.Compilation; import org.junit.Test; @@ -52,8 +52,8 @@ public void test() throws Exception { private JavaFileObject createDummyPresenter(String viewClass) { return forSourceLines("presenter.DummyPresenter", "package presenter;", - "import com.arellomobile.mvp.InjectViewState;", - "import com.arellomobile.mvp.MvpPresenter;", + "import InjectViewState;", + "import MvpPresenter;", "@InjectViewState", "public class DummyPresenter extends MvpPresenter<" + viewClass + "> {}" ); diff --git a/moxy-compiler/src/test/resources/multimodules/app/AppPresenter$$ViewStateProvider.java b/moxy-compiler/src/test/resources/multimodules/app/AppPresenter$$ViewStateProvider.java index 60033e91..bc54a4a6 100644 --- a/moxy-compiler/src/test/resources/multimodules/app/AppPresenter$$ViewStateProvider.java +++ b/moxy-compiler/src/test/resources/multimodules/app/AppPresenter$$ViewStateProvider.java @@ -1,8 +1,8 @@ package multimodules.app; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.ViewStateProvider; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.ViewStateProvider; +import com.omegar.mvp.viewstate.MvpViewState; public class AppPresenter$$ViewStateProvider extends ViewStateProvider { @Override diff --git a/moxy-compiler/src/test/resources/multimodules/app/AppPresenter.java b/moxy-compiler/src/test/resources/multimodules/app/AppPresenter.java index 199ebe48..cbedcd0a 100644 --- a/moxy-compiler/src/test/resources/multimodules/app/AppPresenter.java +++ b/moxy-compiler/src/test/resources/multimodules/app/AppPresenter.java @@ -1,7 +1,7 @@ package multimodules.app; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; @InjectViewState public class AppPresenter extends MvpPresenter { diff --git a/moxy-compiler/src/test/resources/multimodules/app/AppView$$State.java b/moxy-compiler/src/test/resources/multimodules/app/AppView$$State.java index e0777a94..e81434cf 100644 --- a/moxy-compiler/src/test/resources/multimodules/app/AppView$$State.java +++ b/moxy-compiler/src/test/resources/multimodules/app/AppView$$State.java @@ -1,6 +1,6 @@ package multimodules.app; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.MvpViewState; public class AppView$$State extends MvpViewState implements AppView { } \ No newline at end of file diff --git a/moxy-compiler/src/test/resources/multimodules/app/AppView.java b/moxy-compiler/src/test/resources/multimodules/app/AppView.java index 5ad2c6a5..0ce5fa05 100644 --- a/moxy-compiler/src/test/resources/multimodules/app/AppView.java +++ b/moxy-compiler/src/test/resources/multimodules/app/AppView.java @@ -1,6 +1,6 @@ package multimodules.app; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface AppView extends MvpView { } \ No newline at end of file diff --git a/moxy-compiler/src/test/resources/multimodules/app/MoxyReflector.java b/moxy-compiler/src/test/resources/multimodules/app/MoxyReflector.java index 7750af41..e3c692ad 100644 --- a/moxy-compiler/src/test/resources/multimodules/app/MoxyReflector.java +++ b/moxy-compiler/src/test/resources/multimodules/app/MoxyReflector.java @@ -1,4 +1,6 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; + +import com.omegar.mvp.ViewStateProvider; import java.lang.Class; import java.lang.Object; diff --git a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter$$ViewStateProvider.java b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter$$ViewStateProvider.java index c5f16557..1d72db8b 100644 --- a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter$$ViewStateProvider.java +++ b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter$$ViewStateProvider.java @@ -1,8 +1,8 @@ package multimodules.lib1; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.ViewStateProvider; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.ViewStateProvider; +import com.omegar.mvp.viewstate.MvpViewState; public class Lib1Presenter$$ViewStateProvider extends ViewStateProvider { @Override diff --git a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter.java b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter.java index ff74d536..247500ad 100644 --- a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter.java +++ b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1Presenter.java @@ -1,7 +1,7 @@ package multimodules.lib1; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; @InjectViewState public class Lib1Presenter extends MvpPresenter { diff --git a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View$$State.java b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View$$State.java index d8f5495f..b5f75ecb 100644 --- a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View$$State.java +++ b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View$$State.java @@ -1,6 +1,6 @@ package multimodules.lib1; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.MvpViewState; public class Lib1View$$State extends MvpViewState implements Lib1View { } \ No newline at end of file diff --git a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View.java b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View.java index 9460cb0a..3f3ee3db 100644 --- a/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View.java +++ b/moxy-compiler/src/test/resources/multimodules/lib1/Lib1View.java @@ -1,6 +1,6 @@ package multimodules.lib1; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface Lib1View extends MvpView { } \ No newline at end of file diff --git a/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter$$ViewStateProvider.java b/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter$$ViewStateProvider.java index e18aa18b..dab909ff 100644 --- a/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter$$ViewStateProvider.java +++ b/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter$$ViewStateProvider.java @@ -1,8 +1,8 @@ package presenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.ViewStateProvider; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.ViewStateProvider; +import com.omegar.mvp.viewstate.MvpViewState; import view.EmptyView$$State; diff --git a/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter.java b/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter.java index 9ea83015..59f15fa0 100644 --- a/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter.java +++ b/moxy-compiler/src/test/resources/presenter/EmptyViewPresenter.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; import view.EmptyView; diff --git a/moxy-compiler/src/test/resources/presenter/GenericPresenter$$ViewStateProvider.java b/moxy-compiler/src/test/resources/presenter/GenericPresenter$$ViewStateProvider.java index 21ef676a..2b0e2bb1 100644 --- a/moxy-compiler/src/test/resources/presenter/GenericPresenter$$ViewStateProvider.java +++ b/moxy-compiler/src/test/resources/presenter/GenericPresenter$$ViewStateProvider.java @@ -1,8 +1,8 @@ package presenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.ViewStateProvider; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.ViewStateProvider; +import com.omegar.mvp.viewstate.MvpViewState; import view.GenericView$$State; diff --git a/moxy-compiler/src/test/resources/presenter/GenericPresenter.java b/moxy-compiler/src/test/resources/presenter/GenericPresenter.java index 0f7fde29..697e4a05 100644 --- a/moxy-compiler/src/test/resources/presenter/GenericPresenter.java +++ b/moxy-compiler/src/test/resources/presenter/GenericPresenter.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; import view.GenericView; diff --git a/moxy-compiler/src/test/resources/target/GenericPresenterTarget$$PresentersBinder.java b/moxy-compiler/src/test/resources/target/GenericPresenterTarget$$PresentersBinder.java index cc754a97..c54cef18 100644 --- a/moxy-compiler/src/test/resources/target/GenericPresenterTarget$$PresentersBinder.java +++ b/moxy-compiler/src/test/resources/target/GenericPresenterTarget$$PresentersBinder.java @@ -1,9 +1,9 @@ package target; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.PresenterBinder; -import com.arellomobile.mvp.presenter.PresenterField; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.PresenterBinder; +import com.omegar.mvp.presenter.PresenterField; +import com.omegar.mvp.presenter.PresenterType; import java.util.ArrayList; import java.util.List; diff --git a/moxy-compiler/src/test/resources/target/GenericPresenterTarget.java b/moxy-compiler/src/test/resources/target/GenericPresenterTarget.java index 1d20d27c..aa093bfe 100644 --- a/moxy-compiler/src/test/resources/target/GenericPresenterTarget.java +++ b/moxy-compiler/src/test/resources/target/GenericPresenterTarget.java @@ -1,7 +1,7 @@ package target; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; import presenter.GenericPresenter; import view.GenericView; diff --git a/moxy-compiler/src/test/resources/target/NotImplementViewInterfaceTarget.java b/moxy-compiler/src/test/resources/target/NotImplementViewInterfaceTarget.java index bb49167c..4e18788a 100644 --- a/moxy-compiler/src/test/resources/target/NotImplementViewInterfaceTarget.java +++ b/moxy-compiler/src/test/resources/target/NotImplementViewInterfaceTarget.java @@ -1,6 +1,6 @@ package target; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; import presenter.EmptyViewPresenter; diff --git a/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget$$PresentersBinder.java b/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget$$PresentersBinder.java index 72fe664c..45218877 100644 --- a/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget$$PresentersBinder.java +++ b/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget$$PresentersBinder.java @@ -1,9 +1,9 @@ package target; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.PresenterBinder; -import com.arellomobile.mvp.presenter.PresenterField; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.PresenterBinder; +import com.omegar.mvp.presenter.PresenterField; +import com.omegar.mvp.presenter.PresenterType; import java.util.ArrayList; import java.util.List; diff --git a/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget.java b/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget.java index 8b9a7e2b..8b6b8202 100644 --- a/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget.java +++ b/moxy-compiler/src/test/resources/target/SimpleInjectPresenterTarget.java @@ -1,6 +1,6 @@ package target; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; import presenter.EmptyViewPresenter; import view.EmptyView; diff --git a/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget$$PresentersBinder.java b/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget$$PresentersBinder.java index b0670424..f3618614 100644 --- a/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget$$PresentersBinder.java +++ b/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget$$PresentersBinder.java @@ -1,9 +1,9 @@ package target; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.PresenterBinder; -import com.arellomobile.mvp.presenter.PresenterField; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.PresenterBinder; +import com.omegar.mvp.presenter.PresenterField; +import com.omegar.mvp.presenter.PresenterType; import java.util.ArrayList; import java.util.List; diff --git a/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget.java b/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget.java index bad9db70..553bf807 100644 --- a/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget.java +++ b/moxy-compiler/src/test/resources/target/SimpleProvidePresenterTarget.java @@ -1,7 +1,7 @@ package target; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; import presenter.EmptyViewPresenter; import view.EmptyView; diff --git a/moxy-compiler/src/test/resources/view/EmptyView$$State.java b/moxy-compiler/src/test/resources/view/EmptyView$$State.java index 235e54e0..a2819224 100644 --- a/moxy-compiler/src/test/resources/view/EmptyView$$State.java +++ b/moxy-compiler/src/test/resources/view/EmptyView$$State.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.MvpViewState; public class EmptyView$$State extends MvpViewState implements EmptyView { } \ No newline at end of file diff --git a/moxy-compiler/src/test/resources/view/EmptyView.java b/moxy-compiler/src/test/resources/view/EmptyView.java index 5fcef4bc..e685e7d6 100644 --- a/moxy-compiler/src/test/resources/view/EmptyView.java +++ b/moxy-compiler/src/test/resources/view/EmptyView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface EmptyView extends MvpView { } \ No newline at end of file diff --git a/moxy-compiler/src/test/resources/view/ExtendsOfGenericView$$State.java b/moxy-compiler/src/test/resources/view/ExtendsOfGenericView$$State.java index 1d3b5f8f..648147b0 100644 --- a/moxy-compiler/src/test/resources/view/ExtendsOfGenericView$$State.java +++ b/moxy-compiler/src/test/resources/view/ExtendsOfGenericView$$State.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; import java.io.Serializable; import java.lang.Override; diff --git a/moxy-compiler/src/test/resources/view/ExtendsOfGenericView.java b/moxy-compiler/src/test/resources/view/ExtendsOfGenericView.java index da6edab2..4bb2b558 100644 --- a/moxy-compiler/src/test/resources/view/ExtendsOfGenericView.java +++ b/moxy-compiler/src/test/resources/view/ExtendsOfGenericView.java @@ -1,7 +1,5 @@ package view; -import com.arellomobile.mvp.MvpView; - import java.io.Serializable; public interface ExtendsOfGenericView extends GenericWithExtendsView { diff --git a/moxy-compiler/src/test/resources/view/GenericMethodsView$$State.java b/moxy-compiler/src/test/resources/view/GenericMethodsView$$State.java index b8ec5580..eb9cf86b 100644 --- a/moxy-compiler/src/test/resources/view/GenericMethodsView$$State.java +++ b/moxy-compiler/src/test/resources/view/GenericMethodsView$$State.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; public class GenericMethodsView$$State extends MvpViewState implements GenericMethodsView { diff --git a/moxy-compiler/src/test/resources/view/GenericMethodsView.java b/moxy-compiler/src/test/resources/view/GenericMethodsView.java index c609b694..64f1355d 100644 --- a/moxy-compiler/src/test/resources/view/GenericMethodsView.java +++ b/moxy-compiler/src/test/resources/view/GenericMethodsView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface GenericMethodsView extends MvpView { void generic(T param); diff --git a/moxy-compiler/src/test/resources/view/GenericView$$State.java b/moxy-compiler/src/test/resources/view/GenericView$$State.java index 2fec06ea..2148a9f9 100644 --- a/moxy-compiler/src/test/resources/view/GenericView$$State.java +++ b/moxy-compiler/src/test/resources/view/GenericView$$State.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; public class GenericView$$State extends MvpViewState> implements GenericView { diff --git a/moxy-compiler/src/test/resources/view/GenericView.java b/moxy-compiler/src/test/resources/view/GenericView.java index 37b01a35..8e226388 100644 --- a/moxy-compiler/src/test/resources/view/GenericView.java +++ b/moxy-compiler/src/test/resources/view/GenericView.java @@ -1,7 +1,6 @@ package view; -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface GenericView extends MvpView { void testEvent(T param); diff --git a/moxy-compiler/src/test/resources/view/GenericWithExtendsView$$State.java b/moxy-compiler/src/test/resources/view/GenericWithExtendsView$$State.java index 85fc14dc..d100cbf9 100644 --- a/moxy-compiler/src/test/resources/view/GenericWithExtendsView$$State.java +++ b/moxy-compiler/src/test/resources/view/GenericWithExtendsView$$State.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; import java.io.Serializable; diff --git a/moxy-compiler/src/test/resources/view/GenericWithExtendsView.java b/moxy-compiler/src/test/resources/view/GenericWithExtendsView.java index 1cd12198..9f16c20d 100644 --- a/moxy-compiler/src/test/resources/view/GenericWithExtendsView.java +++ b/moxy-compiler/src/test/resources/view/GenericWithExtendsView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; import java.io.Serializable; diff --git a/moxy-compiler/src/test/resources/view/OverloadingView$$State.java b/moxy-compiler/src/test/resources/view/OverloadingView$$State.java index 9a6cd2af..48fbd9eb 100644 --- a/moxy-compiler/src/test/resources/view/OverloadingView$$State.java +++ b/moxy-compiler/src/test/resources/view/OverloadingView$$State.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; public class OverloadingView$$State extends MvpViewState implements OverloadingView { diff --git a/moxy-compiler/src/test/resources/view/OverloadingView.java b/moxy-compiler/src/test/resources/view/OverloadingView.java index d784d7b7..7c2a67b7 100644 --- a/moxy-compiler/src/test/resources/view/OverloadingView.java +++ b/moxy-compiler/src/test/resources/view/OverloadingView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface OverloadingView extends MvpView { void method(String string); diff --git a/moxy-compiler/src/test/resources/view/SimpleView$$State.java b/moxy-compiler/src/test/resources/view/SimpleView$$State.java index 4412c86e..2f959471 100644 --- a/moxy-compiler/src/test/resources/view/SimpleView$$State.java +++ b/moxy-compiler/src/test/resources/view/SimpleView$$State.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; public class SimpleView$$State extends MvpViewState implements SimpleView { diff --git a/moxy-compiler/src/test/resources/view/SimpleView.java b/moxy-compiler/src/test/resources/view/SimpleView.java index acfa044c..3ebf4dbc 100644 --- a/moxy-compiler/src/test/resources/view/SimpleView.java +++ b/moxy-compiler/src/test/resources/view/SimpleView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface SimpleView extends MvpView { void testEvent(); diff --git a/moxy-compiler/src/test/resources/view/StrategiesView$$State.java b/moxy-compiler/src/test/resources/view/StrategiesView$$State.java index 8c016bba..bf9d5247 100644 --- a/moxy-compiler/src/test/resources/view/StrategiesView$$State.java +++ b/moxy-compiler/src/test/resources/view/StrategiesView$$State.java @@ -1,10 +1,10 @@ package view; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.OneExecutionStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.OneExecutionStateStrategy; +import com.omegar.mvp.viewstate.strategy.SingleStateStrategy; public class StrategiesView$$State extends MvpViewState implements StrategiesView { diff --git a/moxy-compiler/src/test/resources/view/StrategiesView.java b/moxy-compiler/src/test/resources/view/StrategiesView.java index 4dc19d3b..f51a4372 100644 --- a/moxy-compiler/src/test/resources/view/StrategiesView.java +++ b/moxy-compiler/src/test/resources/view/StrategiesView.java @@ -1,10 +1,10 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.OneExecutionStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.OneExecutionStateStrategy; +import com.omegar.mvp.viewstate.strategy.SingleStateStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; @StateStrategyType(AddToEndSingleStrategy.class) public interface StrategiesView extends MvpView { diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView$$State.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView$$State.java index 175e83f4..a00ebfb5 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView$$State.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView$$State.java @@ -1,7 +1,7 @@ package view.strategies_inheritance; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; import view.strategies_inheritance.strategies.ChildDefaultStrategy; import view.strategies_inheritance.strategies.Strategy1; diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView.java index 2006c725..b15cb28e 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/ChildView.java @@ -1,17 +1,18 @@ package view.strategies_inheritance; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; import view.strategies_inheritance.strategies.ChildDefaultStrategy; import view.strategies_inheritance.strategies.Strategy2; -@StateStrategyType(ChildDefaultStrategy.class) public interface ChildView extends ParentView { + @StateStrategyType(ChildDefaultStrategy.class) void parentMethod1(); // ParentDefaultStrategy -> ChildDefaultStrategy @StateStrategyType(Strategy2.class) void parentMethod2(); // ParentDefaultStrategy -> Strategy2 + @StateStrategyType(ChildDefaultStrategy.class) void childMethod(); // ChildDefaultStrategy @StateStrategyType(Strategy2.class) diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView$$State.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView$$State.java index 5b191987..3924a61c 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView$$State.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView$$State.java @@ -1,7 +1,7 @@ package view.strategies_inheritance; -import com.arellomobile.mvp.viewstate.MvpViewState; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; import view.strategies_inheritance.strategies.ParentDefaultStrategy; import view.strategies_inheritance.strategies.Strategy1; diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView.java index 0e2374fb..04a17f22 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/ParentView.java @@ -1,17 +1,19 @@ package view.strategies_inheritance; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; import view.strategies_inheritance.strategies.ParentDefaultStrategy; import view.strategies_inheritance.strategies.Strategy1; -@StateStrategyType(ParentDefaultStrategy.class) public interface ParentView extends MvpView { + @StateStrategyType(ParentDefaultStrategy.class) void parentMethod1(); // ParentDefaultStrategy + @StateStrategyType(ParentDefaultStrategy.class) void parentMethod2(); // ParentDefaultStrategy + @StateStrategyType(ParentDefaultStrategy.class) void parentMethod3(); // ParentDefaultStrategy @StateStrategyType(Strategy1.class) diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ChildDefaultStrategy.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ChildDefaultStrategy.java index c7545df4..e5c05fa4 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ChildDefaultStrategy.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ChildDefaultStrategy.java @@ -1,6 +1,6 @@ package view.strategies_inheritance.strategies; -import com.arellomobile.mvp.viewstate.strategy.SkipStrategy; +import com.omegar.mvp.viewstate.strategy.SkipStrategy; public class ChildDefaultStrategy extends SkipStrategy { } diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ParentDefaultStrategy.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ParentDefaultStrategy.java index de7ca7ff..c1f75288 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ParentDefaultStrategy.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/ParentDefaultStrategy.java @@ -1,6 +1,6 @@ package view.strategies_inheritance.strategies; -import com.arellomobile.mvp.viewstate.strategy.SkipStrategy; +import com.omegar.mvp.viewstate.strategy.SkipStrategy; public class ParentDefaultStrategy extends SkipStrategy { } diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy1.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy1.java index ab42697f..a7f47de4 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy1.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy1.java @@ -1,6 +1,6 @@ package view.strategies_inheritance.strategies; -import com.arellomobile.mvp.viewstate.strategy.SkipStrategy; +import com.omegar.mvp.viewstate.strategy.SkipStrategy; public class Strategy1 extends SkipStrategy { } diff --git a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy2.java b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy2.java index 0dfb3ec5..16e005ab 100644 --- a/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy2.java +++ b/moxy-compiler/src/test/resources/view/strategies_inheritance/strategies/Strategy2.java @@ -1,6 +1,6 @@ package view.strategies_inheritance.strategies; -import com.arellomobile.mvp.viewstate.strategy.SkipStrategy; +import com.omegar.mvp.viewstate.strategy.SkipStrategy; public class Strategy2 extends SkipStrategy { } diff --git a/moxy-templates/Java/MoxyActivity/globals.xml.ftl b/moxy-templates/Java/MoxyActivity/globals.xml.ftl index 72c6e6fa..8907ccf2 100644 --- a/moxy-templates/Java/MoxyActivity/globals.xml.ftl +++ b/moxy-templates/Java/MoxyActivity/globals.xml.ftl @@ -9,8 +9,8 @@ diff --git a/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl b/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl index 838befe8..95967fbd 100644 --- a/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl +++ b/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl @@ -2,8 +2,8 @@ package ${packageName}.presentation.presenter${dotSubpackage}; <#if applicationPackage??>import ${applicationPackage}.R; import ${packageName}.presentation.view${dotSubpackage}.${viewName}; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; @InjectViewState public class ${presenterName} extends MvpPresenter<${viewName}> { diff --git a/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl b/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl index ec5bbb0c..a771398d 100644 --- a/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl +++ b/moxy-templates/Java/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage}; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface ${viewName} extends MvpView { diff --git a/moxy-templates/Java/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl b/moxy-templates/Java/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl index 37798be2..fa7c8e7a 100644 --- a/moxy-templates/Java/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl +++ b/moxy-templates/Java/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl @@ -13,9 +13,9 @@ import ${superClassFqcn}; import ${packageName}.R; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; <#if createProvidesMethod> -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenter; public class ${className} extends ${superClassName} implements ${viewName} { diff --git a/moxy-templates/Java/MoxyFragment/globals.xml.ftl b/moxy-templates/Java/MoxyFragment/globals.xml.ftl index f8379e95..4b1908ed 100644 --- a/moxy-templates/Java/MoxyFragment/globals.xml.ftl +++ b/moxy-templates/Java/MoxyFragment/globals.xml.ftl @@ -9,8 +9,8 @@ diff --git a/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl b/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl index 838befe8..95967fbd 100644 --- a/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl +++ b/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl @@ -2,8 +2,8 @@ package ${packageName}.presentation.presenter${dotSubpackage}; <#if applicationPackage??>import ${applicationPackage}.R; import ${packageName}.presentation.view${dotSubpackage}.${viewName}; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; @InjectViewState public class ${presenterName} extends MvpPresenter<${viewName}> { diff --git a/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl b/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl index ec5bbb0c..a771398d 100644 --- a/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl +++ b/moxy-templates/Java/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage}; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface ${viewName} extends MvpView { diff --git a/moxy-templates/Java/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl b/moxy-templates/Java/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl index 340481d1..718ee029 100644 --- a/moxy-templates/Java/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl +++ b/moxy-templates/Java/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl @@ -14,9 +14,9 @@ import ${superClassFqcn}; import ${packageName}.R; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; <#if createProvidesMethod> -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenter; public class ${className} extends ${superClassName} implements ${viewName} { diff --git a/moxy-templates/Kotlin/MoxyActivity/globals.xml.ftl b/moxy-templates/Kotlin/MoxyActivity/globals.xml.ftl index d46f8ff3..c8c511a0 100644 --- a/moxy-templates/Kotlin/MoxyActivity/globals.xml.ftl +++ b/moxy-templates/Kotlin/MoxyActivity/globals.xml.ftl @@ -9,8 +9,8 @@ diff --git a/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl b/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl index ddc221b8..5329e832 100644 --- a/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl +++ b/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl @@ -1,7 +1,7 @@ package ${packageName}.presentation.presenter${dotSubpackage} -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter import ${packageName}.presentation.view${dotSubpackage}.${viewName} @InjectViewState diff --git a/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl b/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl index bd24a774..9455187c 100644 --- a/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl +++ b/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage} -import com.arellomobile.mvp.MvpView +import com.omegar.mvp.MvpView interface ${viewName} : MvpView { diff --git a/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl b/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl index a924373a..8fd6d671 100644 --- a/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl +++ b/moxy-templates/Kotlin/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl @@ -4,7 +4,7 @@ import android.content.Context import android.content.Intent import android.os.Bundle -import com.arellomobile.mvp.presenter.InjectPresenter +import com.omegar.mvp.presenter.InjectPresenter import ${packageName}.R import ${packageName}.presentation.view${dotSubpackage}.${viewName} import ${packageName}.presentation.presenter${dotSubpackage}.${presenterName} @@ -12,7 +12,7 @@ import ${packageName}.presentation.presenter${dotSubpackage}.${presenterName} import ${superClassFqcn}; <#if createProvidesMethod> -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenter; diff --git a/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl b/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl index ddc221b8..5329e832 100644 --- a/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl +++ b/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl @@ -1,7 +1,7 @@ package ${packageName}.presentation.presenter${dotSubpackage} -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter import ${packageName}.presentation.view${dotSubpackage}.${viewName} @InjectViewState diff --git a/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl b/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl index bd24a774..9455187c 100644 --- a/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl +++ b/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage} -import com.arellomobile.mvp.MvpView +import com.omegar.mvp.MvpView interface ${viewName} : MvpView { diff --git a/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl b/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl index 29a7c218..ca3a32bb 100644 --- a/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl +++ b/moxy-templates/Kotlin/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl @@ -8,8 +8,8 @@ import ${packageName}.R import ${packageName}.presentation.view${dotSubpackage}.${viewName} import ${packageName}.presentation.presenter${dotSubpackage}.${presenterName} -import com.arellomobile.mvp.MvpFragment -import com.arellomobile.mvp.presenter.InjectPresenter +import com.omegar.mvp.MvpFragment +import com.omegar.mvp.presenter.InjectPresenter class ${className} : MvpFragment(), ${viewName} { companion object { @@ -35,7 +35,7 @@ class ${className} : MvpFragment(), ${viewName} { } - override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) } diff --git a/moxy-templates/common/MoxyActivity/globals.xml.ftl b/moxy-templates/common/MoxyActivity/globals.xml.ftl index 1ba7a47d..3760bb59 100644 --- a/moxy-templates/common/MoxyActivity/globals.xml.ftl +++ b/moxy-templates/common/MoxyActivity/globals.xml.ftl @@ -9,8 +9,8 @@ diff --git a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl index 838befe8..95967fbd 100644 --- a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl +++ b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl @@ -2,8 +2,8 @@ package ${packageName}.presentation.presenter${dotSubpackage}; <#if applicationPackage??>import ${applicationPackage}.R; import ${packageName}.presentation.view${dotSubpackage}.${viewName}; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; @InjectViewState public class ${presenterName} extends MvpPresenter<${viewName}> { diff --git a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl index ddc221b8..5329e832 100644 --- a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl +++ b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl @@ -1,7 +1,7 @@ package ${packageName}.presentation.presenter${dotSubpackage} -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter import ${packageName}.presentation.view${dotSubpackage}.${viewName} @InjectViewState diff --git a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl index ec5bbb0c..a771398d 100644 --- a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl +++ b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.java.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage}; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface ${viewName} extends MvpView { diff --git a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl index bd24a774..9455187c 100644 --- a/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl +++ b/moxy-templates/common/MoxyActivity/root/src/app_package/presentation/view/BlankView.kt.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage} -import com.arellomobile.mvp.MvpView +import com.omegar.mvp.MvpView interface ${viewName} : MvpView { diff --git a/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl b/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl index 37798be2..fa7c8e7a 100644 --- a/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl +++ b/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.java.ftl @@ -13,9 +13,9 @@ import ${superClassFqcn}; import ${packageName}.R; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; <#if createProvidesMethod> -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenter; public class ${className} extends ${superClassName} implements ${viewName} { diff --git a/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl b/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl index a924373a..8fd6d671 100644 --- a/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl +++ b/moxy-templates/common/MoxyActivity/root/src/app_package/ui/activity/BlankActivity.kt.ftl @@ -4,7 +4,7 @@ import android.content.Context import android.content.Intent import android.os.Bundle -import com.arellomobile.mvp.presenter.InjectPresenter +import com.omegar.mvp.presenter.InjectPresenter import ${packageName}.R import ${packageName}.presentation.view${dotSubpackage}.${viewName} import ${packageName}.presentation.presenter${dotSubpackage}.${presenterName} @@ -12,7 +12,7 @@ import ${packageName}.presentation.presenter${dotSubpackage}.${presenterName} import ${superClassFqcn}; <#if createProvidesMethod> -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenter; diff --git a/moxy-templates/common/MoxyFragment/globals.xml.ftl b/moxy-templates/common/MoxyFragment/globals.xml.ftl index e4a1a0b1..a868da32 100644 --- a/moxy-templates/common/MoxyFragment/globals.xml.ftl +++ b/moxy-templates/common/MoxyFragment/globals.xml.ftl @@ -9,8 +9,8 @@ diff --git a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl index 838befe8..95967fbd 100644 --- a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl +++ b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.java.ftl @@ -2,8 +2,8 @@ package ${packageName}.presentation.presenter${dotSubpackage}; <#if applicationPackage??>import ${applicationPackage}.R; import ${packageName}.presentation.view${dotSubpackage}.${viewName}; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; @InjectViewState public class ${presenterName} extends MvpPresenter<${viewName}> { diff --git a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl index ddc221b8..5329e832 100644 --- a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl +++ b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/presenter/BlankPresenter.kt.ftl @@ -1,7 +1,7 @@ package ${packageName}.presentation.presenter${dotSubpackage} -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter import ${packageName}.presentation.view${dotSubpackage}.${viewName} @InjectViewState diff --git a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl index ec5bbb0c..a771398d 100644 --- a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl +++ b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.java.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage}; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; public interface ${viewName} extends MvpView { diff --git a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl index bd24a774..9455187c 100644 --- a/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl +++ b/moxy-templates/common/MoxyFragment/root/src/app_package/presentation/view/BlankView.kt.ftl @@ -1,6 +1,6 @@ package ${packageName}.presentation.view${dotSubpackage} -import com.arellomobile.mvp.MvpView +import com.omegar.mvp.MvpView interface ${viewName} : MvpView { diff --git a/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl b/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl index 340481d1..718ee029 100644 --- a/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl +++ b/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.java.ftl @@ -14,9 +14,9 @@ import ${superClassFqcn}; import ${packageName}.R; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; <#if createProvidesMethod> -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenter; public class ${className} extends ${superClassName} implements ${viewName} { diff --git a/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl b/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl index 29a7c218..fe476595 100644 --- a/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl +++ b/moxy-templates/common/MoxyFragment/root/src/app_package/ui/fragment/BlankFragment.kt.ftl @@ -8,8 +8,8 @@ import ${packageName}.R import ${packageName}.presentation.view${dotSubpackage}.${viewName} import ${packageName}.presentation.presenter${dotSubpackage}.${presenterName} -import com.arellomobile.mvp.MvpFragment -import com.arellomobile.mvp.presenter.InjectPresenter +import com.omegar.mvp.MvpFragment +import com.omegar.mvp.presenter.InjectPresenter class ${className} : MvpFragment(), ${viewName} { companion object { diff --git a/moxy/src/main/java/com/arellomobile/mvp/GenerateViewState.java b/moxy/src/main/java/com/arellomobile/mvp/GenerateViewState.java deleted file mode 100644 index c31dc24d..00000000 --- a/moxy/src/main/java/com/arellomobile/mvp/GenerateViewState.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.arellomobile.mvp; - -import java.lang.annotation.Target; - - -import static java.lang.annotation.ElementType.TYPE; - -/** - *

Generate view state class for annotated view interface.

- *

Generated class implements this view interface.

- * - * @deprecated As of release 0.4.1, {@link InjectViewState} generate view state, if it needed - */ -@Target(value = TYPE) -@Deprecated -public @interface GenerateViewState { -} diff --git a/moxy/src/main/java/com/arellomobile/mvp/DefaultView.java b/moxy/src/main/java/com/omegar/mvp/DefaultView.java similarity index 80% rename from moxy/src/main/java/com/arellomobile/mvp/DefaultView.java rename to moxy/src/main/java/com/omegar/mvp/DefaultView.java index a6dfd850..9a3840f6 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/DefaultView.java +++ b/moxy/src/main/java/com/omegar/mvp/DefaultView.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; /** * Date: 04.02.2016 diff --git a/moxy/src/main/java/com/arellomobile/mvp/DefaultViewState.java b/moxy/src/main/java/com/omegar/mvp/DefaultViewState.java similarity index 63% rename from moxy/src/main/java/com/arellomobile/mvp/DefaultViewState.java rename to moxy/src/main/java/com/omegar/mvp/DefaultViewState.java index f0c2bf88..a30a565b 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/DefaultViewState.java +++ b/moxy/src/main/java/com/omegar/mvp/DefaultViewState.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.MvpViewState; /** * Date: 19.12.2015 diff --git a/moxy/src/main/java/com/arellomobile/mvp/InjectViewState.java b/moxy/src/main/java/com/omegar/mvp/InjectViewState.java similarity index 83% rename from moxy/src/main/java/com/arellomobile/mvp/InjectViewState.java rename to moxy/src/main/java/com/omegar/mvp/InjectViewState.java index 1e3169fc..2b1f84a1 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/InjectViewState.java +++ b/moxy/src/main/java/com/omegar/mvp/InjectViewState.java @@ -1,8 +1,9 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; +import java.lang.annotation.Inherited; import java.lang.annotation.Target; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.MvpViewState; import static java.lang.annotation.ElementType.TYPE; @@ -15,6 +16,7 @@ * code, that broke your app. */ @Target(value = TYPE) +@Inherited public @interface InjectViewState { Class value() default DefaultViewState.class; diff --git a/moxy/src/main/java/com/arellomobile/mvp/MvpDelegate.java b/moxy/src/main/java/com/omegar/mvp/MvpDelegate.java similarity index 96% rename from moxy/src/main/java/com/arellomobile/mvp/MvpDelegate.java rename to moxy/src/main/java/com/omegar/mvp/MvpDelegate.java index ba8a674b..224fee64 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/MvpDelegate.java +++ b/moxy/src/main/java/com/omegar/mvp/MvpDelegate.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.ArrayList; import java.util.List; @@ -6,7 +6,7 @@ import android.os.Bundle; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.PresenterType; /** * Date: 18-Dec-15 @@ -32,7 +32,7 @@ * @author Konstantin Tckhovrebov */ public class MvpDelegate { - private static final String KEY_TAG = "com.arellomobile.mvp.MvpDelegate.KEY_TAG"; + private static final String KEY_TAG = "MvpDelegate.KEY_TAG"; public static final String MOXY_DELEGATE_TAGS_KEY = "MoxyDelegateBundle"; private String mKeyTag = KEY_TAG; @@ -194,6 +194,7 @@ public void onDestroyView() { childDelegatesClone.addAll(mChildDelegates); for (MvpDelegate childDelegate : childDelegatesClone) { + childDelegate.onSaveInstanceState(); childDelegate.onDestroyView(); } @@ -259,7 +260,7 @@ public Bundle getChildrenSaveState() { /** * @return generated tag in format: <parent_delegate_tag> <delegated_class_full_name>$MvpDelegate@<hashCode> *

- * example: com.arellomobile.mvp.sample.SampleFragment$MvpDelegate@32649b0 + * example: com.omegar.mvp.sample.SampleFragment$MvpDelegate@32649b0 */ private String generateTag() { String tag = mParentDelegate != null ? mParentDelegate.mDelegateTag + " " : ""; diff --git a/moxy/src/main/java/com/arellomobile/mvp/MvpFacade.java b/moxy/src/main/java/com/omegar/mvp/MvpFacade.java similarity index 97% rename from moxy/src/main/java/com/arellomobile/mvp/MvpFacade.java rename to moxy/src/main/java/com/omegar/mvp/MvpFacade.java index 46185ac1..7e33fcd3 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/MvpFacade.java +++ b/moxy/src/main/java/com/omegar/mvp/MvpFacade.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; /** * Date: 17-Dec-15 diff --git a/moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java b/moxy/src/main/java/com/omegar/mvp/MvpPresenter.java similarity index 96% rename from moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java rename to moxy/src/main/java/com/omegar/mvp/MvpPresenter.java index 7b04d604..98b8d65e 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/MvpPresenter.java +++ b/moxy/src/main/java/com/omegar/mvp/MvpPresenter.java @@ -1,11 +1,11 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.Collections; import java.util.Set; import java.util.WeakHashMap; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.viewstate.MvpViewState; /** * Date: 15.12.2015 @@ -15,6 +15,7 @@ * @author Alexander Blinov * @author Konstantin Tckhovrebov */ +@InjectViewState public abstract class MvpPresenter { private boolean mFirstLaunch = true; private String mTag; diff --git a/moxy/src/main/java/com/arellomobile/mvp/MvpProcessor.java b/moxy/src/main/java/com/omegar/mvp/MvpProcessor.java similarity index 88% rename from moxy/src/main/java/com/arellomobile/mvp/MvpProcessor.java rename to moxy/src/main/java/com/omegar/mvp/MvpProcessor.java index 0034123b..ae2c3a99 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/MvpProcessor.java +++ b/moxy/src/main/java/com/omegar/mvp/MvpProcessor.java @@ -1,11 +1,12 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import com.arellomobile.mvp.presenter.PresenterField; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.PresenterField; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.InjectPresenter; /** * Date: 18-Dec-15 @@ -22,12 +23,12 @@ public class MvpProcessor { /** *

1) Generates tag for identification MvpPresenter

- *

2) Checks if presenter with tag is already exist in {@link com.arellomobile.mvp.PresenterStore}, and returns it

- *

3) If {@link com.arellomobile.mvp.PresenterStore} doesn't contain MvpPresenter with current tag, {@link PresenterField} will create it

+ *

2) Checks if presenter with tag is already exist in {@link PresenterStore}, and returns it

+ *

3) If {@link PresenterStore} doesn't contain MvpPresenter with current tag, {@link PresenterField} will create it

* * @param type of delegated * @param target object that want injection - * @param presenterField info about presenter from {@link com.arellomobile.mvp.presenter.InjectPresenter} + * @param presenterField info about presenter from {@link InjectPresenter} * @param delegateTag unique tag generated by {@link MvpDelegate#generateTag()} @return MvpPresenter instance */ private MvpPresenter getMvpPresenter(Delegated target, PresenterField presenterField, String delegateTag) { @@ -64,7 +65,7 @@ private MvpPresenter getMvpPresenter(Delegated ta } /** - *

Gets presenters {@link java.util.List} annotated with {@link com.arellomobile.mvp.presenter.InjectPresenter} for view.

+ *

Gets presenters {@link java.util.List} annotated with {@link InjectPresenter} for view.

*

See full info about getting presenter instance in {@link #getMvpPresenter}

* * @param delegated class contains presenter diff --git a/moxy/src/main/java/com/arellomobile/mvp/MvpView.java b/moxy/src/main/java/com/omegar/mvp/MvpView.java similarity index 76% rename from moxy/src/main/java/com/arellomobile/mvp/MvpView.java rename to moxy/src/main/java/com/omegar/mvp/MvpView.java index cac3b4f9..cd2c5682 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/MvpView.java +++ b/moxy/src/main/java/com/omegar/mvp/MvpView.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; /** * Date: 21.01.2016 diff --git a/moxy/src/main/java/com/arellomobile/mvp/Pair.java b/moxy/src/main/java/com/omegar/mvp/Pair.java similarity index 98% rename from moxy/src/main/java/com/arellomobile/mvp/Pair.java rename to moxy/src/main/java/com/omegar/mvp/Pair.java index 243aa53f..e9d94b63 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/Pair.java +++ b/moxy/src/main/java/com/omegar/mvp/Pair.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.arellomobile.mvp; +package com.omegar.mvp; /** * Container to ease passing around a tuple of two objects. This object provides a sensible diff --git a/moxy/src/main/java/com/arellomobile/mvp/PresenterBinder.java b/moxy/src/main/java/com/omegar/mvp/PresenterBinder.java similarity index 74% rename from moxy/src/main/java/com/arellomobile/mvp/PresenterBinder.java rename to moxy/src/main/java/com/omegar/mvp/PresenterBinder.java index 9edbb867..595145e5 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/PresenterBinder.java +++ b/moxy/src/main/java/com/omegar/mvp/PresenterBinder.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.List; -import com.arellomobile.mvp.presenter.PresenterField; +import com.omegar.mvp.presenter.PresenterField; /** * Date: 18-Dec-15 diff --git a/moxy/src/main/java/com/arellomobile/mvp/PresenterStore.java b/moxy/src/main/java/com/omegar/mvp/PresenterStore.java similarity index 97% rename from moxy/src/main/java/com/arellomobile/mvp/PresenterStore.java rename to moxy/src/main/java/com/omegar/mvp/PresenterStore.java index cf5e431d..2973a6d6 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/PresenterStore.java +++ b/moxy/src/main/java/com/omegar/mvp/PresenterStore.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.HashMap; import java.util.Map; diff --git a/moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java b/moxy/src/main/java/com/omegar/mvp/PresentersCounter.java similarity index 98% rename from moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java rename to moxy/src/main/java/com/omegar/mvp/PresentersCounter.java index a35ae6c3..4cf30474 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/PresentersCounter.java +++ b/moxy/src/main/java/com/omegar/mvp/PresentersCounter.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.HashMap; import java.util.HashSet; diff --git a/moxy/src/main/java/com/arellomobile/mvp/RegisterMoxyReflectorPackages.java b/moxy/src/main/java/com/omegar/mvp/RegisterMoxyReflectorPackages.java similarity index 89% rename from moxy/src/main/java/com/arellomobile/mvp/RegisterMoxyReflectorPackages.java rename to moxy/src/main/java/com/omegar/mvp/RegisterMoxyReflectorPackages.java index 8b09c9be..0e93b1d2 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/RegisterMoxyReflectorPackages.java +++ b/moxy/src/main/java/com/omegar/mvp/RegisterMoxyReflectorPackages.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.lang.annotation.Target; diff --git a/moxy/src/main/java/com/arellomobile/mvp/ViewStateProvider.java b/moxy/src/main/java/com/omegar/mvp/ViewStateProvider.java similarity index 77% rename from moxy/src/main/java/com/arellomobile/mvp/ViewStateProvider.java rename to moxy/src/main/java/com/omegar/mvp/ViewStateProvider.java index e2d0741b..ecf0ef35 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/ViewStateProvider.java +++ b/moxy/src/main/java/com/omegar/mvp/ViewStateProvider.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; -import com.arellomobile.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.MvpViewState; /** * Date: 18.12.2015 diff --git a/moxy/src/main/java/com/arellomobile/mvp/presenter/InjectPresenter.java b/moxy/src/main/java/com/omegar/mvp/presenter/InjectPresenter.java similarity index 92% rename from moxy/src/main/java/com/arellomobile/mvp/presenter/InjectPresenter.java rename to moxy/src/main/java/com/omegar/mvp/presenter/InjectPresenter.java index ab8c10e1..de7931ce 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/presenter/InjectPresenter.java +++ b/moxy/src/main/java/com/omegar/mvp/presenter/InjectPresenter.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/moxy/src/main/java/com/arellomobile/mvp/presenter/PresenterField.java b/moxy/src/main/java/com/omegar/mvp/presenter/PresenterField.java similarity index 94% rename from moxy/src/main/java/com/arellomobile/mvp/presenter/PresenterField.java rename to moxy/src/main/java/com/omegar/mvp/presenter/PresenterField.java index cf434d10..337e0a53 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/presenter/PresenterField.java +++ b/moxy/src/main/java/com/omegar/mvp/presenter/PresenterField.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; -import com.arellomobile.mvp.*; +import com.omegar.mvp.MvpPresenter; /** * Date: 18-Dec-15 diff --git a/moxy/src/main/java/com/arellomobile/mvp/presenter/PresenterType.java b/moxy/src/main/java/com/omegar/mvp/presenter/PresenterType.java similarity index 70% rename from moxy/src/main/java/com/arellomobile/mvp/presenter/PresenterType.java rename to moxy/src/main/java/com/omegar/mvp/presenter/PresenterType.java index fbc886bc..9ff49519 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/presenter/PresenterType.java +++ b/moxy/src/main/java/com/omegar/mvp/presenter/PresenterType.java @@ -1,9 +1,11 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.PresenterStore; +import com.omegar.mvp.PresentersCounter; /** - * Available presenter types. Manually lifetime control are available over {@link com.arellomobile.mvp.PresenterStore}, {@link com.arellomobile.mvp.PresentersCounter} and {@link MvpPresenter#onDestroy()} + * Available presenter types. Manually lifetime control are available over {@link PresenterStore}, {@link PresentersCounter} and {@link MvpPresenter#onDestroy()} *

* Date: 17-Dec-15 * Time: 19:31 diff --git a/moxy/src/main/java/com/arellomobile/mvp/presenter/ProvidePresenter.java b/moxy/src/main/java/com/omegar/mvp/presenter/ProvidePresenter.java similarity index 92% rename from moxy/src/main/java/com/arellomobile/mvp/presenter/ProvidePresenter.java rename to moxy/src/main/java/com/omegar/mvp/presenter/ProvidePresenter.java index 0822140b..e37fd04b 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/presenter/ProvidePresenter.java +++ b/moxy/src/main/java/com/omegar/mvp/presenter/ProvidePresenter.java @@ -1,4 +1,6 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; + +import com.omegar.mvp.PresenterStore; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -6,7 +8,7 @@ import java.lang.annotation.Target; /** - * Called when Moxy can't find right presenter instance in {@link com.arellomobile.mvp.PresenterStore}. + * Called when Moxy can't find right presenter instance in {@link PresenterStore}. *

Attention! Don't use manually method marked with this annotation! Use presenter field, which you want. If you override this method in inherited classes, make them return same type(not requirements but recommendation).

*

Requirements:

*
    diff --git a/moxy/src/main/java/com/arellomobile/mvp/presenter/ProvidePresenterTag.java b/moxy/src/main/java/com/omegar/mvp/presenter/ProvidePresenterTag.java similarity index 86% rename from moxy/src/main/java/com/arellomobile/mvp/presenter/ProvidePresenterTag.java rename to moxy/src/main/java/com/omegar/mvp/presenter/ProvidePresenterTag.java index c77bff65..e2a24d7d 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/presenter/ProvidePresenterTag.java +++ b/moxy/src/main/java/com/omegar/mvp/presenter/ProvidePresenterTag.java @@ -1,14 +1,15 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.PresenterStore; /** - *

    Called when Moxy generate presenter tag for search Presenter in {@link com.arellomobile.mvp.PresenterStore}.

    + *

    Called when Moxy generate presenter tag for search Presenter in {@link PresenterStore}.

    *

    Requirements:

    *
      *
    • presenterClass parameter should be equals with presenter field type
    • diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java b/moxy/src/main/java/com/omegar/mvp/viewstate/MvpViewState.java similarity index 93% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/MvpViewState.java index 99bc644e..6888998e 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/MvpViewState.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.viewstate; +package com.omegar.mvp.viewstate; import java.util.Collections; import java.util.List; @@ -6,7 +6,8 @@ import java.util.Set; import java.util.WeakHashMap; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.StateStrategy; /** * Date: 15.12.2015 @@ -72,7 +73,7 @@ public void attachView(View view) { /** *

      Detach view from view state. After this moment view state save * commands via - * {@link com.arellomobile.mvp.viewstate.strategy.StateStrategy#beforeApply(List, ViewCommand)}.

      + * {@link StateStrategy#beforeApply(List, ViewCommand)}.

      * * @param view target mvp view to detach */ diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/ViewCommand.java b/moxy/src/main/java/com/omegar/mvp/viewstate/ViewCommand.java similarity index 79% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/ViewCommand.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/ViewCommand.java index 8f4aeaf7..5c89bb65 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/ViewCommand.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/ViewCommand.java @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.viewstate; +package com.omegar.mvp.viewstate; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.StateStrategy; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.StateStrategy; /** * Date: 16-Dec-15 diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/ViewCommands.java b/moxy/src/main/java/com/omegar/mvp/viewstate/ViewCommands.java similarity index 91% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/ViewCommands.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/ViewCommands.java index 044d0aad..d9a5ba8f 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/ViewCommands.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/ViewCommands.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.viewstate; +package com.omegar.mvp.viewstate; import java.util.ArrayList; import java.util.HashMap; @@ -6,9 +6,9 @@ import java.util.Map; import java.util.Set; -import com.arellomobile.mvp.MoxyReflector; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.StateStrategy; +import com.omegar.mvp.MoxyReflector; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.StateStrategy; /** * Date: 17.12.2015 diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndSingleStrategy.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/AddToEndSingleStrategy.java similarity index 86% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndSingleStrategy.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/AddToEndSingleStrategy.java index 41dc9951..ab5cde71 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndSingleStrategy.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/AddToEndSingleStrategy.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; import java.util.Iterator; import java.util.List; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.ViewCommand; /** * Command will be added to end of commands queue. If commands queue contains same type command, then existing command will be removed. diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndStrategy.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/AddToEndStrategy.java similarity index 80% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndStrategy.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/AddToEndStrategy.java index d6864832..3db53910 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndStrategy.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/AddToEndStrategy.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; import java.util.List; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.ViewCommand; /** * Command will be added to end of commands queue. diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/OneExecutionStateStrategy.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/OneExecutionStateStrategy.java similarity index 81% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/OneExecutionStateStrategy.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/OneExecutionStateStrategy.java index 6f4235de..24c94162 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/OneExecutionStateStrategy.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/OneExecutionStateStrategy.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; import java.util.List; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.ViewCommand; /** * Command will be saved in commands queue. And this command will be removed after first execution. diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/SingleStateStrategy.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/SingleStateStrategy.java similarity index 83% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/SingleStateStrategy.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/SingleStateStrategy.java index f997e6cc..8f68b8eb 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/SingleStateStrategy.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/SingleStateStrategy.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; import java.util.List; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.ViewCommand; /** * This strategy will clear current commands queue and then incoming command will be put in. diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/SkipStrategy.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/SkipStrategy.java similarity index 78% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/SkipStrategy.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/SkipStrategy.java index a635b6c6..5b48cca9 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/SkipStrategy.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/SkipStrategy.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; import java.util.List; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.ViewCommand; /** * Command will not be put in commands queue diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/StateStrategy.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/StateStrategy.java similarity index 78% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/StateStrategy.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/StateStrategy.java index 1b9d6215..16fd3db7 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/StateStrategy.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/StateStrategy.java @@ -1,7 +1,8 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.ViewCommand; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.MvpViewState; +import com.omegar.mvp.viewstate.ViewCommand; import java.util.List; @@ -21,12 +22,12 @@ public interface StateStrategy { /** * Called immediately after - * {@link com.arellomobile.mvp.viewstate.MvpViewState} receive some + * {@link MvpViewState} receive some * command. Will not be called before re-apply to some other * {@link MvpView} * * @param currentState current state of - * {@link com.arellomobile.mvp.viewstate.MvpViewState}. Each {@link ViewCommand} + * {@link MvpViewState}. Each {@link ViewCommand} * contains self parameters. * @param incomingCommand command for apply to {@link MvpView} This * {@link ViewCommand} contains params of this command. @@ -39,7 +40,7 @@ public interface StateStrategy { * after re-apply to other views. * * @param currentState current state of - * {@link com.arellomobile.mvp.viewstate.MvpViewState}. Each {@link ViewCommand} + * {@link MvpViewState}. Each {@link ViewCommand} * contains self parameters. * @param incomingCommand applied command to {@link MvpView} This * {@link ViewCommand} contains params of this command. diff --git a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/StateStrategyType.java b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/StateStrategyType.java similarity index 79% rename from moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/StateStrategyType.java rename to moxy/src/main/java/com/omegar/mvp/viewstate/strategy/StateStrategyType.java index b9bab0eb..b7a91fcd 100644 --- a/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/StateStrategyType.java +++ b/moxy/src/main/java/com/omegar/mvp/viewstate/strategy/StateStrategyType.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.viewstate.strategy; +package com.omegar.mvp.viewstate.strategy; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -12,7 +12,7 @@ * @author Yuri Shmakov * @author Alexander Blinov */ -@Target(value = {ElementType.TYPE, ElementType.METHOD}) +@Target(value = {ElementType.METHOD}) @Retention(value = RetentionPolicy.RUNTIME) public @interface StateStrategyType { Class value(); diff --git a/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePresenter2.java b/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePresenter2.java deleted file mode 100644 index 7b1d7792..00000000 --- a/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePresenter2.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.arellomobile.mvp.presenter; - -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.view.TestView2; - -/** - * Date: 15.03.2016 - * Time: 13:57 - * - * @author Savin Mikhail - */ -@InjectViewState -public class InjectViewStatePresenter2 extends MvpPresenter { -} diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/DelegateLocalPresenter2TestView.java b/moxy/src/test/java/com/arellomobile/mvp/view/DelegateLocalPresenter2TestView.java deleted file mode 100644 index 52139b52..00000000 --- a/moxy/src/test/java/com/arellomobile/mvp/view/DelegateLocalPresenter2TestView.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.arellomobile.mvp.view; - -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; - -public class DelegateLocalPresenter2TestView extends CounterTestView { - @InjectPresenter(type = PresenterType.LOCAL) - public InjectViewStatePresenter mInjectViewStatePresenter; -} \ No newline at end of file diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/DelegateLocalPresenterTestView.java b/moxy/src/test/java/com/arellomobile/mvp/view/DelegateLocalPresenterTestView.java deleted file mode 100644 index f48ed4d5..00000000 --- a/moxy/src/test/java/com/arellomobile/mvp/view/DelegateLocalPresenterTestView.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.arellomobile.mvp.view; - -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; - -public class DelegateLocalPresenterTestView extends CounterTestView { - @InjectPresenter(type = PresenterType.LOCAL) - public InjectViewStatePresenter mInjectViewStatePresenter; -} \ No newline at end of file diff --git a/moxy/src/test/java/com/arellomobile/mvp/compiler/CompilerTest.java b/moxy/src/test/java/com/omegar/mvp/compiler/CompilerTest.java similarity index 98% rename from moxy/src/test/java/com/arellomobile/mvp/compiler/CompilerTest.java rename to moxy/src/test/java/com/omegar/mvp/compiler/CompilerTest.java index da70b1b4..9d632ac7 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/compiler/CompilerTest.java +++ b/moxy/src/test/java/com/omegar/mvp/compiler/CompilerTest.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import com.google.common.collect.HashBasedTable; import com.google.common.collect.ImmutableList; @@ -98,7 +98,7 @@ protected void assertCompilationResultIs(Table classNames = Lists.newArrayList(); List sourceFiles = Lists.newArrayList(); diff --git a/moxy/src/test/java/com/arellomobile/mvp/compiler/ErrorProcessor.java b/moxy/src/test/java/com/omegar/mvp/compiler/ErrorProcessor.java similarity index 97% rename from moxy/src/test/java/com/arellomobile/mvp/compiler/ErrorProcessor.java rename to moxy/src/test/java/com/omegar/mvp/compiler/ErrorProcessor.java index e194074d..08c1de84 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/compiler/ErrorProcessor.java +++ b/moxy/src/test/java/com/omegar/mvp/compiler/ErrorProcessor.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; diff --git a/moxy/src/test/java/com/arellomobile/mvp/compiler/ViewStateClassTest.java b/moxy/src/test/java/com/omegar/mvp/compiler/ViewStateClassTest.java similarity index 96% rename from moxy/src/test/java/com/arellomobile/mvp/compiler/ViewStateClassTest.java rename to moxy/src/test/java/com/omegar/mvp/compiler/ViewStateClassTest.java index 5436858c..152bae57 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/compiler/ViewStateClassTest.java +++ b/moxy/src/test/java/com/omegar/mvp/compiler/ViewStateClassTest.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import java.io.IOException; import java.util.regex.Pattern; diff --git a/moxy/src/test/java/com/arellomobile/mvp/compiler/ViewStateProviderClassTest.java b/moxy/src/test/java/com/omegar/mvp/compiler/ViewStateProviderClassTest.java similarity index 94% rename from moxy/src/test/java/com/arellomobile/mvp/compiler/ViewStateProviderClassTest.java rename to moxy/src/test/java/com/omegar/mvp/compiler/ViewStateProviderClassTest.java index 48898b6d..9fb74235 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/compiler/ViewStateProviderClassTest.java +++ b/moxy/src/test/java/com/omegar/mvp/compiler/ViewStateProviderClassTest.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.compiler; +package com.omegar.mvp.compiler; import java.io.IOException; import java.util.regex.Pattern; diff --git a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/InheritanceTest.java b/moxy/src/test/java/com/omegar/mvp/inheritance_test/InheritanceTest.java similarity index 76% rename from moxy/src/test/java/com/arellomobile/mvp/inheritance_test/InheritanceTest.java rename to moxy/src/test/java/com/omegar/mvp/inheritance_test/InheritanceTest.java index 2d94bef7..664da7bd 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/InheritanceTest.java +++ b/moxy/src/test/java/com/omegar/mvp/inheritance_test/InheritanceTest.java @@ -1,11 +1,11 @@ -package com.arellomobile.mvp.inheritance_test; +package com.omegar.mvp.inheritance_test; import android.os.Bundle; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.inheritance_test.resources.ChildViewWithoutInject; -import com.arellomobile.mvp.inheritance_test.resources.SuperViewWithInject; -import com.arellomobile.mvp.inheritance_test.resources.ViewWithoutInject; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.inheritance_test.resources.ChildViewWithoutInject; +import com.omegar.mvp.inheritance_test.resources.SuperViewWithInject; +import com.omegar.mvp.inheritance_test.resources.ViewWithoutInject; import org.junit.Assert; import org.junit.Test; diff --git a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/ChildViewWithoutInject.java b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/ChildViewWithoutInject.java similarity index 73% rename from moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/ChildViewWithoutInject.java rename to moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/ChildViewWithoutInject.java index c6d2a583..753f3422 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/ChildViewWithoutInject.java +++ b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/ChildViewWithoutInject.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.inheritance_test.resources; +package com.omegar.mvp.inheritance_test.resources; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/SuperViewWithInject.java b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/SuperViewWithInject.java similarity index 64% rename from moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/SuperViewWithInject.java rename to moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/SuperViewWithInject.java index bdf04d57..9b91223e 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/SuperViewWithInject.java +++ b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/SuperViewWithInject.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.inheritance_test.resources; +package com.omegar.mvp.inheritance_test.resources; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectPresenter; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/TestPresenter.java b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/TestPresenter.java similarity index 62% rename from moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/TestPresenter.java rename to moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/TestPresenter.java index 806d6462..c68d4475 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/TestPresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/TestPresenter.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.inheritance_test.resources; +package com.omegar.mvp.inheritance_test.resources; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.MvpPresenter; /** * Date: 29.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/TestView.java b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/TestView.java similarity index 55% rename from moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/TestView.java rename to moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/TestView.java index 1a933847..1513de2d 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/TestView.java +++ b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/TestView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.inheritance_test.resources; +package com.omegar.mvp.inheritance_test.resources; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 29.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/ViewWithoutInject.java b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/ViewWithoutInject.java similarity index 62% rename from moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/ViewWithoutInject.java rename to moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/ViewWithoutInject.java index f72090dd..791a8acd 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/inheritance_test/resources/ViewWithoutInject.java +++ b/moxy/src/test/java/com/omegar/mvp/inheritance_test/resources/ViewWithoutInject.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.inheritance_test.resources; +package com.omegar.mvp.inheritance_test.resources; -import com.arellomobile.mvp.MvpDelegate; +import com.omegar.mvp.MvpDelegate; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/MemoryLeakTest.java b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/MemoryLeakTest.java similarity index 89% rename from moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/MemoryLeakTest.java rename to moxy/src/test/java/com/omegar/mvp/memory_leak_test/MemoryLeakTest.java index 0494b6b4..1b9e7d84 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/MemoryLeakTest.java +++ b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/MemoryLeakTest.java @@ -1,12 +1,12 @@ -package com.arellomobile.mvp.memory_leak_test; +package com.omegar.mvp.memory_leak_test; import java.lang.ref.WeakReference; import java.util.concurrent.TimeUnit; import android.os.Bundle; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.memory_leak_test.resources.TestViewImplementation; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.memory_leak_test.resources.TestViewImplementation; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestPresenter.java b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestPresenter.java similarity index 57% rename from moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestPresenter.java rename to moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestPresenter.java index 6e46dbb1..64310248 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestPresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestPresenter.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.memory_leak_test.resources; +package com.omegar.mvp.memory_leak_test.resources; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.MvpPresenter; /** * Date: 29.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestView.java b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestView.java similarity index 55% rename from moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestView.java rename to moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestView.java index 050b49e8..09e7f4cc 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestView.java +++ b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.memory_leak_test.resources; +package com.omegar.mvp.memory_leak_test.resources; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 29.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestViewImplementation.java b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestViewImplementation.java similarity index 60% rename from moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestViewImplementation.java rename to moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestViewImplementation.java index 82b6c7a7..41d9e515 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/memory_leak_test/resources/TestViewImplementation.java +++ b/moxy/src/test/java/com/omegar/mvp/memory_leak_test/resources/TestViewImplementation.java @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.memory_leak_test.resources; +package com.omegar.mvp.memory_leak_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; /** * Date: 29.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePositivePresenter.java b/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePositivePresenter.java similarity index 50% rename from moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePositivePresenter.java rename to moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePositivePresenter.java index a4f16464..75a1aa5b 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePositivePresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePositivePresenter.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.view.PositiveViewStateView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.PositiveViewStateView; /** * Date: 15.03.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePresenter.java b/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePresenter.java similarity index 65% rename from moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePresenter.java rename to moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePresenter.java index a27193d6..69795ba5 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/presenter/InjectViewStatePresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePresenter.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; -import com.arellomobile.mvp.InjectViewState; +import com.omegar.mvp.InjectViewState; /** * Date: 08.02.2016 diff --git a/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePresenter2.java b/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePresenter2.java new file mode 100644 index 00000000..2fbbd1d4 --- /dev/null +++ b/moxy/src/test/java/com/omegar/mvp/presenter/InjectViewStatePresenter2.java @@ -0,0 +1,15 @@ +package com.omegar.mvp.presenter; + +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.TestView2; + +/** + * Date: 15.03.2016 + * Time: 13:57 + * + * @author Savin Mikhail + */ +@InjectViewState +public class InjectViewStatePresenter2 extends MvpPresenter { +} diff --git a/moxy/src/test/java/com/arellomobile/mvp/presenter/NoViewStatePresenter.java b/moxy/src/test/java/com/omegar/mvp/presenter/NoViewStatePresenter.java similarity index 77% rename from moxy/src/test/java/com/arellomobile/mvp/presenter/NoViewStatePresenter.java rename to moxy/src/test/java/com/omegar/mvp/presenter/NoViewStatePresenter.java index 68323023..205e6e8a 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/presenter/NoViewStatePresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/presenter/NoViewStatePresenter.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; /** * Date: 08.02.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/presenter/PositiveViewStateProviderPresenter.java b/moxy/src/test/java/com/omegar/mvp/presenter/PositiveViewStateProviderPresenter.java similarity index 50% rename from moxy/src/test/java/com/arellomobile/mvp/presenter/PositiveViewStateProviderPresenter.java rename to moxy/src/test/java/com/omegar/mvp/presenter/PositiveViewStateProviderPresenter.java index 26b4f58c..cc01f70d 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/presenter/PositiveViewStateProviderPresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/presenter/PositiveViewStateProviderPresenter.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.view.PositiveViewStateView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.PositiveViewStateView; /** diff --git a/moxy/src/test/java/com/arellomobile/mvp/presenter/TestViewPresenter.java b/moxy/src/test/java/com/omegar/mvp/presenter/TestViewPresenter.java similarity index 61% rename from moxy/src/test/java/com/arellomobile/mvp/presenter/TestViewPresenter.java rename to moxy/src/test/java/com/omegar/mvp/presenter/TestViewPresenter.java index e592d9e2..87672779 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/presenter/TestViewPresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/presenter/TestViewPresenter.java @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.presenter; +package com.omegar.mvp.presenter; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.view.TestView; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.TestView; /** * Date: 10.02.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/ProvideMethodsTest.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/ProvideMethodsTest.java similarity index 80% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/ProvideMethodsTest.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/ProvideMethodsTest.java index 84f388af..7e91ca6c 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/ProvideMethodsTest.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/ProvideMethodsTest.java @@ -1,12 +1,12 @@ -package com.arellomobile.mvp.provide_methods_test; +package com.omegar.mvp.provide_methods_test; import android.os.Bundle; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.provide_methods_test.resources.LocalProvidedView; -import com.arellomobile.mvp.provide_methods_test.resources.TwoLocalProvidedView; -import com.arellomobile.mvp.provide_methods_test.resources.TwoWeakWithSamePresenterIdView; -import com.arellomobile.mvp.provide_methods_test.resources.WeakProvidedView; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.provide_methods_test.resources.LocalProvidedView; +import com.omegar.mvp.provide_methods_test.resources.TwoLocalProvidedView; +import com.omegar.mvp.provide_methods_test.resources.TwoWeakWithSamePresenterIdView; +import com.omegar.mvp.provide_methods_test.resources.WeakProvidedView; import org.junit.Assert; import org.junit.Test; diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/LocalProvidedView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/LocalProvidedView.java similarity index 67% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/LocalProvidedView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/LocalProvidedView.java index d1c441b1..f4edabbf 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/LocalProvidedView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/LocalProvidedView.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/SuperView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/SuperView.java similarity index 76% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/SuperView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/SuperView.java index d25d54d6..d86f5267 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/SuperView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/SuperView.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TestPresenter.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TestPresenter.java similarity index 56% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TestPresenter.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TestPresenter.java index 3ff2f8a9..596106e1 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TestPresenter.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TestPresenter.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.MvpPresenter; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TestView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TestView.java similarity index 54% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TestView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TestView.java index cea7a155..556a5f3e 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TestView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TestView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoLocalProvidedView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoLocalProvidedView.java similarity index 65% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoLocalProvidedView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoLocalProvidedView.java index 8550ff08..8faef35b 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoLocalProvidedView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoLocalProvidedView.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoWeakWithDiffPresenterIdView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoWeakWithDiffPresenterIdView.java similarity index 78% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoWeakWithDiffPresenterIdView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoWeakWithDiffPresenterIdView.java index 354a59eb..4499f130 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoWeakWithDiffPresenterIdView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoWeakWithDiffPresenterIdView.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.presenter.ProvidePresenter; -import com.arellomobile.mvp.presenter.ProvidePresenterTag; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenterTag; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoWeakWithSamePresenterIdView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoWeakWithSamePresenterIdView.java similarity index 70% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoWeakWithSamePresenterIdView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoWeakWithSamePresenterIdView.java index db1d8682..7c13d833 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/TwoWeakWithSamePresenterIdView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/TwoWeakWithSamePresenterIdView.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.presenter.ProvidePresenter; -import com.arellomobile.mvp.presenter.ProvidePresenterTag; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.presenter.ProvidePresenterTag; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/WeakProvidedView.java b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/WeakProvidedView.java similarity index 66% rename from moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/WeakProvidedView.java rename to moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/WeakProvidedView.java index d4877256..a76ab3f4 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/provide_methods_test/resources/WeakProvidedView.java +++ b/moxy/src/test/java/com/omegar/mvp/provide_methods_test/resources/WeakProvidedView.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.provide_methods_test.resources; +package com.omegar.mvp.provide_methods_test.resources; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.ProvidePresenter; /** * Date: 30.12.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/tests/LocalPresenterTest.java b/moxy/src/test/java/com/omegar/mvp/tests/LocalPresenterTest.java similarity index 90% rename from moxy/src/test/java/com/arellomobile/mvp/tests/LocalPresenterTest.java rename to moxy/src/test/java/com/omegar/mvp/tests/LocalPresenterTest.java index 70d14a96..c1b7832b 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/tests/LocalPresenterTest.java +++ b/moxy/src/test/java/com/omegar/mvp/tests/LocalPresenterTest.java @@ -1,15 +1,15 @@ -package com.arellomobile.mvp.tests; +package com.omegar.mvp.tests; import java.lang.reflect.Field; import android.os.Bundle; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.NoViewStatePresenter; -import com.arellomobile.mvp.view.DelegateLocalPresenterTestView; -import com.arellomobile.mvp.view.TestView; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.NoViewStatePresenter; +import com.omegar.mvp.view.DelegateLocalPresenterTestView; +import com.omegar.mvp.view.TestView; import org.junit.After; import org.junit.Before; @@ -115,7 +115,7 @@ public void checkSaveState() { mTestViewMvpDelegate.onCreate(bundle); mTestViewMvpDelegate.onAttach(); - //TODO: should be passed! Or change test + //TODO: should be passed! Or change generateInfos //assertTrue("Local presenter has different hashCode after recreate", hashCode == mDelegateLocalPresenterTestView.mInjectViewStatePresenter.hashCode()); mTestViewMvpDelegate.onDetach(); diff --git a/moxy/src/test/java/com/arellomobile/mvp/tests/MvpDelegateTest.java b/moxy/src/test/java/com/omegar/mvp/tests/MvpDelegateTest.java similarity index 82% rename from moxy/src/test/java/com/arellomobile/mvp/tests/MvpDelegateTest.java rename to moxy/src/test/java/com/omegar/mvp/tests/MvpDelegateTest.java index 1744e852..3c8c52b4 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/tests/MvpDelegateTest.java +++ b/moxy/src/test/java/com/omegar/mvp/tests/MvpDelegateTest.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.tests; +package com.omegar.mvp.tests; import android.os.Bundle; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.view.DelegateLocalPresenterTestView; -import com.arellomobile.mvp.view.TestView; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.view.DelegateLocalPresenterTestView; +import com.omegar.mvp.view.TestView; import org.junit.After; import org.junit.Before; diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/ChildView.java b/moxy/src/test/java/com/omegar/mvp/view/ChildView.java similarity index 50% rename from moxy/src/test/java/com/arellomobile/mvp/view/ChildView.java rename to moxy/src/test/java/com/omegar/mvp/view/ChildView.java index 64d1b570..acdf1473 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/ChildView.java +++ b/moxy/src/test/java/com/omegar/mvp/view/ChildView.java @@ -1,8 +1,7 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.viewstate.strategy.SkipStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.viewstate.strategy.SkipStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 29.02.2016 @@ -10,7 +9,6 @@ * * @author Savin Mikhail */ -@GenerateViewState @StateStrategyType(SkipStrategy.class) public interface ChildView extends ParentView, SimpleInterface { @Override diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/CounterTestView.java b/moxy/src/test/java/com/omegar/mvp/view/CounterTestView.java similarity index 93% rename from moxy/src/test/java/com/arellomobile/mvp/view/CounterTestView.java rename to moxy/src/test/java/com/omegar/mvp/view/CounterTestView.java index 049b4933..4b6e68f4 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/CounterTestView.java +++ b/moxy/src/test/java/com/omegar/mvp/view/CounterTestView.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; import java.util.HashMap; import java.util.Map; diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/DelegateGlobalTestView.java b/moxy/src/test/java/com/omegar/mvp/view/DelegateGlobalTestView.java similarity index 57% rename from moxy/src/test/java/com/arellomobile/mvp/view/DelegateGlobalTestView.java rename to moxy/src/test/java/com/omegar/mvp/view/DelegateGlobalTestView.java index 1c4d3d69..62f10473 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/DelegateGlobalTestView.java +++ b/moxy/src/test/java/com/omegar/mvp/view/DelegateGlobalTestView.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.PresenterType; public class DelegateGlobalTestView extends CounterTestView { public static final String TEST_GLOBAL_PRESENTER = "TestGlobalPresenter"; diff --git a/moxy/src/test/java/com/omegar/mvp/view/DelegateLocalPresenter2TestView.java b/moxy/src/test/java/com/omegar/mvp/view/DelegateLocalPresenter2TestView.java new file mode 100644 index 00000000..55e0c8ea --- /dev/null +++ b/moxy/src/test/java/com/omegar/mvp/view/DelegateLocalPresenter2TestView.java @@ -0,0 +1,10 @@ +package com.omegar.mvp.view; + +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.PresenterType; + +public class DelegateLocalPresenter2TestView extends CounterTestView { + @InjectPresenter(type = PresenterType.LOCAL) + public InjectViewStatePresenter mInjectViewStatePresenter; +} \ No newline at end of file diff --git a/moxy/src/test/java/com/omegar/mvp/view/DelegateLocalPresenterTestView.java b/moxy/src/test/java/com/omegar/mvp/view/DelegateLocalPresenterTestView.java new file mode 100644 index 00000000..76d80afe --- /dev/null +++ b/moxy/src/test/java/com/omegar/mvp/view/DelegateLocalPresenterTestView.java @@ -0,0 +1,10 @@ +package com.omegar.mvp.view; + +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.PresenterType; + +public class DelegateLocalPresenterTestView extends CounterTestView { + @InjectPresenter(type = PresenterType.LOCAL) + public InjectViewStatePresenter mInjectViewStatePresenter; +} \ No newline at end of file diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/ParentView.java b/moxy/src/test/java/com/omegar/mvp/view/ParentView.java similarity index 54% rename from moxy/src/test/java/com/arellomobile/mvp/view/ParentView.java rename to moxy/src/test/java/com/omegar/mvp/view/ParentView.java index da71d5f7..a7802c32 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/ParentView.java +++ b/moxy/src/test/java/com/omegar/mvp/view/ParentView.java @@ -1,9 +1,8 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 29.02.2016 @@ -11,7 +10,6 @@ * * @author Savin Mikhail */ -@GenerateViewState public interface ParentView extends MvpView { void withoutStrategyMethod(); diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/PositiveViewStateView.java b/moxy/src/test/java/com/omegar/mvp/view/PositiveViewStateView.java similarity index 67% rename from moxy/src/test/java/com/arellomobile/mvp/view/PositiveViewStateView.java rename to moxy/src/test/java/com/omegar/mvp/view/PositiveViewStateView.java index 977bd670..7a4640a0 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/PositiveViewStateView.java +++ b/moxy/src/test/java/com/omegar/mvp/view/PositiveViewStateView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 26.02.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/SimpleInterface.java b/moxy/src/test/java/com/omegar/mvp/view/SimpleInterface.java similarity index 79% rename from moxy/src/test/java/com/arellomobile/mvp/view/SimpleInterface.java rename to moxy/src/test/java/com/omegar/mvp/view/SimpleInterface.java index 7897aec2..d0d7ef3b 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/SimpleInterface.java +++ b/moxy/src/test/java/com/omegar/mvp/view/SimpleInterface.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; /** * Date: 29.02.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/TestView.java b/moxy/src/test/java/com/omegar/mvp/view/TestView.java similarity index 65% rename from moxy/src/test/java/com/arellomobile/mvp/view/TestView.java rename to moxy/src/test/java/com/omegar/mvp/view/TestView.java index bdd65b11..b34be71a 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/TestView.java +++ b/moxy/src/test/java/com/omegar/mvp/view/TestView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 08.02.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/TestView2.java b/moxy/src/test/java/com/omegar/mvp/view/TestView2.java similarity index 67% rename from moxy/src/test/java/com/arellomobile/mvp/view/TestView2.java rename to moxy/src/test/java/com/omegar/mvp/view/TestView2.java index d0d62467..b9a8b727 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/TestView2.java +++ b/moxy/src/test/java/com/omegar/mvp/view/TestView2.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 15.03.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/TestViewChild.java b/moxy/src/test/java/com/omegar/mvp/view/TestViewChild.java similarity index 67% rename from moxy/src/test/java/com/arellomobile/mvp/view/TestViewChild.java rename to moxy/src/test/java/com/omegar/mvp/view/TestViewChild.java index 9e48576c..ea6759e6 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/TestViewChild.java +++ b/moxy/src/test/java/com/omegar/mvp/view/TestViewChild.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 04.03.2016 diff --git a/moxy/src/test/java/com/arellomobile/mvp/view/TestViewChild2.java b/moxy/src/test/java/com/omegar/mvp/view/TestViewChild2.java similarity index 68% rename from moxy/src/test/java/com/arellomobile/mvp/view/TestViewChild2.java rename to moxy/src/test/java/com/omegar/mvp/view/TestViewChild2.java index 162a7767..2cd38475 100644 --- a/moxy/src/test/java/com/arellomobile/mvp/view/TestViewChild2.java +++ b/moxy/src/test/java/com/omegar/mvp/view/TestViewChild2.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.view; +package com.omegar.mvp.view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 04.03.2016 diff --git a/moxy/src/test/resources/params/EmptyParams.java b/moxy/src/test/resources/params/EmptyParams.java index de125b96..8e12fed1 100644 --- a/moxy/src/test/resources/params/EmptyParams.java +++ b/moxy/src/test/resources/params/EmptyParams.java @@ -1,7 +1,7 @@ package params; -import com.arellomobile.mvp.ParamsProvider; -import com.arellomobile.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.ParamsProvider; +import com.omegar.mvp.factory.MockPresenterFactory; /** * Date: 24.02.2016 diff --git a/moxy/src/test/resources/params/IncorrectCountOfParametersParams.java b/moxy/src/test/resources/params/IncorrectCountOfParametersParams.java index eb4d50f1..4b43e354 100644 --- a/moxy/src/test/resources/params/IncorrectCountOfParametersParams.java +++ b/moxy/src/test/resources/params/IncorrectCountOfParametersParams.java @@ -1,7 +1,7 @@ package params; -import com.arellomobile.mvp.ParamsProvider; -import com.arellomobile.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.ParamsProvider; +import com.omegar.mvp.factory.MockPresenterFactory; /** * Date: 24.02.2016 diff --git a/moxy/src/test/resources/params/IncorrectParametersParams.java b/moxy/src/test/resources/params/IncorrectParametersParams.java index 293828a7..bb673c12 100644 --- a/moxy/src/test/resources/params/IncorrectParametersParams.java +++ b/moxy/src/test/resources/params/IncorrectParametersParams.java @@ -1,7 +1,7 @@ package params; -import com.arellomobile.mvp.ParamsProvider; -import com.arellomobile.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.ParamsProvider; +import com.omegar.mvp.factory.MockPresenterFactory; /** * Date: 24.02.2016 diff --git a/moxy/src/test/resources/params/Params1.java b/moxy/src/test/resources/params/Params1.java index e5d29701..42c606b3 100644 --- a/moxy/src/test/resources/params/Params1.java +++ b/moxy/src/test/resources/params/Params1.java @@ -1,7 +1,7 @@ package params; -import com.arellomobile.mvp.ParamsProvider; -import com.arellomobile.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.ParamsProvider; +import com.omegar.mvp.factory.MockPresenterFactory; /** * Date: 25.02.2016 diff --git a/moxy/src/test/resources/params/Params2.java b/moxy/src/test/resources/params/Params2.java index cc45fab0..18922ac2 100644 --- a/moxy/src/test/resources/params/Params2.java +++ b/moxy/src/test/resources/params/Params2.java @@ -1,7 +1,7 @@ package params; -import com.arellomobile.mvp.ParamsProvider; -import com.arellomobile.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.ParamsProvider; +import com.omegar.mvp.factory.MockPresenterFactory; /** * Date: 25.02.2016 diff --git a/moxy/src/test/resources/params/SeveralMethodParams.java b/moxy/src/test/resources/params/SeveralMethodParams.java index 751920e9..030ca62c 100644 --- a/moxy/src/test/resources/params/SeveralMethodParams.java +++ b/moxy/src/test/resources/params/SeveralMethodParams.java @@ -1,7 +1,7 @@ package params; -import com.arellomobile.mvp.ParamsProvider; -import com.arellomobile.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.ParamsProvider; +import com.omegar.mvp.factory.MockPresenterFactory; /** * Date: 24.02.2016 diff --git a/moxy/src/test/resources/presenter/InjectViewStateForClassPresenter.java b/moxy/src/test/resources/presenter/InjectViewStateForClassPresenter.java index 5ebaafa8..733d976d 100644 --- a/moxy/src/test/resources/presenter/InjectViewStateForClassPresenter.java +++ b/moxy/src/test/resources/presenter/InjectViewStateForClassPresenter.java @@ -1,8 +1,8 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.view.CounterTestView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.CounterTestView; /** * Date: 15.03.2016 diff --git a/moxy/src/test/resources/presenter/InjectViewStateForGenericPresenter.java b/moxy/src/test/resources/presenter/InjectViewStateForGenericPresenter.java index 9237e665..54cd9298 100644 --- a/moxy/src/test/resources/presenter/InjectViewStateForGenericPresenter.java +++ b/moxy/src/test/resources/presenter/InjectViewStateForGenericPresenter.java @@ -1,8 +1,8 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.view.CounterTestView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.CounterTestView; /** * Date: 15.03.2016 diff --git a/moxy/src/test/resources/presenter/InjectViewStateForGenericViewPresenter.java b/moxy/src/test/resources/presenter/InjectViewStateForGenericViewPresenter.java index 6a088565..cc105c42 100644 --- a/moxy/src/test/resources/presenter/InjectViewStateForGenericViewPresenter.java +++ b/moxy/src/test/resources/presenter/InjectViewStateForGenericViewPresenter.java @@ -1,9 +1,7 @@ package view; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; - -import view.ViewStateForGenericView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; /** * Date: 15.03.2016 diff --git a/moxy/src/test/resources/presenter/PositiveParamsViewPresenter.java b/moxy/src/test/resources/presenter/PositiveParamsViewPresenter.java index b08e946a..af928248 100644 --- a/moxy/src/test/resources/presenter/PositiveParamsViewPresenter.java +++ b/moxy/src/test/resources/presenter/PositiveParamsViewPresenter.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpView; /** * Date: 10.02.2016 diff --git a/moxy/src/test/resources/presenter/PositiveViewStateProviderForNotPresenter.java b/moxy/src/test/resources/presenter/PositiveViewStateProviderForNotPresenter.java index e35298ca..d0ceddf5 100644 --- a/moxy/src/test/resources/presenter/PositiveViewStateProviderForNotPresenter.java +++ b/moxy/src/test/resources/presenter/PositiveViewStateProviderForNotPresenter.java @@ -1,9 +1,6 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; - -import view.PositiveViewStateView; +import com.omegar.mvp.InjectViewState; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/presenter/PositiveViewStateProviderPresenter.java b/moxy/src/test/resources/presenter/PositiveViewStateProviderPresenter.java index f82b191f..149c81d6 100644 --- a/moxy/src/test/resources/presenter/PositiveViewStateProviderPresenter.java +++ b/moxy/src/test/resources/presenter/PositiveViewStateProviderPresenter.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; import view.PositiveViewStateView; diff --git a/moxy/src/test/resources/presenter/PresenterWithoutEmptyConstructor.java b/moxy/src/test/resources/presenter/PresenterWithoutEmptyConstructor.java index 6f2cd48e..e56f3c6d 100644 --- a/moxy/src/test/resources/presenter/PresenterWithoutEmptyConstructor.java +++ b/moxy/src/test/resources/presenter/PresenterWithoutEmptyConstructor.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpView; /** * Date: 25.02.2016 diff --git a/moxy/src/test/resources/presenter/ViewStateChildWithIncorrectStrategyClassPresenter.java b/moxy/src/test/resources/presenter/ViewStateChildWithIncorrectStrategyClassPresenter.java index 70c85e82..fd236270 100644 --- a/moxy/src/test/resources/presenter/ViewStateChildWithIncorrectStrategyClassPresenter.java +++ b/moxy/src/test/resources/presenter/ViewStateChildWithIncorrectStrategyClassPresenter.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; import view.ViewStateChildWithIncorrectStrategyClassView; diff --git a/moxy/src/test/resources/presenter/ViewStateProviderForViewWithoutGenerateViewAnnotationPresenter.java b/moxy/src/test/resources/presenter/ViewStateProviderForViewWithoutGenerateViewAnnotationPresenter.java index 62a777a4..1f7bff82 100644 --- a/moxy/src/test/resources/presenter/ViewStateProviderForViewWithoutGenerateViewAnnotationPresenter.java +++ b/moxy/src/test/resources/presenter/ViewStateProviderForViewWithoutGenerateViewAnnotationPresenter.java @@ -1,7 +1,7 @@ package presenter; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; import view.WithoutGenerateViewAnnotationView; diff --git a/moxy/src/test/resources/presenter/WithViewGenericPresenter.java b/moxy/src/test/resources/presenter/WithViewGenericPresenter.java index 4e6f62bb..fb61f102 100644 --- a/moxy/src/test/resources/presenter/WithViewGenericPresenter.java +++ b/moxy/src/test/resources/presenter/WithViewGenericPresenter.java @@ -1,12 +1,6 @@ package presenter; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.view.CounterTestView; -import com.arellomobile.mvp.view.TestView; -import com.arellomobile.mvp.view.TestViewChild; - -import view.PositiveParamsView; +import com.omegar.mvp.view.CounterTestView; /** * Date: 04.03.2016 diff --git a/moxy/src/test/resources/presenter/WithViewGenericPresenter2.java b/moxy/src/test/resources/presenter/WithViewGenericPresenter2.java index 67f04e2c..2fe8903a 100644 --- a/moxy/src/test/resources/presenter/WithViewGenericPresenter2.java +++ b/moxy/src/test/resources/presenter/WithViewGenericPresenter2.java @@ -1,12 +1,8 @@ package presenter; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.view.CounterTestView; -import com.arellomobile.mvp.view.TestView; -import com.arellomobile.mvp.view.TestViewChild; - -import view.PositiveParamsView; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.view.CounterTestView; +import com.omegar.mvp.view.TestView; /** * Date: 04.03.2016 diff --git a/moxy/src/test/resources/view/EmptyParamsView.java b/moxy/src/test/resources/view/EmptyParamsView.java index 24d69826..2137de8b 100644 --- a/moxy/src/test/resources/view/EmptyParamsView.java +++ b/moxy/src/test/resources/view/EmptyParamsView.java @@ -1,11 +1,10 @@ -package com.arellomobile.mvp.compiler.view; +package com.omegar.mvp.compiler.view; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.factory.MockPresenterFactory; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; import params.EmptyParams; diff --git a/moxy/src/test/resources/view/IncorrectCountOfParametersParamsView.java b/moxy/src/test/resources/view/IncorrectCountOfParametersParamsView.java index 2da8e0d9..0591eb69 100644 --- a/moxy/src/test/resources/view/IncorrectCountOfParametersParamsView.java +++ b/moxy/src/test/resources/view/IncorrectCountOfParametersParamsView.java @@ -1,13 +1,12 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.factory.MockPresenterFactory; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.PresenterType; import params.IncorrectCountOfParametersParams; -import params.IncorrectParametersParams; /** * Date: 24.02.2016 diff --git a/moxy/src/test/resources/view/IncorrectParametersParamsView.java b/moxy/src/test/resources/view/IncorrectParametersParamsView.java index e741c8ef..ec9522f4 100644 --- a/moxy/src/test/resources/view/IncorrectParametersParamsView.java +++ b/moxy/src/test/resources/view/IncorrectParametersParamsView.java @@ -1,10 +1,10 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.factory.MockPresenterFactory; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.PresenterType; import params.IncorrectParametersParams; diff --git a/moxy/src/test/resources/view/InjectPresenterAnnotationInsideNotMvpViewClass.java b/moxy/src/test/resources/view/InjectPresenterAnnotationInsideNotMvpViewClass.java index 206e71d7..a0830946 100644 --- a/moxy/src/test/resources/view/InjectPresenterAnnotationInsideNotMvpViewClass.java +++ b/moxy/src/test/resources/view/InjectPresenterAnnotationInsideNotMvpViewClass.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.presenter.InjectPresenter; /** * Date: 25.02.2016 diff --git a/moxy/src/test/resources/view/InjectPresenterTypeBehaviorView.java b/moxy/src/test/resources/view/InjectPresenterTypeBehaviorView.java index d477c88a..21947e00 100644 --- a/moxy/src/test/resources/view/InjectPresenterTypeBehaviorView.java +++ b/moxy/src/test/resources/view/InjectPresenterTypeBehaviorView.java @@ -1,9 +1,9 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.factory.MockPresenterFactory; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; import presenter.PositiveParamsViewPresenter; diff --git a/moxy/src/test/resources/view/InjectPresenterWithGenericView.java b/moxy/src/test/resources/view/InjectPresenterWithGenericView.java index 291f0cbf..8ba73f01 100644 --- a/moxy/src/test/resources/view/InjectPresenterWithGenericView.java +++ b/moxy/src/test/resources/view/InjectPresenterWithGenericView.java @@ -1,10 +1,7 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.view.CounterTestView; -import com.arellomobile.mvp.view.TestView; -import com.arellomobile.mvp.view.TestViewChild2; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.view.CounterTestView; import presenter.WithViewGenericPresenter; diff --git a/moxy/src/test/resources/view/InjectPresenterWithGenericViewIncorrect.java b/moxy/src/test/resources/view/InjectPresenterWithGenericViewIncorrect.java index 3d4dbc70..33872e12 100644 --- a/moxy/src/test/resources/view/InjectPresenterWithGenericViewIncorrect.java +++ b/moxy/src/test/resources/view/InjectPresenterWithGenericViewIncorrect.java @@ -1,9 +1,9 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.view.CounterTestView; -import com.arellomobile.mvp.view.TestViewChild2; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.view.CounterTestView; +import com.omegar.mvp.view.TestViewChild2; import presenter.WithViewGenericPresenter; diff --git a/moxy/src/test/resources/view/InjectPresenterWithIncorrectParamsView.java b/moxy/src/test/resources/view/InjectPresenterWithIncorrectParamsView.java index 00599aec..95b663f1 100644 --- a/moxy/src/test/resources/view/InjectPresenterWithIncorrectParamsView.java +++ b/moxy/src/test/resources/view/InjectPresenterWithIncorrectParamsView.java @@ -1,10 +1,10 @@ package view; -import com.arellomobile.mvp.factory.MockPresenterFactory2; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.presenter.TestViewPresenter; -import com.arellomobile.mvp.view.TestView; +import com.omegar.mvp.factory.MockPresenterFactory2; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.TestViewPresenter; +import com.omegar.mvp.view.TestView; import params.Params1; diff --git a/moxy/src/test/resources/view/InjectPresenterWithIncorrectViewView.java b/moxy/src/test/resources/view/InjectPresenterWithIncorrectViewView.java index 37215f94..524e0293 100644 --- a/moxy/src/test/resources/view/InjectPresenterWithIncorrectViewView.java +++ b/moxy/src/test/resources/view/InjectPresenterWithIncorrectViewView.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.TestViewPresenter; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.TestViewPresenter; /** * Date: 25.02.2016 diff --git a/moxy/src/test/resources/view/InjectPresenterWithoutEmptyConstructorView.java b/moxy/src/test/resources/view/InjectPresenterWithoutEmptyConstructorView.java index ede70cde..20e23e1d 100644 --- a/moxy/src/test/resources/view/InjectPresenterWithoutEmptyConstructorView.java +++ b/moxy/src/test/resources/view/InjectPresenterWithoutEmptyConstructorView.java @@ -1,7 +1,7 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.presenter.InjectPresenter; import presenter.PresenterWithoutEmptyConstructor; diff --git a/moxy/src/test/resources/view/ObjectInjectPresenterView.java b/moxy/src/test/resources/view/ObjectInjectPresenterView.java index 3bb7158c..3a93b5e8 100644 --- a/moxy/src/test/resources/view/ObjectInjectPresenterView.java +++ b/moxy/src/test/resources/view/ObjectInjectPresenterView.java @@ -1,7 +1,7 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.presenter.InjectPresenter; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.presenter.InjectPresenter; /** * Date: 25.02.2016 diff --git a/moxy/src/test/resources/view/PositiveParamsView.java b/moxy/src/test/resources/view/PositiveParamsView.java index 3e5b2128..cf34ae7a 100644 --- a/moxy/src/test/resources/view/PositiveParamsView.java +++ b/moxy/src/test/resources/view/PositiveParamsView.java @@ -1,10 +1,9 @@ package view; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.factory.MockPresenterFactory; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; import params.Params1; import presenter.PositiveParamsViewPresenter; diff --git a/moxy/src/test/resources/view/PositiveViewStateView.java b/moxy/src/test/resources/view/PositiveViewStateView.java index 0d626b30..4dc4a73b 100644 --- a/moxy/src/test/resources/view/PositiveViewStateView.java +++ b/moxy/src/test/resources/view/PositiveViewStateView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/view/SeveralMethodParamsView.java b/moxy/src/test/resources/view/SeveralMethodParamsView.java index 17e1be2f..c4a304c9 100644 --- a/moxy/src/test/resources/view/SeveralMethodParamsView.java +++ b/moxy/src/test/resources/view/SeveralMethodParamsView.java @@ -1,10 +1,10 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.factory.MockPresenterFactory; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.InjectViewStatePresenter; -import com.arellomobile.mvp.presenter.PresenterType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.factory.MockPresenterFactory; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.InjectViewStatePresenter; +import com.omegar.mvp.presenter.PresenterType; public class SeveralMethodParamsView implements MvpView, params.SeveralMethodParams { @InjectPresenter(factory = MockPresenterFactory.class, presenterId = "Test", type = PresenterType.LOCAL) diff --git a/moxy/src/test/resources/view/SeveralParamsView.java b/moxy/src/test/resources/view/SeveralParamsView.java index 817d5e12..bcca0f67 100644 --- a/moxy/src/test/resources/view/SeveralParamsView.java +++ b/moxy/src/test/resources/view/SeveralParamsView.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.params.MockParams; -import com.arellomobile.mvp.params.MockParams2; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.params.MockParams; +import com.omegar.mvp.params.MockParams2; import params.Params1; import params.Params2; diff --git a/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyClassView.java b/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyClassView.java index bbc05d57..d1c15731 100644 --- a/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyClassView.java +++ b/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyClassView.java @@ -1,9 +1,5 @@ package view; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; - /** * Date: 26.02.2016 * Time: 12:09 diff --git a/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyTagView.java b/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyTagView.java index 80dcc407..59a6a46d 100644 --- a/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyTagView.java +++ b/moxy/src/test/resources/view/ViewStateChildWithIncorrectStrategyTagView.java @@ -1,9 +1,5 @@ package view; -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; /** * Date: 26.02.2016 @@ -11,7 +7,6 @@ * * @author Savin Mikhail */ -@GenerateViewState public interface ViewStateChildWithIncorrectStrategyTagView extends ViewStateParentView, ViewStateParentStrategyTagView { } diff --git a/moxy/src/test/resources/view/ViewStateForClassView.java b/moxy/src/test/resources/view/ViewStateForClassView.java index 906275d2..215bf6a7 100644 --- a/moxy/src/test/resources/view/ViewStateForClassView.java +++ b/moxy/src/test/resources/view/ViewStateForClassView.java @@ -1,7 +1,6 @@ package view; -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 26.02.2016 @@ -9,7 +8,6 @@ * * @author Savin Mikhail */ -@GenerateViewState public class ViewStateForClassView implements MvpView { public void showProgress() { diff --git a/moxy/src/test/resources/view/ViewStateForGenericView.java b/moxy/src/test/resources/view/ViewStateForGenericView.java index 2c27ebaa..c807851a 100644 --- a/moxy/src/test/resources/view/ViewStateForGenericView.java +++ b/moxy/src/test/resources/view/ViewStateForGenericView.java @@ -1,7 +1,6 @@ package view; -import com.arellomobile.mvp.GenerateViewState; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/view/ViewStateForNotView.java b/moxy/src/test/resources/view/ViewStateForNotView.java index c57b572d..6f6ec713 100644 --- a/moxy/src/test/resources/view/ViewStateForNotView.java +++ b/moxy/src/test/resources/view/ViewStateForNotView.java @@ -1,13 +1,10 @@ package view; -import com.arellomobile.mvp.GenerateViewState; - /** * Date: 26.02.2016 * Time: 11:08 * * @author Savin Mikhail */ -@GenerateViewState public interface ViewStateForNotView { } diff --git a/moxy/src/test/resources/view/ViewStateParent2View.java b/moxy/src/test/resources/view/ViewStateParent2View.java index 40b79b04..d7d9e8cf 100644 --- a/moxy/src/test/resources/view/ViewStateParent2View.java +++ b/moxy/src/test/resources/view/ViewStateParent2View.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.SingleStateStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/view/ViewStateParentStrategyClassView.java b/moxy/src/test/resources/view/ViewStateParentStrategyClassView.java index 888444ba..0b438e0f 100644 --- a/moxy/src/test/resources/view/ViewStateParentStrategyClassView.java +++ b/moxy/src/test/resources/view/ViewStateParentStrategyClassView.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.SingleStateStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/view/ViewStateParentStrategyTagView.java b/moxy/src/test/resources/view/ViewStateParentStrategyTagView.java index 41cca19d..76fe3c5f 100644 --- a/moxy/src/test/resources/view/ViewStateParentStrategyTagView.java +++ b/moxy/src/test/resources/view/ViewStateParentStrategyTagView.java @@ -1,8 +1,7 @@ package view; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/view/ViewStateParentView.java b/moxy/src/test/resources/view/ViewStateParentView.java index 46371fb7..1efb4a57 100644 --- a/moxy/src/test/resources/view/ViewStateParentView.java +++ b/moxy/src/test/resources/view/ViewStateParentView.java @@ -1,8 +1,8 @@ package view; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 26.02.2016 diff --git a/moxy/src/test/resources/view/WithoutGenerateViewAnnotationView.java b/moxy/src/test/resources/view/WithoutGenerateViewAnnotationView.java index dd101a8f..95add633 100644 --- a/moxy/src/test/resources/view/WithoutGenerateViewAnnotationView.java +++ b/moxy/src/test/resources/view/WithoutGenerateViewAnnotationView.java @@ -1,6 +1,6 @@ package view; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 26.02.2016 diff --git a/moxy/stub-reflector/src/main/java/com/arellomobile/mvp/MoxyReflector.java b/moxy/stub-reflector/src/main/java/com/omegar/mvp/MoxyReflector.java similarity index 96% rename from moxy/stub-reflector/src/main/java/com/arellomobile/mvp/MoxyReflector.java rename to moxy/stub-reflector/src/main/java/com/omegar/mvp/MoxyReflector.java index 835f1dc5..3e4c109e 100644 --- a/moxy/stub-reflector/src/main/java/com/arellomobile/mvp/MoxyReflector.java +++ b/moxy/stub-reflector/src/main/java/com/omegar/mvp/MoxyReflector.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp; +package com.omegar.mvp; import java.util.HashMap; import java.util.List; diff --git a/sample-custom-strategy/build.gradle b/sample-custom-strategy/build.gradle index 71a5aa53..4b3307b3 100644 --- a/sample-custom-strategy/build.gradle +++ b/sample-custom-strategy/build.gradle @@ -1,5 +1,4 @@ buildscript { - ext.kotlin_version = '1.3.10' repositories { jcenter() mavenCentral() @@ -44,10 +43,9 @@ dependencies { implementation "com.android.support:appcompat-v7:$supportVersion" implementation "com.android.support:design:$supportVersion" - def moxyVersion = '1.5.5' - implementation "com.arello-mobile:moxy:$moxyVersion" - implementation "com.arello-mobile:moxy-app-compat:$moxyVersion" - kapt "com.arello-mobile:moxy-compiler:$moxyVersion" + implementation project(':moxy') + implementation project(':moxy-android') + kapt project(':moxy-compiler') implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" } diff --git a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/AddToEndSingleTagStrategy.kt b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/AddToEndSingleTagStrategy.kt index 913ce048..8ac7092f 100644 --- a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/AddToEndSingleTagStrategy.kt +++ b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/AddToEndSingleTagStrategy.kt @@ -1,8 +1,8 @@ package com.redmadrobot.app.presentation.launch -import com.arellomobile.mvp.MvpView -import com.arellomobile.mvp.viewstate.ViewCommand -import com.arellomobile.mvp.viewstate.strategy.StateStrategy +import com.omegar.mvp.MvpView +import com.omegar.mvp.viewstate.ViewCommand +import com.omegar.mvp.viewstate.strategy.StateStrategy class AddToEndSingleTagStrategy : StateStrategy { diff --git a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchFragment.kt b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchFragment.kt index 229ff189..275bf9f2 100644 --- a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchFragment.kt +++ b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchFragment.kt @@ -11,11 +11,10 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import com.arellomobile.mvp.MvpAppCompatFragment -import com.arellomobile.mvp.presenter.InjectPresenter -import com.arellomobile.mvp.presenter.ProvidePresenter + +import com.omegar.mvp.presenter.InjectPresenter +import com.omegar.mvp.presenter.ProvidePresenter import com.redmadrobot.sample_custom_strategy.R -import kotlinx.android.synthetic.main.fragment_launch.* class LaunchFragment : MvpAppCompatFragment(), LaunchView { diff --git a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchPresenter.kt b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchPresenter.kt index edfbd241..4c050266 100644 --- a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchPresenter.kt +++ b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchPresenter.kt @@ -1,8 +1,7 @@ package com.redmadrobot.app.presentation.launch - -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter @InjectViewState class LaunchPresenter : MvpPresenter() { diff --git a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchView.kt b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchView.kt index 6bf008cb..4b41f683 100644 --- a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchView.kt +++ b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/LaunchView.kt @@ -1,9 +1,9 @@ package com.redmadrobot.app.presentation.launch -import com.arellomobile.mvp.MvpView -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy -import com.arellomobile.mvp.viewstate.strategy.OneExecutionStateStrategy -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType +import com.omegar.mvp.MvpView +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy +import com.omegar.mvp.viewstate.strategy.OneExecutionStateStrategy +import com.omegar.mvp.viewstate.strategy.StateStrategyType interface LaunchView : MvpView { @StateStrategyType(AddToEndSingleStrategy::class, tag = BURGER_TAG) diff --git a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomePresenter.kt b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomePresenter.kt index d0be65ae..08f7c076 100644 --- a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomePresenter.kt +++ b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomePresenter.kt @@ -1,7 +1,7 @@ package com.redmadrobot.app.presentation.launch -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter @InjectViewState class SomePresenter : MvpPresenter() { diff --git a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomeView.kt b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomeView.kt index 9908075a..2df341eb 100644 --- a/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomeView.kt +++ b/sample-custom-strategy/src/main/kotlin/com/redmadrobot/app/presentation/launch/SomeView.kt @@ -1,6 +1,6 @@ package com.redmadrobot.app.presentation.launch -import com.arellomobile.mvp.MvpView +import com.omegar.mvp.MvpView interface SomeView : MvpView { fun toggleCheese(enable: Boolean) diff --git a/sample-github/build.gradle b/sample-github/build.gradle index 31722875..79ee8b01 100644 --- a/sample-github/build.gradle +++ b/sample-github/build.gradle @@ -4,7 +4,7 @@ android { compileSdkVersion 28 defaultConfig { - applicationId "com.arellomobile.mvp.sample.github" + applicationId "com.omegar.mvp.sample.github" minSdkVersion 14 targetSdkVersion 28 versionCode 1 @@ -31,27 +31,27 @@ android { def support = '28.0.0' def retrofit = '2.1.0' def dagger = '2.16' -def butterKnife = "8.5.1" +def butterKnife = "8.8.1" dependencies { testImplementation "junit:junit:4.12" implementation "com.android.support:appcompat-v7:$support" implementation "com.android.support:design:$support" - implementation "com.j256.ormlite:ormlite-core:4.48" - implementation "com.j256.ormlite:ormlite-android:4.48" + implementation "com.j256.ormlite:ormlite-core:5.0" + implementation "com.j256.ormlite:ormlite-android:5.0" - implementation "com.google.code.gson:gson:2.5" + implementation "com.google.code.gson:gson:2.8.2" implementation "com.jakewharton:butterknife:$butterKnife" implementation "com.squareup.retrofit2:retrofit:$retrofit" implementation "com.squareup.retrofit2:converter-gson:$retrofit" implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit" - implementation "com.squareup.picasso:picasso:2.5.2" + implementation "com.squareup.picasso:picasso:2.71828" implementation "com.squareup:otto:1.3.8" - implementation "io.reactivex:rxjava:1.1.0" + implementation "io.reactivex:rxjava:1.1.5" implementation "io.reactivex:rxandroid:1.1.0" implementation "com.google.dagger:dagger:$dagger" @@ -65,7 +65,7 @@ dependencies { testImplementation "org.hamcrest:hamcrest-all:1.3" testImplementation "org.robolectric:robolectric:3.1-rc1" - implementation 'com.arello-mobile:moxy:1.5.5' - implementation 'com.arello-mobile:moxy-app-compat:1.5.5' - annotationProcessor 'com.arello-mobile:moxy-compiler:1.5.5' + implementation 'com.github.Omega-R.OmegaMoxy:moxy:1.5.7' + implementation 'com.github.Omega-R.OmegaMoxy:moxy-app-compat:1.5.7' + annotationProcessor 'com.github.Omega-R.OmegaMoxy:moxy-compiler:1.5.7' } \ No newline at end of file diff --git a/sample-github/src/main/AndroidManifest.xml b/sample-github/src/main/AndroidManifest.xml index 50ae06a6..14c2f17b 100644 --- a/sample-github/src/main/AndroidManifest.xml +++ b/sample-github/src/main/AndroidManifest.xml @@ -1,18 +1,18 @@ + package="com.omegar.mvp.sample.github"> @@ -20,8 +20,8 @@ - - + + \ No newline at end of file diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SignOutPresenter.java b/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SignOutPresenter.java deleted file mode 100644 index ae843c1c..00000000 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SignOutPresenter.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; - -import com.arellomobile.mvp.sample.github.mvp.common.AuthUtils; -import com.arellomobile.mvp.sample.github.mvp.views.SignOutView; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; - -/** - * Date: 18.01.2016 - * Time: 16:03 - * - * @author Yuri Shmakov - */ -@InjectViewState -public class SignOutPresenter extends MvpPresenter { - public void signOut() { - AuthUtils.setToken(""); - - getViewState().signOut(); - } -} diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/HomeView.java b/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/HomeView.java deleted file mode 100644 index 9482e2e8..00000000 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/HomeView.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.arellomobile.mvp.sample.github.mvp.views; - -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.OneExecutionStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; - -/** - * Date: 27.01.2016 - * Time: 20:00 - * - * @author Yuri Shmakov - */ -@StateStrategyType(AddToEndSingleStrategy.class) -public interface HomeView extends MvpView { - void showDetailsContainer(); - - void setSelection(int position); - - @StateStrategyType(OneExecutionStateStrategy.class) - void showDetails(int position, Repository repository); -} diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryLikeView.java b/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryLikeView.java deleted file mode 100644 index 53ad1e27..00000000 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryLikeView.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.arellomobile.mvp.sample.github.mvp.views; - -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.SingleStateStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; - -/** - * Created by senneco on 23.10.2016 - */ -public interface RepositoryLikeView extends MvpView { - @StateStrategyType(SingleStateStrategy.class) - void setState(boolean isInProgress, boolean isLiked); -} diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubApi.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubApi.java similarity index 68% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubApi.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubApi.java index ec137b92..acc1ce01 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubApi.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubApi.java @@ -1,13 +1,11 @@ -package com.arellomobile.mvp.sample.github.app; +package com.omegar.mvp.sample.github.app; import java.util.List; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.models.User; -import com.arellomobile.mvp.sample.github.mvp.models.gson.SearchResult; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.models.User; +import com.omegar.mvp.sample.github.mvp.models.gson.SearchResult; -import retrofit2.Call; -import retrofit2.Response; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Path; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubApp.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubApp.java similarity index 73% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubApp.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubApp.java index 51c92693..754a135e 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubApp.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubApp.java @@ -1,12 +1,13 @@ -package com.arellomobile.mvp.sample.github.app; +package com.omegar.mvp.sample.github.app; import android.app.Application; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; -import com.arellomobile.mvp.sample.github.di.AppComponent; -import com.arellomobile.mvp.sample.github.di.DaggerAppComponent; -import com.arellomobile.mvp.sample.github.di.modules.ContextModule; +import com.omegar.mvp.sample.github.di.AppComponent; + +import com.omegar.mvp.sample.github.di.DaggerAppComponent; +import com.omegar.mvp.sample.github.di.modules.ContextModule; /** * Date: 18.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubError.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubError.java similarity index 92% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubError.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubError.java index 73f1fa0e..58818f8b 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/app/GithubError.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/app/GithubError.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.app; +package com.omegar.mvp.sample.github.app; import java.io.IOException; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/common/Utils.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/common/Utils.java similarity index 88% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/common/Utils.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/common/Utils.java index 2147f4f6..d15c58b1 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/common/Utils.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/common/Utils.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.common; +package com.omegar.mvp.sample.github.common; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/AppComponent.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/AppComponent.java similarity index 51% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/AppComponent.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/di/AppComponent.java index 6f79548a..a8eae82b 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/AppComponent.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/AppComponent.java @@ -1,14 +1,14 @@ -package com.arellomobile.mvp.sample.github.di; +package com.omegar.mvp.sample.github.di; import android.content.Context; -import com.arellomobile.mvp.sample.github.di.modules.BusModule; -import com.arellomobile.mvp.sample.github.di.modules.ContextModule; -import com.arellomobile.mvp.sample.github.di.modules.GithubModule; -import com.arellomobile.mvp.sample.github.mvp.GithubService; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoriesPresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoryLikesPresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.SignInPresenter; +import com.omegar.mvp.sample.github.di.modules.BusModule; +import com.omegar.mvp.sample.github.di.modules.ContextModule; +import com.omegar.mvp.sample.github.di.modules.GithubModule; +import com.omegar.mvp.sample.github.mvp.GithubService; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoriesPresenter; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoryLikesPresenter; +import com.omegar.mvp.sample.github.mvp.presenters.SignInPresenter; import com.squareup.otto.Bus; import javax.inject.Singleton; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/ApiModule.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/ApiModule.java similarity index 76% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/ApiModule.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/ApiModule.java index 53d7a4ec..2ad07e09 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/ApiModule.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/ApiModule.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.sample.github.di.modules; +package com.omegar.mvp.sample.github.di.modules; -import com.arellomobile.mvp.sample.github.app.GithubApi; +import com.omegar.mvp.sample.github.app.GithubApi; import javax.inject.Singleton; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/BusModule.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/BusModule.java similarity index 73% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/BusModule.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/BusModule.java index 82b8c5aa..e6e14d46 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/BusModule.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/BusModule.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.sample.github.di.modules; +package com.omegar.mvp.sample.github.di.modules; -import com.arellomobile.mvp.sample.github.app.GithubApi; +import com.omegar.mvp.sample.github.app.GithubApi; import com.squareup.otto.Bus; import javax.inject.Singleton; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/ContextModule.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/ContextModule.java similarity index 87% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/ContextModule.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/ContextModule.java index 640d09f7..420aa8da 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/ContextModule.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/ContextModule.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.di.modules; +package com.omegar.mvp.sample.github.di.modules; import android.content.Context; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/GithubModule.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/GithubModule.java similarity index 66% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/GithubModule.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/GithubModule.java index c9e3b158..997a6684 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/GithubModule.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/GithubModule.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.sample.github.di.modules; +package com.omegar.mvp.sample.github.di.modules; -import com.arellomobile.mvp.sample.github.app.GithubApi; -import com.arellomobile.mvp.sample.github.mvp.GithubService; +import com.omegar.mvp.sample.github.app.GithubApi; +import com.omegar.mvp.sample.github.mvp.GithubService; import javax.inject.Singleton; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/RetrofitModule.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/RetrofitModule.java similarity index 96% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/RetrofitModule.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/RetrofitModule.java index fcc71161..b3ce9b45 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/di/modules/RetrofitModule.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/di/modules/RetrofitModule.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.di.modules; +package com.omegar.mvp.sample.github.di.modules; import java.lang.reflect.Field; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/GithubService.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/GithubService.java similarity index 68% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/GithubService.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/GithubService.java index bd59cdf0..4a0b38ea 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/GithubService.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/GithubService.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.sample.github.mvp; +package com.omegar.mvp.sample.github.mvp; import java.util.List; -import com.arellomobile.mvp.sample.github.app.GithubApi; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.models.User; +import com.omegar.mvp.sample.github.app.GithubApi; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.models.User; import rx.Observable; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/common/AuthUtils.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/common/AuthUtils.java similarity index 86% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/common/AuthUtils.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/common/AuthUtils.java index abaf72e1..669a259d 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/common/AuthUtils.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/common/AuthUtils.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.mvp.common; +package com.omegar.mvp.sample.github.mvp.common; /** * Date: 18.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/common/PrefUtils.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/common/PrefUtils.java similarity index 80% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/common/PrefUtils.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/common/PrefUtils.java index f788e479..3e6f7eca 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/common/PrefUtils.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/common/PrefUtils.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.sample.github.mvp.common; +package com.omegar.mvp.sample.github.mvp.common; import android.content.Context; import android.content.SharedPreferences; -import com.arellomobile.mvp.sample.github.app.GithubApp; +import com.omegar.mvp.sample.github.app.GithubApp; /** * Date: 18.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/Repository.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/Repository.java similarity index 99% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/Repository.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/Repository.java index e75cdbd5..ee52c408 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/Repository.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/Repository.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.mvp.models; +package com.omegar.mvp.sample.github.mvp.models; import java.io.Serializable; import java.util.Date; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/User.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/User.java similarity index 97% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/User.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/User.java index 2bdca19c..f95bcc6d 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/User.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/User.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.mvp.models; +package com.omegar.mvp.sample.github.mvp.models; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/gson/SearchResult.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/gson/SearchResult.java similarity index 69% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/gson/SearchResult.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/gson/SearchResult.java index 50c013b7..61cd6e1e 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/models/gson/SearchResult.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/models/gson/SearchResult.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.sample.github.mvp.models.gson; +package com.omegar.mvp.sample.github.mvp.models.gson; import java.util.List; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.models.Repository; /** * Date: 18.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/BasePresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/BasePresenter.java similarity index 79% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/BasePresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/BasePresenter.java index 9ded50a6..0ea47723 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/BasePresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/BasePresenter.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; import android.support.annotation.NonNull; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.MvpView; import rx.Subscription; import rx.subscriptions.CompositeSubscription; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/HomePresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/HomePresenter.java similarity index 57% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/HomePresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/HomePresenter.java index a31df3a9..f2860913 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/HomePresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/HomePresenter.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.views.HomeView; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.views.HomeView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; /** * Date: 27.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoriesPresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoriesPresenter.java similarity index 84% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoriesPresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoriesPresenter.java index d45fc2ce..2740fade 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoriesPresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoriesPresenter.java @@ -1,14 +1,14 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; import java.util.List; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.sample.github.app.GithubApi; -import com.arellomobile.mvp.sample.github.app.GithubApp; -import com.arellomobile.mvp.sample.github.common.Utils; -import com.arellomobile.mvp.sample.github.mvp.GithubService; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoriesView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.sample.github.app.GithubApi; +import com.omegar.mvp.sample.github.app.GithubApp; +import com.omegar.mvp.sample.github.common.Utils; +import com.omegar.mvp.sample.github.mvp.GithubService; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.views.RepositoriesView; import javax.inject.Inject; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoryLikesPresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoryLikesPresenter.java similarity index 90% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoryLikesPresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoryLikesPresenter.java index acd3dc49..02fa7ef3 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoryLikesPresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoryLikesPresenter.java @@ -1,11 +1,11 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryLikesView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.sample.github.mvp.views.RepositoryLikesView; import rx.Observable; import rx.Subscription; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoryPresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoryPresenter.java similarity index 77% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoryPresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoryPresenter.java index e3a38891..27bed5e2 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/RepositoryPresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/RepositoryPresenter.java @@ -1,11 +1,11 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; import java.util.List; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.views.RepositoryView; /** * Date: 27.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SignInPresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SignInPresenter.java similarity index 77% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SignInPresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SignInPresenter.java index bd0b5ca4..40519a05 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SignInPresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SignInPresenter.java @@ -1,15 +1,15 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; import android.text.TextUtils; import android.util.Base64; -import com.arellomobile.mvp.InjectViewState; -import com.arellomobile.mvp.sample.github.R; -import com.arellomobile.mvp.sample.github.app.GithubApp; -import com.arellomobile.mvp.sample.github.common.Utils; -import com.arellomobile.mvp.sample.github.mvp.GithubService; -import com.arellomobile.mvp.sample.github.mvp.common.AuthUtils; -import com.arellomobile.mvp.sample.github.mvp.views.SignInView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.sample.github.R; +import com.omegar.mvp.sample.github.app.GithubApp; +import com.omegar.mvp.sample.github.common.Utils; +import com.omegar.mvp.sample.github.mvp.GithubService; +import com.omegar.mvp.sample.github.mvp.common.AuthUtils; +import com.omegar.mvp.sample.github.mvp.views.SignInView; import javax.inject.Inject; diff --git a/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SignOutPresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SignOutPresenter.java new file mode 100644 index 00000000..855fa64b --- /dev/null +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SignOutPresenter.java @@ -0,0 +1,21 @@ +package com.omegar.mvp.sample.github.mvp.presenters; + +import com.omegar.mvp.sample.github.mvp.common.AuthUtils; +import com.omegar.mvp.sample.github.mvp.views.SignOutView; +import com.omegar.mvp.InjectViewState; +import com.omegar.mvp.MvpPresenter; + +/** + * Date: 18.01.2016 + * Time: 16:03 + * + * @author Yuri Shmakov + */ +@InjectViewState +public class SignOutPresenter extends MvpPresenter { + public void signOut() { + AuthUtils.setToken(""); + + getViewState().signOut(); + } +} diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SplashPresenter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SplashPresenter.java similarity index 61% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SplashPresenter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SplashPresenter.java index 7183263d..85a89352 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/presenters/SplashPresenter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/presenters/SplashPresenter.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.sample.github.mvp.presenters; +package com.omegar.mvp.sample.github.mvp.presenters; import android.text.TextUtils; -import com.arellomobile.mvp.MvpPresenter; -import com.arellomobile.mvp.sample.github.mvp.common.AuthUtils; -import com.arellomobile.mvp.sample.github.mvp.views.SplashView; +import com.omegar.mvp.MvpPresenter; +import com.omegar.mvp.sample.github.mvp.common.AuthUtils; +import com.omegar.mvp.sample.github.mvp.views.SplashView; /** * This presenter's View doesn't want ViewState. diff --git a/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/HomeView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/HomeView.java new file mode 100644 index 00000000..39bb5a52 --- /dev/null +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/HomeView.java @@ -0,0 +1,23 @@ +package com.omegar.mvp.sample.github.mvp.views; + +import com.omegar.mvp.MvpView; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.OneExecutionStateStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +/** + * Date: 27.01.2016 + * Time: 20:00 + * + * @author Yuri Shmakov + */ +@StateStrategyType(AddToEndSingleStrategy.class) +public interface HomeView extends MvpView { + void showDetailsContainer(); + + void setSelection(int position); + + @StateStrategyType(OneExecutionStateStrategy.class) + void showDetails(int position, Repository repository); +} diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoriesView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoriesView.java similarity index 62% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoriesView.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoriesView.java index 34f2c3e0..ee63d52c 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoriesView.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoriesView.java @@ -1,12 +1,12 @@ -package com.arellomobile.mvp.sample.github.mvp.views; +package com.omegar.mvp.sample.github.mvp.views; import java.util.List; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.AddToEndStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.AddToEndStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 22.01.2016 diff --git a/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryLikeView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryLikeView.java new file mode 100644 index 00000000..72d0159c --- /dev/null +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryLikeView.java @@ -0,0 +1,13 @@ +package com.omegar.mvp.sample.github.mvp.views; + +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.SingleStateStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; + +/** + * Created by senneco on 23.10.2016 + */ +public interface RepositoryLikeView extends MvpView { + @StateStrategyType(SingleStateStrategy.class) + void setState(boolean isInProgress, boolean isLiked); +} diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryLikesView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryLikesView.java similarity index 54% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryLikesView.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryLikesView.java index f3f00d4e..ba389948 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryLikesView.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryLikesView.java @@ -1,10 +1,10 @@ -package com.arellomobile.mvp.sample.github.mvp.views; +package com.omegar.mvp.sample.github.mvp.views; import java.util.List; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 26.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryView.java similarity index 59% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryView.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryView.java index 03831e80..799f0f8b 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/RepositoryView.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/RepositoryView.java @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.sample.github.mvp.views; +package com.omegar.mvp.sample.github.mvp.views; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.MvpView; /** * Date: 27.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SignInView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SignInView.java similarity index 59% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SignInView.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SignInView.java index 36c6f622..41549b66 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SignInView.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SignInView.java @@ -1,9 +1,9 @@ -package com.arellomobile.mvp.sample.github.mvp.views; +package com.omegar.mvp.sample.github.mvp.views; -import com.arellomobile.mvp.MvpView; -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy; -import com.arellomobile.mvp.viewstate.strategy.SkipStrategy; -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType; +import com.omegar.mvp.MvpView; +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy; +import com.omegar.mvp.viewstate.strategy.SkipStrategy; +import com.omegar.mvp.viewstate.strategy.StateStrategyType; /** * Date: 15.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SignOutView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SignOutView.java similarity index 60% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SignOutView.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SignOutView.java index 9cf86b3c..28f5902d 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SignOutView.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SignOutView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.sample.github.mvp.views; +package com.omegar.mvp.sample.github.mvp.views; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 18.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SplashView.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SplashView.java similarity index 64% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SplashView.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SplashView.java index 320cf976..a57e9a1f 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/mvp/views/SplashView.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/mvp/views/SplashView.java @@ -1,6 +1,6 @@ -package com.arellomobile.mvp.sample.github.mvp.views; +package com.omegar.mvp.sample.github.mvp.views; -import com.arellomobile.mvp.MvpView; +import com.omegar.mvp.MvpView; /** * Date: 18.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/HomeActivity.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/HomeActivity.java similarity index 83% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/HomeActivity.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/HomeActivity.java index e27f442c..875ed596 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/HomeActivity.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/HomeActivity.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.activities; +package com.omegar.mvp.sample.github.ui.activities; import java.util.List; @@ -15,30 +15,30 @@ import android.widget.ProgressBar; import android.widget.TextView; -import com.arellomobile.mvp.MvpAppCompatActivity; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.sample.github.R; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.presenters.HomePresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoriesPresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.SignOutPresenter; -import com.arellomobile.mvp.sample.github.mvp.views.HomeView; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoriesView; -import com.arellomobile.mvp.sample.github.mvp.views.SignOutView; -import com.arellomobile.mvp.sample.github.ui.adapters.RepositoriesAdapter; -import com.arellomobile.mvp.sample.github.ui.fragments.DetailsFragment; -import com.arellomobile.mvp.sample.github.ui.views.FrameSwipeRefreshLayout; +import com.omegar.mvp.MvpAppCompatActivity; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.sample.github.R; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.presenters.HomePresenter; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoriesPresenter; +import com.omegar.mvp.sample.github.mvp.presenters.SignOutPresenter; +import com.omegar.mvp.sample.github.mvp.views.HomeView; +import com.omegar.mvp.sample.github.mvp.views.RepositoriesView; +import com.omegar.mvp.sample.github.mvp.views.SignOutView; +import com.omegar.mvp.sample.github.ui.adapters.RepositoriesAdapter; +import com.omegar.mvp.sample.github.ui.fragments.DetailsFragment; +import com.omegar.mvp.sample.github.ui.views.FrameSwipeRefreshLayout; import butterknife.BindView; import butterknife.ButterKnife; public class HomeActivity extends MvpAppCompatActivity implements SignOutView, RepositoriesView, HomeView, RepositoriesAdapter.OnScrollToBottomListener { @InjectPresenter - SignOutPresenter mSignOutPresenter; + SignOutPresenter mSignOutPresenter; @InjectPresenter - RepositoriesPresenter mRepositoriesPresenter; + RepositoriesPresenter mRepositoriesPresenter; @InjectPresenter - HomePresenter mHomePresenter; + HomePresenter mHomePresenter; @BindView(R.id.activity_home_toolbar) Toolbar mToolbar; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/SignInActivity.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/SignInActivity.java similarity index 88% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/SignInActivity.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/SignInActivity.java index 47266ccb..0b7873a1 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/SignInActivity.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/SignInActivity.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.activities; +package com.omegar.mvp.sample.github.ui.activities; import android.app.AlertDialog; import android.content.Intent; @@ -8,11 +8,11 @@ import android.widget.Button; import android.widget.EditText; -import com.arellomobile.mvp.MvpAppCompatActivity; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.sample.github.R; -import com.arellomobile.mvp.sample.github.mvp.presenters.SignInPresenter; -import com.arellomobile.mvp.sample.github.mvp.views.SignInView; +import com.omegar.mvp.MvpAppCompatActivity; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.sample.github.R; +import com.omegar.mvp.sample.github.mvp.presenters.SignInPresenter; +import com.omegar.mvp.sample.github.mvp.views.SignInView; import butterknife.BindView; import butterknife.ButterKnife; @@ -22,7 +22,7 @@ */ public class SignInActivity extends MvpAppCompatActivity implements SignInView { @InjectPresenter - SignInPresenter mSignInPresenter; + SignInPresenter mSignInPresenter; @BindView(R.id.email) EditText mEmailView; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/SplashActivity.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/SplashActivity.java similarity index 63% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/SplashActivity.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/SplashActivity.java index 6a6f0950..ef323249 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/activities/SplashActivity.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/activities/SplashActivity.java @@ -1,17 +1,17 @@ -package com.arellomobile.mvp.sample.github.ui.activities; +package com.omegar.mvp.sample.github.ui.activities; import android.content.Intent; import android.os.Bundle; -import com.arellomobile.mvp.MvpAppCompatActivity; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.SplashPresenter; -import com.arellomobile.mvp.sample.github.mvp.views.SplashView; +import com.omegar.mvp.MvpAppCompatActivity; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.sample.github.mvp.presenters.SplashPresenter; +import com.omegar.mvp.sample.github.mvp.views.SplashView; public class SplashActivity extends MvpAppCompatActivity implements SplashView { @InjectPresenter - SplashPresenter mSplashPresenter; + SplashPresenter mSplashPresenter; @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/adapters/MvpBaseAdapter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/adapters/MvpBaseAdapter.java similarity index 87% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/adapters/MvpBaseAdapter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/adapters/MvpBaseAdapter.java index 736202cf..2f8400f5 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/adapters/MvpBaseAdapter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/adapters/MvpBaseAdapter.java @@ -1,8 +1,8 @@ -package com.arellomobile.mvp.sample.github.ui.adapters; +package com.omegar.mvp.sample.github.ui.adapters; import android.widget.BaseAdapter; -import com.arellomobile.mvp.MvpDelegate; +import com.omegar.mvp.MvpDelegate; /** * Date: 26.01.2016 diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/adapters/RepositoriesAdapter.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/adapters/RepositoriesAdapter.java similarity index 87% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/adapters/RepositoriesAdapter.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/adapters/RepositoriesAdapter.java index 2e7fc092..4813a7b4 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/adapters/RepositoriesAdapter.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/adapters/RepositoriesAdapter.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.adapters; +package com.omegar.mvp.sample.github.ui.adapters; import java.util.ArrayList; import java.util.List; @@ -10,16 +10,16 @@ import android.widget.ProgressBar; import android.widget.TextView; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.presenter.ProvidePresenter; -import com.arellomobile.mvp.sample.github.R; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoryLikesPresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoryPresenter; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryLikesView; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryView; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.sample.github.R; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoryLikesPresenter; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoryPresenter; +import com.omegar.mvp.sample.github.mvp.views.RepositoryLikesView; +import com.omegar.mvp.sample.github.mvp.views.RepositoryView; import butterknife.BindView; import butterknife.ButterKnife; @@ -140,7 +140,7 @@ public View getView(int position, View convertView, ViewGroup parent) { public class RepositoryHolder implements RepositoryView { @InjectPresenter - RepositoryPresenter mRepositoryPresenter; + RepositoryPresenter mRepositoryPresenter; private Repository mRepository; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/fragments/DetailsFragment.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/fragments/DetailsFragment.java similarity index 73% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/fragments/DetailsFragment.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/fragments/DetailsFragment.java index cace34a1..7688e12a 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/fragments/DetailsFragment.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/fragments/DetailsFragment.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.fragments; +package com.omegar.mvp.sample.github.ui.fragments; import java.util.List; @@ -9,17 +9,17 @@ import android.view.ViewGroup; import android.widget.ImageButton; -import com.arellomobile.mvp.MvpAppCompatFragment; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.PresenterType; -import com.arellomobile.mvp.presenter.ProvidePresenter; -import com.arellomobile.mvp.sample.github.R; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoryLikesPresenter; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoryPresenter; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryLikesView; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryView; -import com.arellomobile.mvp.sample.github.ui.views.RepositoryWidget; +import com.omegar.mvp.MvpAppCompatFragment; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.PresenterType; +import com.omegar.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.sample.github.R; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoryLikesPresenter; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoryPresenter; +import com.omegar.mvp.sample.github.mvp.views.RepositoryLikesView; +import com.omegar.mvp.sample.github.mvp.views.RepositoryView; +import com.omegar.mvp.sample.github.ui.views.RepositoryWidget; import butterknife.BindView; import butterknife.ButterKnife; @@ -34,14 +34,14 @@ public class DetailsFragment extends MvpAppCompatFragment implements RepositoryV public static final String ARGS_REPOSITORY = "argsRepository"; @InjectPresenter - RepositoryPresenter mRepositoryPresenter; + RepositoryPresenter mRepositoryPresenter; @InjectPresenter(type = PresenterType.WEAK, tag = RepositoryLikesPresenter.TAG) RepositoryLikesPresenter mRepositoryLikesPresenter; private Repository mRepository; @BindView(R.id.fragment_repository_details_text_view_title) - RepositoryWidget mTitleTextView; + RepositoryWidget mTitleTextView; @BindView(R.id.fragment_repository_details_image_button_like) ImageButton mLikeImageButton; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/FrameSwipeRefreshLayout.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/FrameSwipeRefreshLayout.java similarity index 93% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/FrameSwipeRefreshLayout.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/FrameSwipeRefreshLayout.java index 11b8f032..92dc4386 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/FrameSwipeRefreshLayout.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/FrameSwipeRefreshLayout.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.views; +package com.omegar.mvp.sample.github.ui.views; import android.content.Context; import android.support.v4.widget.SwipeRefreshLayout; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/LikeButton.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/LikeButton.java similarity index 95% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/LikeButton.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/LikeButton.java index 32aa538e..2c944e33 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/LikeButton.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/LikeButton.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.views; +package com.omegar.mvp.sample.github.ui.views; import android.annotation.TargetApi; import android.content.Context; diff --git a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/RepositoryWidget.java b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/RepositoryWidget.java similarity index 79% rename from sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/RepositoryWidget.java rename to sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/RepositoryWidget.java index 9840ccc1..73acade6 100644 --- a/sample-github/src/main/java/com/arellomobile/mvp/sample/github/ui/views/RepositoryWidget.java +++ b/sample-github/src/main/java/com/omegar/mvp/sample/github/ui/views/RepositoryWidget.java @@ -1,4 +1,4 @@ -package com.arellomobile.mvp.sample.github.ui.views; +package com.omegar.mvp.sample.github.ui.views; import android.content.Context; import android.os.Build; @@ -6,12 +6,12 @@ import android.util.AttributeSet; import android.widget.TextView; -import com.arellomobile.mvp.MvpDelegate; -import com.arellomobile.mvp.presenter.InjectPresenter; -import com.arellomobile.mvp.presenter.ProvidePresenter; -import com.arellomobile.mvp.sample.github.mvp.models.Repository; -import com.arellomobile.mvp.sample.github.mvp.presenters.RepositoryPresenter; -import com.arellomobile.mvp.sample.github.mvp.views.RepositoryView; +import com.omegar.mvp.MvpDelegate; +import com.omegar.mvp.presenter.InjectPresenter; +import com.omegar.mvp.presenter.ProvidePresenter; +import com.omegar.mvp.sample.github.mvp.models.Repository; +import com.omegar.mvp.sample.github.mvp.presenters.RepositoryPresenter; +import com.omegar.mvp.sample.github.mvp.views.RepositoryView; /** * Created by senneco on 23.10.2016 @@ -28,7 +28,7 @@ public class RepositoryWidget extends TextView implements RepositoryView { private Repository mRepository; @InjectPresenter - RepositoryPresenter mRepositoryPresenter; + RepositoryPresenter mRepositoryPresenter; public RepositoryWidget(Context context) { super(context); diff --git a/sample-github/src/main/res/layout/activity_home.xml b/sample-github/src/main/res/layout/activity_home.xml index 82f4fa04..83756ca1 100644 --- a/sample-github/src/main/res/layout/activity_home.xml +++ b/sample-github/src/main/res/layout/activity_home.xml @@ -13,7 +13,7 @@ android:background="@color/colorPrimary" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> - - + + tools:context="com.omegar.mvp.sample.github.ui.activities.SignInActivity"> - + package="com.omegar.mvp.sample.kotlin"> - + diff --git a/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/DialogView.kt b/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/DialogView.kt deleted file mode 100644 index 504f18b9..00000000 --- a/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/DialogView.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.arellomobile.mvp.sample.kotlin - -import com.arellomobile.mvp.MvpView -import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy -import com.arellomobile.mvp.viewstate.strategy.StateStrategyType - -/** - * Date: 03.03.2016 - * Time: 11:34 - * @author Yuri Shmakov - */ -@StateStrategyType(AddToEndSingleStrategy::class) -interface DialogView : MvpView { - fun showDialog() - fun hideDialog() -} \ No newline at end of file diff --git a/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/DialogPresenter.kt b/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/DialogPresenter.kt similarity index 67% rename from sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/DialogPresenter.kt rename to sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/DialogPresenter.kt index 7c074f89..e949608c 100644 --- a/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/DialogPresenter.kt +++ b/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/DialogPresenter.kt @@ -1,7 +1,7 @@ -package com.arellomobile.mvp.sample.kotlin +package com.omegar.mvp.sample.kotlin -import com.arellomobile.mvp.InjectViewState -import com.arellomobile.mvp.MvpPresenter +import com.omegar.mvp.InjectViewState +import com.omegar.mvp.MvpPresenter /** * Date: 03.03.2016 diff --git a/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/DialogView.kt b/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/DialogView.kt new file mode 100644 index 00000000..ee4487bf --- /dev/null +++ b/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/DialogView.kt @@ -0,0 +1,16 @@ +package com.omegar.mvp.sample.kotlin + +import com.omegar.mvp.MvpView +import com.omegar.mvp.viewstate.strategy.AddToEndSingleStrategy +import com.omegar.mvp.viewstate.strategy.StateStrategyType + +/** + * Date: 03.03.2016 + * Time: 11:34 + * @author Yuri Shmakov + */ +@StateStrategyType(AddToEndSingleStrategy::class) +interface DialogView : MvpView { + fun showDialog() + fun hideDialog() +} \ No newline at end of file diff --git a/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/MainActivity.kt b/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/MainActivity.kt similarity index 80% rename from sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/MainActivity.kt rename to sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/MainActivity.kt index 9268ba6a..bda38105 100644 --- a/sample-kotlin/src/main/kotlin/com/arellomobile/mvp/sample/kotlin/MainActivity.kt +++ b/sample-kotlin/src/main/kotlin/com/omegar/mvp/sample/kotlin/MainActivity.kt @@ -1,12 +1,13 @@ -package com.arellomobile.mvp.sample.kotlin +package com.omegar.mvp.sample.kotlin import android.os.Bundle import android.support.v7.app.AlertDialog -import com.arellomobile.mvp.MvpAppCompatActivity -import com.arellomobile.mvp.presenter.InjectPresenter -import com.arellomobile.mvp.presenter.PresenterType -import com.arellomobile.mvp.presenter.ProvidePresenter -import com.arellomobile.mvp.presenter.ProvidePresenterTag +import com.omegar.mvp.MvpAppCompatActivity +import com.omegar.mvp.presenter.InjectPresenter +import com.omegar.mvp.presenter.PresenterType +import com.omegar.mvp.presenter.ProvidePresenter +import com.omegar.mvp.presenter.ProvidePresenterTag +import com.omegar.mvp.sample.kotlin.R import kotlinx.android.synthetic.main.activity_main.* class MainActivity : MvpAppCompatActivity(), DialogView { diff --git a/sample-kotlin/src/main/res/layout/activity_main.xml b/sample-kotlin/src/main/res/layout/activity_main.xml index ad172ccc..8f89b81d 100644 --- a/sample-kotlin/src/main/res/layout/activity_main.xml +++ b/sample-kotlin/src/main/res/layout/activity_main.xml @@ -8,7 +8,7 @@ android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" - tools:context="com.arellomobile.mvp.sample.kotlin.MainActivity" + tools:context="com.omegar.mvp.sample.kotlin.com.omegar.mvp.sample.kotlin.MainActivity" >