用注解实现回调
This commit is contained in:
1
AriaAnnotations/.gitignore
vendored
Normal file
1
AriaAnnotations/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
12
AriaAnnotations/build.gradle
Normal file
12
AriaAnnotations/build.gradle
Normal file
@ -0,0 +1,12 @@
|
||||
apply plugin: 'java'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
sourceCompatibility = "1.7"
|
||||
targetCompatibility = "1.7"
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.arialyy.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Created by Aria.Lao on 2017/6/6.
|
||||
*/
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface Download {
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onPre {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskPre {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskResume {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskStart {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskStop {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskCancel {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskFail {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskComplete {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface onTaskRunning {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD)
|
||||
public @interface onNoSupportBreakPoint {
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.arialyy.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Created by Aria.Lao on 2017/6/6.
|
||||
*/
|
||||
@Retention(RetentionPolicy.CLASS) @Target(ElementType.METHOD) public @interface Test {
|
||||
}
|
Reference in New Issue
Block a user