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

Added ability to run feature modules independent from main app module #247

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9e72af0
tmp update for readMe
May 25, 2018
761a4aa
dowgrade version in readMe
May 25, 2018
5f0cb6c
Merge branch 'release/1.5.5' into develop
Jun 4, 2018
3894ece
[feature] update some dependencies
Jun 4, 2018
1a24a56
update build.gradle for use sub project deps
Jul 7, 2018
0e335e3
merge origin/develop into develop
Jul 7, 2018
3863ea4
update dagger version
Jul 30, 2018
005c4d4
Merge branch 'develop2' into develop
Jul 30, 2018
9570e7c
[feature] Ability to choose source language
AlexeyKorshun Aug 8, 2018
b1db5b0
add hasNotView
Aug 14, 2018
4562ddc
[feature] Add android X
VovaStelmashchuk Aug 27, 2018
39c8384
[feature] Allow to use generics in Presenter and View declarations (P…
Aug 27, 2018
f90b889
fix
Aug 29, 2018
34849b1
Merge origin/dev into my/dev
Aug 29, 2018
8085376
Merge orDev into dev
Aug 29, 2018
cdb607a
update LaunchFragment.kt
Aug 29, 2018
5e9660c
[feature] Allow to extends one view interface from another typed view…
senneco Oct 15, 2018
35122f9
Add multimodules test and fix bug #220
ekursakov Oct 26, 2018
c86af97
Add compiler test for RegisterMoxyReflectorPackages annotation
ekursakov Oct 27, 2018
ff74531
Fix ExtendsOfGenericView test
ekursakov Oct 30, 2018
587eb55
Fix types of parameters in methods from generic superinterfaces (fix …
ekursakov Oct 24, 2018
936fcf1
Merge pull request #230 from ekursakov/bug-203-parameterized-view
senneco Nov 11, 2018
095695a
[artifact] Some gradle config changes
senneco Nov 24, 2018
1b44c5a
[fixbug] Fix generation of MoxyReflector in library modules
senneco Nov 24, 2018
e344a0c
[artifact] Some gradle config changes
senneco Nov 24, 2018
040da05
[artifact] Prepare version 1.5.6
senneco Nov 24, 2018
c789dea
add androidX support
VovaStelmashchuk Feb 3, 2019
77497d9
Merge branch 'release/1.5.6' into develop
VovaStelmashchuk Feb 3, 2019
670aa47
Update README.md
VovaStelmashchuk Feb 3, 2019
22f2095
update gradle paths
Feb 18, 2019
3a12209
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
Feb 18, 2019
f8e7fae
Update MvpAppCompatDialogFragment.java
VovaStelmashchuk Mar 1, 2019
164c309
update
VovaStelmashchuk Mar 1, 2019
6615c1e
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 1, 2019
74020c8
update read me
VovaStelmashchuk Mar 2, 2019
b12f919
Update README.md
VovaStelmashchuk Mar 2, 2019
567f349
update licenses for maven and move common to the gradle.properties
VovaStelmashchuk Mar 2, 2019
092d1f7
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 2, 2019
b97769f
Add android arsenal bange
VovaStelmashchuk Mar 3, 2019
297294a
Update README.md
VovaStelmashchuk Mar 5, 2019
7f6802a
Update README.md
VovaStelmashchuk Mar 5, 2019
b25896d
remove presenter type and add material mvp
VovaStelmashchuk Mar 5, 2019
17ca12a
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 5, 2019
4b8f7b5
fixed pom files
VovaStelmashchuk Mar 17, 2019
a7271af
update readme
VovaStelmashchuk Mar 17, 2019
3b01fca
Added ability to run feature modules independent from main applicatio…
svcorporate Mar 3, 2019
b803983
added annotation to find exact package for moxy reflector deleaget
svcorporate Mar 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ captures/
# Moxy artifacts
VERSION
artifacts/
artifacts-maven/
artifacts-maven/

# Mac OS
*.icloud
146 changes: 84 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
# 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)
# MoxyX
We added X to the Moxy for make this library coolest.

Moxy is a library that helps to use MVP pattern when you do the Android Application. _Without problems of lifecycle and boilerplate code!_
[![Maven Central](https://img.shields.io/maven-central/v/tech.schoolhelper/moxy-x.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22tech.schoolhelper%22%20AND%20a:%22moxy-x%22)

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MoxyX-blue.svg?style=flat)](https://android-arsenal.com/details/1/7547)

[![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!

The main idea of using Moxy:
![schematic_using](https://habrastorage.org/files/a2e/b51/8b4/a2eb518b465a4df9b47e68794519270d.gif)

See what's happening here in the [wiki](https://github.com/Arello-Mobile/Moxy/wiki).

## Diff between us and root project
1. We support androidX
2. We don't support GLOBAL and WEAK presenter type
3. We have one more strategy than core project, [AddToEndSingleTagStrategy](https://github.com/jordan1997/Moxy/blob/master/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndSingleTagStrategy.java)

RoadMap
- [ ] We will change the template for android studio (and Intellij), the templates will create a view interface and activity or fragment into one file, and this file and presenter keep into one package. We will remove template for Java.

## Capabilities

Moxy has a few killer features in other ways:
Expand All @@ -17,97 +32,104 @@ Moxy has a few killer features in other ways:
## Sample

View interface
```java
public interface HelloWorldView extends MvpView {
void showMessage(int message);
}
```
Presenter
```java
@InjectViewState
public class HelloWorldPresenter extends MvpPresenter<HelloWorldView> {
public HelloWorldPresenter() {
getViewState().showMessage(R.string.hello_world);
}
```kotlin
interface MainView : MvpView {
fun printLog(msg: String)
}
```
View implementation
```java
public class HelloWorldActivity extends MvpAppCompatActivity implements HelloWorldView {

class MainActivity : MvpAppCompatActivity(), MainView {

@InjectPresenter
HelloWorldPresenter mHelloWorldPresenter;

private TextView mHelloWorldTextView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_world);

mHelloWorldTextView = ((TextView) findViewById(R.id.activity_hello_world_text_view_message));
internal lateinit var presenter: MainPresenter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}

@Override
public void showMessage(int message) {
mHelloWorldTextView.setText(message);

override fun printLog(msg: String) {
Log.e(TAG, "printLog : msg : $msg activity hash code : ${hashCode()}")
}

companion object {
const val TAG = "MoxyDebug"
}
}
```
Presenter
```kotlin
@InjectViewState
class MainPresenter : MvpPresenter<MainView>() {
override fun onFirstViewAttach() {
super.onFirstViewAttach()
Log.e(MainActivity.TAG, "presenter hash code : ${hashCode()}")
viewState.printLog("TEST")
}
}
```

[Here](https://github.com/Arello-Mobile/Moxy/tree/master/sample-github) you can see "Github" sample application.
[Here](https://github.com/jordan1997/Moxy/tree/develop/sample-github) you can see "Github" sample application.

## Wiki
For all information check [Moxy Wiki](https://github.com/Arello-Mobile/Moxy/wiki)

## Android studio templates
In order to avoid boilerplate code creating for binding activity, fragments and its presentation part, we propose to use Android Studio templates for Moxy.
## Android studio and Intellij templates
**We will change this template in future**
In order to avoid boilerplate code creating for binding activity, fragments and its presentation part, we propose to use Android Studio templates for Moxy.

Templates located in [/moxy-templates](https://github.com/Arello-Mobile/Moxy/tree/master/moxy-templates)
Templates located in [/moxy-templates](https://github.com/jordan1997/Moxy/tree/develop/moxy-templates)

## Links
**Telegram channels from original moxy community**

[Telegram channel (en)](https://telegram.me/moxy_mvp_library)<br />
[Telegram channel (ru)](https://telegram.me/moxy_ru)<br />
[References](https://github.com/Arello-Mobile/Moxy/wiki#references)<br />
[FAQ](https://github.com/Arello-Mobile/Moxy/wiki/FAQ)

## Twitter
For connection with author of this repository use twitter
[Twitter](https://twitter.com/jordan29041997)

## Integration
Base modules integration:
### Base modules integration:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy:1.5.5'
annotationProcessor 'com.arello-mobile:moxy-compiler:1.5.5'
}
implementation 'tech.schoolhelper:moxy-x:1.7.0'
```
#### Java project
```groovy
annotationProcessor 'tech.schoolhelper:moxy-x-compiler:1.7.0'
```
#### Kotlin
```groovy
apply plugin: 'kotlin-kapt'
```
```groovy
kapt 'tech.schoolhelper:moxy-x-compiler:1.7.0'
```
### Default android module integration
For additional base view classes `MvpActivity` and `MvpFragment` add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-android:1.5.5'
}
implementation 'tech.schoolhelper:moxy-x-android:1.7.0'
```
If you are planning to use AppCompat, then you can use `MvpAppCompatActivity` and `MvpAppCompatFragment`. Then add this:
### AppCompat module integration
If you use AppCompat, use `MvpAppCompatActivity` and `MvpAppCompatFragment` add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-app-compat:1.5.5'
compile 'com.android.support:appcompat-v7:$support_version'
}
implementation 'tech.schoolhelper:moxy-x-app-compat:1.7.0'
```
### Kotlin
If you are using kotlin, use `kapt` instead of `provided`/`apt` dependency type:
### AndroidX module integration
If you use AndroidX, use `MvpAppCompatActivity` and `MvpAppCompatFragment` add this:
```groovy
apply plugin: 'kotlin-kapt'

dependencies {
...
kapt 'com.arello-mobile:moxy-compiler:1.5.5'
}
implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
```
### AndroidX(Google material) module integration
If you use google material, use `MvpBottomSheetDialogFragment` add this:
```groovy
implementation 'tech.schoolhelper:moxy-x-material:1.7.0'
```

## ProGuard
Moxy is completely without reflection! No special ProGuard rules required.
MoxyX is completely without reflection! No special ProGuard rules required.

## License
```
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

Expand All @@ -20,20 +20,20 @@ allprojects {
}

ext {
targetVersionCode = 45
targetVersionName = "1.5.5"
targetVersionCode = 47
targetVersionName = "1.7.0"

deps = [
android : 'com.google.android:android:1.6_r2',
javapoet : 'com.squareup:javapoet:1.9.0',
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.11',
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-rc3',
autocommon : 'com.google.auto:auto-common:0.8',
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',
]
}
Expand Down
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

#org.gradle.java.home=<path to jdk1.8 for tests>
#org.gradle.java.home=<path to jdk1.8 for tests>
POM_LICENCE_URL=https\://opensource.org/licenses/MIT
POM_LICENCE_NAME=The MIT License (MIT)
POM_SCM_CONNECTION=scm:[email protected]:jordan1997/Moxy.git
POM_URL=https://github.com/jordan1997/Moxy
URL=https://schoolhelper.tech/
POM_DESCRIPTION=MoxyX, we added X for make this librayr coolest
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 @@
#Tue Jun 05 00:53:30 NOVT 2018
#Sat Nov 24 23:06:24 NOVT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
83 changes: 83 additions & 0 deletions makegpg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash

rm -rf moxy-material/artifacts-maven
rm -rf moxy-compiler/artifacts-maven
rm -rf moxy-app-compat/artifacts-maven
rm -rf moxy-androidx/artifacts-maven
rm -rf moxy-android/artifacts-maven
rm -rf moxy/artifacts-maven

echo "artifacts was clean"

./gradlew moxy-x:assemble
./gradlew moxy-x-android:assemble
./gradlew moxy-x-androidx:assemble
./gradlew moxy-x-app-compat:assemble
./gradlew moxy-x-compile:assemble
./gradlew moxy-x-material:assemble

echo "artifacts built"

cd moxy/artifacts-maven

gpg2 -ab moxy-x-javadoc.jar
gpg2 -ab moxy-x-sources.jar
gpg2 -ab moxy-x.jar
gpg2 -ab moxy-x.pom

echo "gpg for moxy-x built"

cd .. && cd ..

cd moxy-android/artifacts-maven

gpg2 -ab moxy-x-android-javadoc.jar
gpg2 -ab moxy-x-android-sources.jar
gpg2 -ab moxy-x-android.jar
gpg2 -ab moxy-x-android.pom

echo "gpg for moxy-x-android built"

cd .. && cd ..

cd moxy-androidx/artifacts-maven

gpg2 -ab moxy-x-androidx-javadoc.jar
gpg2 -ab moxy-x-androidx-sources.jar
gpg2 -ab moxy-x-androidx.jar
gpg2 -ab moxy-x-androidx.pom

echo "gpg for moxy-x-androidX built"

cd .. && cd ..

cd moxy-app-compat/artifacts-maven

gpg2 -ab moxy-x-app-compat-javadoc.jar
gpg2 -ab moxy-x-app-compat-sources.jar
gpg2 -ab moxy-x-app-compat.jar
gpg2 -ab moxy-x-app-compat.pom

echo "gpg for moxy-x-app-compat built"

cd .. && cd ..

cd moxy-compiler/artifacts-maven

gpg2 -ab moxy-x-compiler-javadoc.jar
gpg2 -ab moxy-x-compiler-sources.jar
gpg2 -ab moxy-x-compiler.jar
gpg2 -ab moxy-x-compiler.pom

echo "gpg for moxy-x-app-compiler built"

cd .. && cd ..

cd moxy-material/artifacts-maven

gpg2 -ab moxy-x-material-javadoc.jar
gpg2 -ab moxy-x-material-sources.jar
gpg2 -ab moxy-x-material.jar
gpg2 -ab moxy-x-material.pom

echo "gpg for moxy-x-material built"
Loading