Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
senneco committed Nov 15, 2016
2 parents 45c8e36 + 4c713b6 commit 9462e64
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 173 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -75,29 +75,29 @@ Base modules integration:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy:1.2.0'
provided 'com.arello-mobile:moxy-compiler:1.2.0'
compile 'com.arello-mobile:moxy:1.2.1'
provided 'com.arello-mobile:moxy-compiler:1.2.1'
}
```
If you want to see generated code, use `apt` instead of `provided` dependency type:
```groovy
dependencies {
...
apt 'com.arello-mobile:moxy-compiler:1.2.0'
apt 'com.arello-mobile:moxy-compiler:1.2.1'
}
```
For additional base view classes `MvpActivity` and `MvpFragment` add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-android:1.2.0'
compile 'com.arello-mobile:moxy-android:1.2.1'
}
```
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.2.0'
compile 'com.arello-mobile:moxy-app-compat:1.2.1'
compile 'com.android.support:appcompat-v7:$support_version'
}
```
Expand All @@ -106,7 +106,7 @@ If you are using kotlin, use `kapt` instead of `provided`/`apt` dependency type
```groovy
dependencies {
...
kapt 'com.arello-mobile:moxy-compiler:1.2.0'
kapt 'com.arello-mobile:moxy-compiler:1.2.1'
}
kapt {
generateStubs = true
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -21,7 +21,7 @@ allprojects {

ext {
targetVersionCode = 28
targetVersionName = "1.2.0"
targetVersionName = "1.2.1"
}

task clean(type: Delete) {
Expand Down
Expand Up @@ -45,8 +45,8 @@
* PresenterBinderClassGenerator generates PresenterBinder
* <p>
*
* @author Alexander Blinov
* @author Yuri Shmakov
* @author Alexander Blinov
*/
final class PresenterBinderClassGenerator extends ClassGenerator<VariableElement> {
public static final String PRESENTER_FIELD_ANNOTATION = InjectPresenter.class.getName();
Expand Down Expand Up @@ -203,16 +203,13 @@ private List<Field> collectFields(TypeElement presentersContainer) {
final Set<? extends ExecutableElement> keySet = elementValues.keySet();

for (ExecutableElement executableElement : keySet) {
String key = executableElement.getSimpleName().toString();

if ("type()".equals(executableElement.toString())) {
if ("type".equals(key)) {
type = elementValues.get(executableElement).getValue().toString();
}

if ("tag()".equals(executableElement.toString())) {
} else if ("tag".equals(key)) {
tag = elementValues.get(executableElement).toString();
}

if ("presenterId()".equals(executableElement.toString())) {
} else if ("presenterId".equals(key)) {
presenterId = elementValues.get(executableElement).toString();
}
}
Expand Down Expand Up @@ -254,16 +251,13 @@ private List<PresenterProvider> collectPresenterProviders(TypeElement presenters
final Set<? extends ExecutableElement> keySet = elementValues.keySet();

for (ExecutableElement executableElement : keySet) {
String key = executableElement.getSimpleName().toString();

if ("type()".equals(executableElement.toString())) {
if ("type".equals(key)) {
type = elementValues.get(executableElement).getValue().toString();
}

if ("tag()".equals(executableElement.toString())) {
} else if ("tag".equals(key)) {
tag = elementValues.get(executableElement).toString();
}

if ("presenterId()".equals(executableElement.toString())) {
} else if ("presenterId".equals(key)) {
presenterId = elementValues.get(executableElement).toString();
}
}
Expand Down Expand Up @@ -304,16 +298,13 @@ private List<TagProvider> collectTagProviders(TypeElement presentersContainer) {
final Set<? extends ExecutableElement> keySet = elementValues.keySet();

for (ExecutableElement executableElement : keySet) {
String key = executableElement.getSimpleName().toString();

if ("presenterClass()".equals(executableElement.toString())) {
if ("presenterClass".equals(key)) {
kind = (DeclaredType) elementValues.get(executableElement).getValue();
}

if ("type()".equals(executableElement.toString())) {
} else if ("type".equals(key)) {
type = elementValues.get(executableElement).getValue().toString();
}

if ("presenterId()".equals(executableElement.toString())) {
} else if ("presenterId".equals(key)) {
presenterId = elementValues.get(executableElement).toString();
}
}
Expand Down
Expand Up @@ -27,9 +27,12 @@
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
*
* @author Yuri Shmakov
*/
@SuppressWarnings("WeakerAccess")
final class Util {
Expand Down Expand Up @@ -98,10 +101,11 @@ public static String getFullClassName(TypeMirror typeMirror) {
}

public static String getFullClassName(TypeElement typeElement) {
String packageName = MvpCompiler.getElementUtils().getPackageOf(typeElement).toString();
String packageName = MvpCompiler.getElementUtils().getPackageOf(typeElement).getQualifiedName().toString();
if (packageName.length() > 0) {
packageName += ".";
}

String className = typeElement.toString().substring(packageName.length());
return packageName + className.replaceAll("\\.", "\\$");
}
Expand Down
Expand Up @@ -236,11 +236,13 @@ private List<Method> getMethods(Map<String, String> types, TypeElement typeEleme
final Map<? extends ExecutableElement, ? extends AnnotationValue> elementValues = annotationMirror.getElementValues();
final Set<? extends ExecutableElement> keySet = elementValues.keySet();

for (ExecutableElement key : keySet) {
if ("value()".equals(key.toString())) {
strategyClass = elementValues.get(key).toString();
} else if ("tag()".equals(key.toString())) {
methodTag = elementValues.get(key).toString();
for (ExecutableElement executableElement : keySet) {
String key = executableElement.getSimpleName().toString();

if ("value".equals(key)) {
strategyClass = elementValues.get(executableElement).toString();
} else if ("tag".equals(key)) {
methodTag = elementValues.get(executableElement).toString();
}
}
}
Expand Down Expand Up @@ -377,7 +379,7 @@ public String getStateStrategyType(TypeElement typeElement) {
final Set<? extends ExecutableElement> keySet = elementValues.keySet();

for (ExecutableElement key : keySet) {
if ("value()".equals(key.toString())) {
if ("value".equals(key.getSimpleName().toString())) {
return elementValues.get(key).toString();
}
}
Expand Down
5 changes: 3 additions & 2 deletions sample-github/build.gradle
Expand Up @@ -69,6 +69,7 @@ dependencies {
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "org.robolectric:robolectric:3.1-rc1"

compile 'com.arello-mobile:moxy:1.2.0'
apt 'com.arello-mobile:moxy-compiler:1.2.0'
compile 'com.arello-mobile:moxy:1.2.1'
compile 'com.arello-mobile:moxy-app-compat:1.2.1'
apt 'com.arello-mobile:moxy-compiler:1.2.1'
}

This file was deleted.

This file was deleted.

Expand Up @@ -16,9 +16,9 @@
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.common.MvpAppCompatActivity;
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;
Expand Down
Expand Up @@ -10,9 +10,9 @@
import android.widget.EditText;
import android.widget.LinearLayout;

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.common.MvpAppCompatActivity;
import com.arellomobile.mvp.sample.github.mvp.presenters.SignInPresenter;
import com.arellomobile.mvp.sample.github.mvp.views.SignInView;

Expand Down
Expand Up @@ -3,10 +3,10 @@
import android.content.Intent;
import android.os.Bundle;

import com.arellomobile.mvp.sample.github.mvp.common.MvpAppCompatActivity;
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.arellomobile.mvp.presenter.InjectPresenter;

public class SplashActivity extends MvpAppCompatActivity implements SplashView {
@InjectPresenter
Expand Down
Expand Up @@ -9,12 +9,12 @@
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.presenter.ProvidePresenterTag;
import com.arellomobile.mvp.sample.github.R;
import com.arellomobile.mvp.sample.github.mvp.common.MvpAppCompatFragment;
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;
Expand Down
6 changes: 3 additions & 3 deletions sample-kotlin/build.gradle
Expand Up @@ -40,9 +40,9 @@ android {
dependencies {
compile 'com.android.support:appcompat-v7:25.0.0'

compile 'com.arello-mobile:moxy:1.2.0'
compile 'com.arello-mobile:moxy-app-compat:1.2.0'
kapt 'com.arello-mobile:moxy-compiler:1.2.0'
compile 'com.arello-mobile:moxy:1.2.1'
compile 'com.arello-mobile:moxy-app-compat:1.2.1'
kapt 'com.arello-mobile:moxy-compiler:1.2.1'

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

0 comments on commit 9462e64

Please sign in to comment.