Skip to content

Commit

Permalink
added sample for creator method usage
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkucherenko committed Jun 23, 2020
1 parent 7efce64 commit c25ceb5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.olku.generators.JustRxGenerator
import com.olku.generators.RetRxGenerator
import rx.Observable

@AutoProxy(flags = AutoProxy.Flags.ALL)
@AutoProxy(flags = AutoProxy.Flags.CREATOR)
abstract class KotlinAbstractMvpView {
/** Returns NULL if predicate returns False. */
@AutoProxy.Yield(Returns.NULL)
Expand Down
13 changes: 7 additions & 6 deletions sample/src/main/java/com/olku/autoproxy/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ protected void onCreate(Bundle savedInstanceState) {

@NonNull
public MvpView getProxy() {
return new Proxy_MvpView(this) {
@Override
public boolean predicate(@M @NonNull String methodName, Object... args) {
return !isFinishing();
}
};
return Proxy_MvpView.create(this, (methodName, args) -> !isFinishing());
// return new Proxy_MvpView(this) {
// @Override
// public boolean predicate(@M @NonNull String methodName, Object... args) {
// return !isFinishing();
// }
// };
}

//region View interface
Expand Down
5 changes: 3 additions & 2 deletions sample/src/main/java/com/olku/autoproxy/sample/MvpView.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.net.Uri;

import androidx.annotation.NonNull;

import com.olku.annotations.AutoProxy;
import com.olku.annotations.RetBool;
import com.olku.annotations.RetNumber;
Expand All @@ -12,11 +14,10 @@

import java.util.List;

import androidx.annotation.NonNull;
import rx.Observable;

/** MVP view interface. */
@AutoProxy
@AutoProxy(flags = AutoProxy.Flags.CREATOR)
public interface MvpView {
/** Returns NULL if predicate returns False. */
@AutoProxy.Yield(Returns.NULL)
Expand Down

0 comments on commit c25ceb5

Please sign in to comment.