Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ android:
- tools

# The BuildTools version used by your project
- build-tools-23.0.3
- build-tools-25.0.2

# The SDK version used to compile your project
- android-24
- android-25

# Additional components
- extra-google-m2repository
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version: 3.3.0
* Update to latest android build tools, support library.

Version: 3.2.0
* Change Task#onStarted to have a parameter "monitor", so that the invoker can use the monitor to cancel the task before the task runs or when it's running

Version: 3.1.1
* Add MvcDialog and deprecate MvcDialogFragment
* Better description for injection errors for fragments and services
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-rc1'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

Expand Down Expand Up @@ -73,17 +73,17 @@ ext {
gitUrl = 'https://github.com/kejunxia/AndroidMvc.git' // Git repository URL
version = [
major: 3,
minor: 1,
patch : 1
minor: 3,
patch : 0
]
libGroup = 'com.shipdream'
libVersion = "${version.major}.${version.minor}.${version.patch}"
shouldPublish = false

androidMinSdkVersion = 14
androidCompileSdkVersion = 24
androidBuildToolVersion = "23.0.3"
supportLibVersion = "24.2.0"
androidCompileSdkVersion = 25
androidBuildToolVersion = "25.0.2"
supportLibVersion = "25.1.0"
androidTargetSdkVersion = androidCompileSdkVersion
lib = [
intelljAnnoatations: 'com.intellij:annotations:12.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public Void call() throws Exception {
uiThreadRunner.post(new Runnable() {
@Override
public void run() {
callback.onStarted();
callback.onStarted(monitor);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,16 @@ public void run() {
abstract class Callback<RESULT> {
/**
* Called when the execution of the task starts
* @deprecated
*/
public void onStarted() {}

/**
* Called when the execution of the task starts
* @param monitor The monitor to watch this task. The task can be cancelled by {@link Monitor#cancel(boolean)}
*/
public void onStarted(Monitor monitor) {}

/**
* Called when the execution of the task completes successfully
* @param result The result of the execution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ public void onStarted() {
callback.onStarted();
}

@Override
public void onStarted(Task.Monitor monitor) {
super.onStarted(monitor);
callback.onStarted(monitor);
}

@Override
public void onSuccess(Object o) {
super.onSuccess(o);
Expand All @@ -181,7 +187,7 @@ public void onFinally() {

Thread.sleep(100);

verify(callback, times(1)).onStarted();
verify(callback, times(1)).onStarted(monitor1);
verify(callback, times(1)).onException(any(Exception.class));
verify(callback, times(0)).onSuccess(anyObject());
verify(callback, times(0)).onCancelled(anyBoolean());
Expand Down Expand Up @@ -210,13 +216,13 @@ public Object execute(Monitor monitor) throws Exception {

Thread.sleep(WAIT_DURATION + 100);

verify(callback, times(1)).onStarted();
verify(callback, times(1)).onStarted(monitor1);
verify(callback, times(0)).onException(any(Exception.class));
verify(callback, times(1)).onSuccess(anyObject());
verify(callback, times(0)).onCancelled(anyBoolean());
verify(callback, times(1)).onFinally();

verify(callback2, times(0)).onStarted();
verify(callback2, times(0)).onStarted(monitor2);
verify(callback2, times(0)).onException(any(Exception.class));
verify(callback2, times(0)).onSuccess(anyObject());
verify(callback2, times(1)).onCancelled(anyBoolean());
Expand Down