Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
senneco committed Dec 6, 2016
2 parents bbfa096 + a57a61c commit 346a939
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 28 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,29 @@ Base modules integration:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy:1.3.2'
provided 'com.arello-mobile:moxy-compiler:1.3.2'
compile 'com.arello-mobile:moxy:1.3.3'
provided 'com.arello-mobile:moxy-compiler:1.3.3'
}
```
If you want to see generated code, use `apt` instead of `provided` dependency type:
```groovy
dependencies {
...
apt 'com.arello-mobile:moxy-compiler:1.3.2'
apt 'com.arello-mobile:moxy-compiler:1.3.3'
}
```
For additional base view classes `MvpActivity` and `MvpFragment` add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-android:1.3.2'
compile 'com.arello-mobile:moxy-android:1.3.3'
}
```
If you planing to use AppCompat, then you can use `MvpAppCompatActivity` and `MvpAppCompatFragment`. Then add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-app-compat:1.3.2'
compile 'com.arello-mobile:moxy-app-compat:1.3.3'
compile 'com.android.support:appcompat-v7:$support_version'
}
```
Expand All @@ -107,7 +107,7 @@ If you are using kotlin, use `kapt` instead of `provided`/`apt` dependency type
```groovy
dependencies {
...
kapt 'com.arello-mobile:moxy-compiler:1.3.2'
kapt 'com.arello-mobile:moxy-compiler:1.3.3'
}
kapt {
generateStubs = true
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ allprojects {
}

ext {
targetVersionCode = 31
targetVersionName = "1.3.2"
targetVersionCode = 32
targetVersionName = "1.3.3"
}

task clean(type: Delete) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
protected void onStart() {
super.onStart();
protected void onResume() {
super.onResume();

getMvpDelegate().onAttach();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
protected void onStart() {
super.onStart();
protected void onResume() {
super.onResume();

getMvpDelegate().onAttach();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected void onCreate(Bundle savedInstanceState) {
throw new RuntimeException("Stub!");
}

protected void onStart() {
protected void onResume() {
throw new RuntimeException("Stub!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public boolean generate(TypeElement typeElement, List<ClassGeneratingParams> cla
"\t\t}\n" +
"\n" +
"\t\tfor(" + mViewClassName + " view : mViews) {\n" +
"\t\t\tview." + method.name + "(" + argumentsString + ");\n" +
"\t\t\tgetCurrentState(view).add(" + commandFieldName + ");\n" +
"\t\t\tview." + method.name + "(" + argumentsString + ");\n" +
"\t\t}\n" +
"\n" +
"\t\tmViewCommands.afterApply(" + commandFieldName + ");\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ public void attachView(View view) {

mInRestoreState.add(view);

Set<ViewCommand<View>> currentState = getCurrentState(view);
if (currentState == null) {
currentState = new HashSet<>();
mViewStates.put(view, currentState);
}

restoreState(view, currentState);
restoreState(view, getCurrentState(view));

mInRestoreState.remove(view);
}
Expand All @@ -85,7 +79,13 @@ public void destroyView(View view) {
* @return commands that was applied already
*/
protected Set<ViewCommand<View>> getCurrentState(View view) {
return mViewStates.get(view);
Set<ViewCommand<View>> currentState = mViewStates.get(view);
if (currentState == null) {
currentState = new HashSet<>();
mViewStates.put(view, currentState);
}

return currentState;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions sample-github/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencies {
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "org.robolectric:robolectric:3.1-rc1"

compile 'com.arello-mobile:moxy:1.3.2'
compile 'com.arello-mobile:moxy-app-compat:1.3.2'
apt 'com.arello-mobile:moxy-compiler:1.3.2'
compile 'com.arello-mobile:moxy:1.3.3'
compile 'com.arello-mobile:moxy-app-compat:1.3.3'
apt 'com.arello-mobile:moxy-compiler:1.3.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,15 @@ public void successSignIn() {

startActivity(intent);
}

@Override
protected void onDestroy() {
if (mErrorDialog != null) {
mErrorDialog.setOnCancelListener(null);
mErrorDialog.dismiss();
}

super.onDestroy();
}
}

6 changes: 3 additions & 3 deletions sample-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ android {
dependencies {
compile 'com.android.support:appcompat-v7:25.0.0'

compile 'com.arello-mobile:moxy:1.3.2'
compile 'com.arello-mobile:moxy-app-compat:1.3.2'
kapt 'com.arello-mobile:moxy-compiler:1.3.2'
compile 'com.arello-mobile:moxy:1.3.3'
compile 'com.arello-mobile:moxy-app-compat:1.3.3'
kapt 'com.arello-mobile:moxy-compiler:1.3.3'

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

0 comments on commit 346a939

Please sign in to comment.