Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/omega layout resource #269

Open
wants to merge 49 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
13ae645
Merge branch 'release/1.5.4'
Jun 4, 2018
7e1cd88
Merge branch 'release/1.5.5'
Jun 4, 2018
a9881ef
Updated kotlin fragment template for support lib >= 27
Dosssik Oct 22, 2018
83c608d
[feature] Minor improvement for templates
senneco Nov 24, 2018
040da05
[artifact] Prepare version 1.5.6
senneco Nov 24, 2018
ff56640
all packages renamed to omegar
scrinoman Mar 21, 2019
f3f65d3
Merge pull request #1 from Omega-R/release/1.5.6
scrinoman Mar 21, 2019
29e8762
Libraries versions updated
Mar 22, 2019
5cfafbe
MvpAppCompatDialogFragment has been added
Mar 22, 2019
86c88ba
dependencies have been changes
Mar 22, 2019
3f61e54
Update README.md
RomanTcv Mar 22, 2019
243955c
Merge pull request #2 from Omega-R/feature/library_dependencies
anton-knyazev Mar 22, 2019
aa02e1f
Update README.md
anton-knyazev Mar 22, 2019
e2bd0b1
arello-mobile replaced with omegar
Mar 22, 2019
a010850
Update README.md
anton-knyazev Apr 4, 2019
c4b2134
Bottom sheet dialog fragment has been added
Apr 30, 2019
37cca64
Merge branch 'master' of https://github.com/Omega-R/OmegaMoxy into fe…
Apr 30, 2019
78b2baf
Merge pull request #4 from Omega-R/feature/bottom_dialog
anton-knyazev Apr 30, 2019
8ffc4c8
MvpBottomSheetDialogFragment added
Apr 30, 2019
664f191
Merge pull request #5 from Omega-R/feature/bottom_dialog
anton-knyazev Apr 30, 2019
ab92313
Code generation updated
Oct 2, 2019
82ddea6
Merge branch 'master' of https://github.com/Omega-R/OmegaMoxy into vi…
Oct 2, 2019
fae4282
Fixed code generation for generic types
Oct 3, 2019
1605c93
Double JavaFile generation fixed
Oct 4, 2019
a23f1d9
Code generation for several view interfaces refactored
Oct 7, 2019
41c86c0
Code generation optimized
Oct 7, 2019
f897ada
Class generator updated
Oct 7, 2019
43e914b
Adding not inhered ViewMethod logic updated
Oct 8, 2019
e9bcf24
time logs added
Oct 8, 2019
3e84b36
Time logs removed
Oct 8, 2019
608d7af
Merge pull request #7 from Omega-R/viewCommand_inheritance_generation
anton-knyazev Oct 8, 2019
e1a9729
View interface inside other interface - generation bug fixed
Oct 8, 2019
9bd6cb7
Merge pull request #9 from Omega-R/viewCommand_inheritance_generation
anton-knyazev Oct 8, 2019
52d2850
Default strategy removed
Oct 8, 2019
140b153
Add For example
anton-knyazev Oct 8, 2019
1808aec
Merge pull request #11 from Omega-R/feature/remove_default_strategy
anton-knyazev Oct 8, 2019
9aeb0ae
Gradle updated; IncrementalAnnotationProcessor annotation added
Oct 9, 2019
9f891ef
Merge pull request #13 from Omega-R/feature/incremental_compilation
anton-knyazev Oct 9, 2019
d7799dc
Remove possible annotate StateStrategyType for interface
anton-knyazev Dec 11, 2019
0b6c05c
Make injectviewstate not required
anton-knyazev Mar 23, 2020
71cace7
Fix save state for child fragment
anton-knyazev Mar 23, 2020
e9a1d7d
add feature for androidx
just-d-aa Oct 14, 2020
7cdb28c
add androidx annotations path
just-d-aa Oct 14, 2020
de23332
delete moxy implementation
just-d-aa Oct 14, 2020
53af46f
add constructors to fragments
just-d-aa Oct 15, 2020
1ba5415
delete constructors from dialog fragment
just-d-aa Oct 15, 2020
c16baa3
add super param
just-d-aa Oct 15, 2020
f5eddbd
add content view annotation
just-d-aa Oct 15, 2020
f3e419e
add content view annotation
just-d-aa Oct 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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!_

Expand Down Expand Up @@ -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
Expand All @@ -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'
}
```

Expand Down
36 changes: 22 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand All @@ -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"
]
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.arellomobile.mvp;
package com.omegar.mvp;

import android.app.Activity;
import android.os.Bundle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.arellomobile.mvp;
package com.omegar.mvp;

import android.app.Application;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.arellomobile.mvp;
package com.omegar.mvp;

import android.app.DialogFragment;
import android.app.Fragment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.arellomobile.mvp;
package com.omegar.mvp;

import android.app.Fragment;
import android.os.Build;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
buildscript {
ext.kotlin_version = '1.3.10'
repositories {
google()
jcenter()
Expand All @@ -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 {
Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="example.com.moxy_androidx_sapmle">
package="example.com.moxy_androidx_sample">

<application
android:allowBackup="true"
Expand All @@ -9,7 +9,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name="example.com.moxy_androidx_sample.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -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() {

}

}
Original file line number Diff line number Diff line change
@@ -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();

}
Original file line number Diff line number Diff line change
@@ -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<Location>?) {
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<Item>) {
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"
}
}
Original file line number Diff line number Diff line change
@@ -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<Contract.MainView>() {

override fun onFirstViewAttach() {
super.onFirstViewAttach()
Log.e(MainActivity.TAG, "presenter hash code : ${hashCode()}")
viewState.printLog(10.0, "Kek")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package example.com.moxy_androidx_sample;

public class NotMainActivity extends BaseActivity implements NotMainView {

@Override
public void notMainFunction() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package example.com.moxy_androidx_sample;

public class NotMainPresenter {



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package example.com.moxy_androidx_sample;

public interface NotMainView {

void notMainFunction();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package example.com.moxy_androidx_sample

interface SecondInterface {

fun second()

}
Original file line number Diff line number Diff line change
@@ -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<Item>, SecondView, Contract.FifthView {

@StateStrategyType(AddToEndSingleStrategy::class)
fun printLog(msg: Double?, log: String?)

}

}
Original file line number Diff line number Diff line change
@@ -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<String> {

}

}
Loading