Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
262a4cb
initial
forceLain Mar 13, 2016
201de2e
some script for maven deployment
forceLain Mar 13, 2016
7f49b4a
build fix
Mar 14, 2016
48a12ff
override all setContents methods and bind butterKnife
Apr 28, 2016
6b883f7
Merge branch 'new-delegated-method' into 'master'
Apr 28, 2016
4f2bb7e
version updated
forceLain Apr 29, 2016
3c2d66f
Presenter: onPause() and onDestroy()
forceLain Jun 11, 2016
0d05891
update sdk and remove butterknife from dependencies
forceLain Jun 11, 2016
1073646
update reamp ver
forceLain Jun 11, 2016
66b27a0
Add changelog
Jun 11, 2016
0e11d9a
RxSubject and its example
forceLain Jun 19, 2016
693b946
update reamp ver.
forceLain Jun 19, 2016
f1b3690
Update CHANGELOG
Jun 19, 2016
4f12ef8
readme
Jun 20, 2016
423a3c4
Update README.md
Jun 20, 2016
81443f6
added double parameter for navigation
kirill-garbuzov Aug 18, 2016
53ad36d
added back compatability
kirill-garbuzov Aug 18, 2016
a270a9e
Merge branch 'feature/double-param-navigation' into 'master'
Aug 18, 2016
51c5176
update gradle
forceLain Aug 21, 2016
ba4b0db
update SDK
forceLain Aug 21, 2016
a8ed41b
increase reamp ver.
forceLain Aug 21, 2016
8f68f09
Update CHANGELOG
Aug 21, 2016
0760a67
Update CHANGELOG
Sep 5, 2016
0f6826e
1) observe state model on main thread
forceLain Sep 14, 2016
b632471
update lib version
forceLain Sep 14, 2016
189b7ac
Update CHANGELOG
Sep 14, 2016
316d8a6
Update README.md
Sep 14, 2016
ee360d2
Update README.md
Sep 14, 2016
2ba28cc
fix for #6 and #7
forceLain Sep 19, 2016
75d5f05
update ver.
forceLain Sep 19, 2016
1494ed8
Update README.md
Sep 26, 2016
85204e2
fix for old and dead fragments
forceLain Sep 29, 2016
152a781
update ver
forceLain Sep 29, 2016
21f1aa1
more checks for dead fragments
forceLain Sep 29, 2016
21016f5
update ver
forceLain Sep 29, 2016
865bc59
move delegate call in onCreate()
forceLain Sep 29, 2016
e998563
update version
forceLain Sep 29, 2016
4ce328f
move activity delegate call
forceLain Sep 29, 2016
1141539
update ver
forceLain Sep 29, 2016
2c57f08
single MvpDelegate, removed some activity and presenter callback call…
forceLain Nov 27, 2016
984e989
Merge branch 'feature/rethinging' into 'master'
Nov 27, 2016
18f750d
version 0.8
forceLain Nov 27, 2016
e6a0570
Update CHANGELOG
Nov 27, 2016
7784709
remove unnecessary 'getContext()' call
forceLain Apr 25, 2017
34444a1
move out navigation
forceLain Apr 25, 2017
00a09c2
remove 'setPresenter()' method
forceLain Apr 25, 2017
7134fc5
reamp strategy
forceLain Apr 30, 2017
9386084
change MvpAppCompatActivity connection/disconnection points
forceLain Apr 30, 2017
246c61a
change MvpFragment connection/disconnection points
forceLain Apr 30, 2017
ae6607b
navigation refactoring
forceLain Apr 30, 2017
136a567
remove unused param
forceLain Apr 30, 2017
bfb7026
release custom view presenters
forceLain Apr 30, 2017
1df0b37
new Action component
forceLain Apr 30, 2017
c56b84e
MvpDelegate id fix
forceLain Apr 30, 2017
a060e70
replace runtime exception to abstract method
forceLain Apr 30, 2017
469c8e8
few tests
forceLain Apr 30, 2017
0cbc6e9
remove rxjava dependency from the library
forceLain Apr 30, 2017
85f20c6
more activity tests
forceLain Apr 30, 2017
4a1333e
Merge branch 'feature/split-navigation' into 'master'
Apr 30, 2017
23c3283
fix plugin label
forceLain Apr 30, 2017
64672fd
ver 0.9
forceLain Apr 30, 2017
c9ab118
some javadocs and a minor fix for MvpPresenter
forceLain May 2, 2017
2d82cd2
version 0.9.1
forceLain May 2, 2017
ef25b9c
Update CHANGELOG
May 2, 2017
e6e23be
Update CHANGELOG
May 2, 2017
e813ff7
more javadocs
forceLain May 2, 2017
3424897
more tests and javadocs
forceLain May 4, 2017
b5f3da5
async event test
forceLain May 5, 2017
bb6ebf9
more tests
forceLain May 6, 2017
402abec
more tests; MvpPresenter more configurable;
forceLain May 6, 2017
5237710
more tests
forceLain May 6, 2017
b6b82e6
updated reamp strategy
forceLain May 8, 2017
44e3009
navigation result delivery improvements
forceLain May 8, 2017
f57fc10
tests refactored
forceLain May 8, 2017
0aaa4e8
custom strategy test
forceLain May 8, 2017
4a9b7d5
sample project improvements
forceLain May 9, 2017
fd2e33b
move views unregistering out of a strategy so it can be guaranteed ca…
forceLain May 9, 2017
27dd30f
Presenter now can has multiple views at the same time
forceLain May 9, 2017
90e0904
version 0.10
forceLain May 9, 2017
ec33b30
Update CHANGELOG
May 9, 2017
fe5c5ad
custom view sample
forceLain May 10, 2017
c12f565
presenter callbacks fixed; issue #17
forceLain May 10, 2017
61e7825
tuning the provider; #16
forceLain May 10, 2017
d041043
version 0.10.1
forceLain May 10, 2017
ed8efff
Update CHANGELOG
May 10, 2017
3afc4be
diagramm
forceLain May 15, 2017
b2442b8
login screen example
forceLain May 16, 2017
c2cab9a
example of a client presenter test
forceLain May 27, 2017
f407674
navigation javadocs
forceLain May 27, 2017
0213023
undeprecate "onResult" methods
forceLain May 27, 2017
b85e1c8
version 0.10.2
forceLain May 27, 2017
c07cbac
improve login example
forceLain Jul 13, 2017
3f82fbe
rename every public Mvp* class to Reamp* (excluding MvpDelegate)
forceLain Aug 7, 2017
e0a6c81
Merge branch 'feature/rename-to-reamp' into 'master'
Aug 7, 2017
69d8ccc
v 0.11.1 to match jcenter
forceLain Sep 4, 2017
eb02c79
Merge branch 'master' of https://github.com/eastbanctechru/Reamp into…
Apr 20, 2020
da250dc
update gradle version
Mar 19, 2020
4a5ebde
Don't set presenter to null, because there are a lot of crashes, when…
Mar 17, 2020
be1fd31
Use SendStateModelExecutor.java in ReampPresenter.java to minimize An…
Mar 17, 2020
9a87895
methods ReampPresenter#getView and ReampPresenter#getViews are @Depre…
Mar 17, 2020
6848e02
methods ReampPresenter#getView and ReampPresenter#getViews are @Depre…
Mar 17, 2020
9affd66
Convenient receiving result in Unit-test without Android dependencies.
Mar 17, 2020
d400d94
SendStateModelExecutor.Unconfined for unit tests
Mar 17, 2020
19a3695
presenter test - WIP
Mar 18, 2020
115e6b9
add utils
Mar 19, 2020
dc5ae3b
* remove Consumable
Mar 19, 2020
523fd0a
ReampPresenter#isNavigationAvailable
Mar 25, 2020
ed0c437
remove unused interface
Apr 20, 2020
e67f976
better naming
Apr 20, 2020
6ffa678
move TestResultProvider to test code
Mar 25, 2020
b18c138
Merge branch 'merge_from_github' into 'master'
Apr 20, 2020
bf482e6
update to API 28
Apr 20, 2020
f891aca
migrate to AndroidX
Apr 20, 2020
1369c5c
remove legacy dependency
Apr 20, 2020
d03370e
update to API 29
Apr 20, 2020
b6ac258
update robolectric
Apr 20, 2020
66dff47
fix test
Apr 20, 2020
c91db8e
Merge branch 'update_2020_04' into 'master'
Apr 21, 2020
aca104e
Merge branch 'master' into android_x
Apr 21, 2020
a32e5fa
add todo
Apr 27, 2020
aeeca52
Merge branch 'android_x' into 'master'
Apr 27, 2020
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
16 changes: 10 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
maven {
url "https://nexus.eastbanctech.ru/content/repositories/releases/"
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,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.parallel=true
android.enableJetifier=true
android.useAndroidX=true

android.enableUnitTestBinaryResources=true
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 May 27 22:05:03 KRAT 2017
#Thu Mar 19 13:28:18 NOVT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
118 changes: 60 additions & 58 deletions reamplib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ apply plugin: 'maven'
apply plugin: 'signing'

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.3'

testOptions.unitTests.includeAndroidResources = true

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -24,65 +26,65 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.3.2"
testCompile "org.robolectric:shadows-support-v4:3.3.2"
compile 'com.android.support:appcompat-v7:25.3.1'
}

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def getReleaseRepositoryUrl() {
return hasProperty("RELEASE_REPOSITORY_URL") ? RELEASE_REPOSITORY_URL : ""
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
testImplementation "org.robolectric:robolectric:4.3.1"
testImplementation 'org.mockito:mockito-core:2.25.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
}

def getSnapshotRepositoryUrl() {
return ghasProperty("SNAPSHOT_REPOSITORY_URL") ? SNAPSHOT_REPOSITORY_URL : ""
}

def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}
//def isReleaseBuild() {
// return VERSION_NAME.contains("SNAPSHOT") == false
//}
//
//def getReleaseRepositoryUrl() {
// return hasProperty("RELEASE_REPOSITORY_URL") ? RELEASE_REPOSITORY_URL : ""
//}
//
//def getSnapshotRepositoryUrl() {
// return ghasProperty("SNAPSHOT_REPOSITORY_URL") ? SNAPSHOT_REPOSITORY_URL : ""
//}
//
//def getRepositoryUsername() {
// return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
//}
//
//def getRepositoryPassword() {
// return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
//}

tasks.withType(Javadoc) {
failOnError false
}

ext {
bintrayRepo = 'Reamp'
bintrayName = 'Reamp'
bintrayOrg = 'eastbanctechru'

publishedGroupId = 'etr.android.reamp'
libraryName = 'Reamp'
artifact = 'reamp'

libraryDescription = 'Reamp'

siteUrl = 'https://github.com/eastbanctechru/Reamp'
gitUrl = 'https://github.com/eastbanctechru/Reamp.git'

libraryVersion = '1.0.2'

developerId = 'eastbanctechru'
developerName = 'EastBanc Technologies'
developerEmail = 'info@eastbanctech.ru'

licenseName = 'The MIT License'
licenseUrl = 'https://opensource.org/licenses/MIT'
allLicenses = ["MIT"]
}

//ext {
// bintrayRepo = 'Reamp'
// bintrayName = 'Reamp'
// bintrayOrg = 'eastbanctechru'
//
// publishedGroupId = 'etr.android.reamp'
// libraryName = 'Reamp'
// artifact = 'reamp'
//
// libraryDescription = 'Reamp'
//
// siteUrl = 'https://github.com/eastbanctechru/Reamp'
// gitUrl = 'https://github.com/eastbanctechru/Reamp.git'
//
// libraryVersion = '1.0.2'
//
// developerId = 'eastbanctechru'
// developerName = 'EastBanc Technologies'
// developerEmail = 'info@eastbanctech.ru'
//
// licenseName = 'The MIT License'
// licenseUrl = 'https://opensource.org/licenses/MIT'
// allLicenses = ["MIT"]
//}
//
apply from: '../jacoco.gradle'

if (project.rootProject.file('local.properties').exists()) {
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: './bintray.gradle'
}
//
//if (project.rootProject.file('local.properties').exists()) {
// apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
// apply from: './bintray.gradle'
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package etr.android.reamp.functional;

import androidx.annotation.NonNull;

public interface ConsumerNonNull<T> {
void consume(@NonNull T t);
}
21 changes: 20 additions & 1 deletion reamplib/src/main/java/etr/android/reamp/mvp/Action.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package etr.android.reamp.mvp;

import androidx.annotation.NonNull;

import java.io.Serializable;

import etr.android.reamp.functional.ConsumerNonNull;

/**
* A handy container-class which can be used to store "one-shot" data into {@link ReampStateModel}
* <br/>
Expand All @@ -16,11 +20,16 @@ public class Action<T extends Serializable> implements Serializable {
private T value;
private boolean hasAction;

public void set(T value) {
public void set(@NonNull T value) {
this.value = value;
hasAction = true;
}

/**
* @deprecated use {@link Action#consume(ConsumerNonNull)}.
*/
@Deprecated
@NonNull
public T get() {
if (!hasAction) {
throw new IllegalStateException("No action yet");
Expand All @@ -31,7 +40,17 @@ public T get() {
return result;
}

/**
* @deprecated use {@link Action#consume(ConsumerNonNull)}.
*/
@Deprecated
public boolean hasAction() {
return hasAction;
}

public void consume(@NonNull ConsumerNonNull<T> consumer) {
if (hasAction()) {
consumer.consume(get());
}
}
}
28 changes: 0 additions & 28 deletions reamplib/src/main/java/etr/android/reamp/mvp/Consumable.java

This file was deleted.

21 changes: 21 additions & 0 deletions reamplib/src/main/java/etr/android/reamp/mvp/EmptyAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package etr.android.reamp.mvp;

import androidx.annotation.NonNull;

import java.io.Serializable;

public class EmptyAction implements Serializable {

private boolean hasAction;

public void set() {
hasAction = true;
}

public void consume(@NonNull Runnable consumer) {
if (hasAction) {
hasAction = false;
consumer.run();
}
}
}
20 changes: 19 additions & 1 deletion reamplib/src/main/java/etr/android/reamp/mvp/MvpDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import android.util.Log;

import java.util.List;
import java.util.UUID;

import etr.android.reamp.navigation.ResultProvider;

/**
* A proxy class between {@link ReampView} and {@link ReampPresenter} which should be used
* while implementing a custom {@link ReampView}.
Expand All @@ -21,12 +26,16 @@ public class MvpDelegate {
private String mvpId;
private ReampPresenter presenter;
private StateChanges stateChanges;
private boolean isDestroyed = false;

public MvpDelegate(ReampView view) {
this.view = view;
}

public <P extends ReampPresenter<SM>, SM extends ReampStateModel> P getPresenter() {
if (isDestroyed) {
Log.e(TAG, "MvpDelegate#getPresenter was called after onDestroy.", new IllegalStateException());
}
return (P) presenter;
}

Expand Down Expand Up @@ -107,7 +116,8 @@ public void onSaveInstanceState(Bundle outState) {
public void onDestroy() {
ReampPresenter presenter = view.getPresenter();
presenter.removeView(view);
this.presenter = null;
isDestroyed = true;
// Don't set presenter to null, because there are a lot of crashes, when view calls getPresenter() after onDestroy.
}

/**
Expand All @@ -119,11 +129,19 @@ public void onResult(int requestCode, int resultCode, Intent data) {
}
}

@RestrictTo(RestrictTo.Scope.TESTS)
public void onResult(@NonNull ResultProvider resultProvider) {
view.getPresenter().onResult(resultProvider);
}

private void dispatchResult(int requestCode, int resultCode, Intent data) {
List<ReampView> views = PresenterManager.getInstance().getViewsOf(view.getContext());
for (ReampView reampView : views) {
ReampPresenter presenter = reampView.getPresenter();
if (presenter != null) {
presenter.onResult(new ResultProvider.Android(view.getPresenter().getNavigation(), requestCode, resultCode, data));

// Call it for backward compatibility.
presenter.onResult(requestCode, resultCode, data);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;

import etr.android.reamp.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.appcompat.app.AlertDialog;
import android.util.Log;

import etr.android.reamp.R;
Expand Down
Loading