Skip to content

Commit

Permalink
1、修改文档
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Oct 21, 2024
1 parent 0a2f677 commit 94d874d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</h4>

<div align="center">
<a href = "https://flyjingfish.github.io/AndroidAOP/zh/"><img src="docs/assets/webp/anim_css_image_pos.svg" width="200" height="200"/></a>
<a href = "https://flyjingfish.github.io/AndroidAOP/zh/"><img src="https://flyjingfish.github.io/AndroidAOP/assets/webp/anim_css_image_pos.svg" width="200" height="200"/></a>
</div>

<p align="center">
Expand Down Expand Up @@ -245,6 +245,27 @@ dependencies {
[点此查看如何配置](https://flyjingfish.github.io/AndroidAOP/zh/android_aop_extra/)


### 本库内置了一些功能注解可供你直接使用

| 注解名称 | 参数说明 | 功能说明 |
|--------------------------|:---------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:|
| @SingleClick | value = 快速点击的间隔,默认1000ms | 单击注解,加入此注解,可使你的方法只有单击时才可进入 |
| @DoubleClick | value = 两次点击的最大用时,默认300ms | 双击注解,加入此注解,可使你的方法双击时才可进入 |
| @IOThread | ThreadType = 线程类型 | 切换到子线程的操作,加入此注解可使你的方法内的代码切换到子线程执行 |
| @MainThread | 无参数 | 切换到主线程的操作,加入此注解可使你的方法内的代码切换到主线程执行 |
| @OnLifecycle<sup>*</sup> | value = Lifecycle.Event | 监听生命周期的操作,加入此注解可使你的方法内的代码在对应生命周期内才去执行 |
| @TryCatch | value = 你自定义加的一个flag | 加入此注解可为您的方法包裹一层 try catch 代码 |
| @Permission<sup>*</sup> | tag = 自定义标记<br>value = 权限的字符串数组 | 申请权限的操作,加入此注解可使您的代码在获取权限后才执行 |
| @Scheduled | initialDelay = 延迟开始时间<br>interval = 间隔<br>repeatCount = 重复次数<br>isOnMainThread = 是否主线程<br>id = 唯一标识 | 定时任务,加入此注解,可使你的方法每隔一段时间执行一次,调用AndroidAop.shutdownNow(id)或AndroidAop.shutdown(id)可停止 |
| @Delay | delay = 延迟时间<br>isOnMainThread = 是否主线程<br>id = 唯一标识 | 延迟任务,加入此注解,可使你的方法延迟一段时间执行,调用AndroidAop.shutdownNow(id)或AndroidAop.shutdown(id)可取消 |
| @CheckNetwork | tag = 自定义标记<br>toastText = 无网络时toast提示<br>invokeListener = 是否接管检查网络逻辑 | 检查网络是否可用,加入此注解可使你的方法在有网络才可进去 |
| @CustomIntercept | value = 你自定义加的一个字符串数组的flag | 自定义拦截,配合 AndroidAop.setOnCustomInterceptListener 使用,属于万金油 |


> [!TIP]\
> 以上功能位于 `android-aop-extra` 库中,[详细说明请看文档](https://flyjingfish.github.io/AndroidAOP/zh/android_aop_extra/)

## 自定义切面

**本库通过以下五种注解,实现自定义切面**
Expand Down
22 changes: 21 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</h4>

<div align="center">
<a href = "https://flyjingfish.github.io/AndroidAOP/"><img src="docs/assets/webp/anim_css_image_pos.svg" width="200" height="200"/></a>
<a href = "https://flyjingfish.github.io/AndroidAOP/"><img src="https://flyjingfish.github.io/AndroidAOP/assets/webp/anim_css_image_pos.svg" width="200" height="200"/></a>
</div>

<p align="center">
Expand Down Expand Up @@ -236,6 +236,26 @@ dependencies {

[Click here to see how to configure](https://flyjingfish.github.io/AndroidAOP/android_aop_extra/)

### This library has some built-in functional annotations for you to use directly.

| Annotation name | Parameter description | Function description |
|--------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| @SingleClick | value = interval of quick clicks, default 1000ms | Click the annotation and add this annotation to make your method accessible only when clicked |
| @DoubleClick | value = maximum time between two clicks, default 300ms | Double-click annotation, add this annotation to make your method enterable only when double-clicked |
| @IOThread | ThreadType = thread type | Switch to the sub-thread operation. Adding this annotation can switch the code in your method to the sub-thread for execution |
| @MainThread | No parameters | The operation of switching to the main thread. Adding this annotation can switch the code in your method to the main thread for execution |
| @OnLifecycle<sup>*</sup> | value = Lifecycle.Event | Monitor life cycle operations. Adding this annotation allows the code in your method to be executed only during the corresponding life cycle |
| @TryCatch | value = a flag you customized | Adding this annotation can wrap a layer of try catch code for your method |
| @Permission<sup>*</sup> | value = String array of permissions | The operation of applying for permissions. Adding this annotation will enable your code to be executed only after obtaining permissions |
| @Scheduled | initialDelay = delayed start time<br>interval = interval<br>repeatCount = number of repetitions<br>isOnMainThread = whether to be the main thread<br>id = unique identifier | Scheduled tasks, add this annotation to make your method Executed every once in a while, call AndroidAop.shutdownNow(id) or AndroidAop.shutdown(id) to stop |
| @Delay | delay = delay time<br>isOnMainThread = whether the main thread<br>id = unique identifier | Delay task, add this annotation to delay the execution of your method for a period of time, call AndroidAop.shutdownNow(id) or AndroidAop .shutdown(id) can be canceled |
| @CheckNetwork | tag = custom tag<br>toastText = toast prompt when there is no network<br>invokeListener = whether to take over the check network logic | Check whether the network is available, adding this annotation will allow your method to enter only when there is a network |
| @CustomIntercept | value = a flag of a string array that you customized | Custom interception, used with AndroidAop.setOnCustomInterceptListener, is a panacea |

> [!TIP]\
> The above functions are located in the `android-aop-extra` library. [For detailed instructions, please see the documentation](https://flyjingfish.github.io/AndroidAOP/android_aop_extra/)

## Custom Aspects

### This library uses the following five annotations to implement custom aspects
Expand Down

0 comments on commit 94d874d

Please sign in to comment.