Merge branch 'v_2.0' of https://github.com/AriaLyy/Aria into v_2.0
This commit is contained in:
4
.idea/modules.xml
generated
4
.idea/modules.xml
generated
@ -2,8 +2,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Aria.iml" filepath="$PROJECT_DIR$/Aria.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/Aria/Aria-Aria.iml" filepath="$PROJECT_DIR$/Aria/Aria-Aria.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/Aria/Aria.iml" filepath="$PROJECT_DIR$/Aria/Aria.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/AriaPrj.iml" filepath="$PROJECT_DIR$/AriaPrj.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -28,6 +28,7 @@ import android.os.Build;
|
||||
import android.widget.PopupWindow;
|
||||
import com.arialyy.aria.core.scheduler.OnSchedulerListener;
|
||||
import com.arialyy.aria.core.task.Task;
|
||||
import com.arialyy.aria.util.CheckUtil;
|
||||
|
||||
/**
|
||||
* Created by lyy on 2016/12/1.
|
||||
@ -98,12 +99,12 @@ import com.arialyy.aria.core.task.Task;
|
||||
private Aria() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 接受Activity、Service、Application
|
||||
*/
|
||||
public static AMReceiver whit(Context context) {
|
||||
//if (context == null) throw new IllegalArgumentException("context 不能为 null");
|
||||
checkNull(context);
|
||||
CheckUtil.checkNull(context);
|
||||
if (context instanceof Activity
|
||||
|| context instanceof Service
|
||||
|| context instanceof Application) {
|
||||
@ -117,7 +118,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Fragment
|
||||
*/
|
||||
public static AMReceiver whit(Fragment fragment) {
|
||||
checkNull(fragment);
|
||||
CheckUtil.checkNull(fragment);
|
||||
return AriaManager.getInstance(
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? fragment.getContext()
|
||||
: fragment.getActivity()).get(fragment);
|
||||
@ -127,7 +128,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Fragment
|
||||
*/
|
||||
public static AMReceiver whit(android.support.v4.app.Fragment fragment) {
|
||||
checkNull(fragment);
|
||||
CheckUtil.checkNull(fragment);
|
||||
return AriaManager.getInstance(
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? fragment.getContext()
|
||||
: fragment.getActivity()).get(fragment);
|
||||
@ -137,7 +138,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Fragment、或者DialogFragment
|
||||
*/
|
||||
public static AMReceiver whit(DialogFragment dialog) {
|
||||
checkNull(dialog);
|
||||
CheckUtil.checkNull(dialog);
|
||||
return AriaManager.getInstance(
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? dialog.getContext() : dialog.getActivity())
|
||||
.get(dialog);
|
||||
@ -147,7 +148,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理popupwindow
|
||||
*/
|
||||
public static AMReceiver whit(PopupWindow popupWindow) {
|
||||
checkNull(popupWindow);
|
||||
CheckUtil.checkNull(popupWindow);
|
||||
return AriaManager.getInstance(popupWindow.getContentView().getContext()).get(popupWindow);
|
||||
}
|
||||
|
||||
@ -155,7 +156,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Dialog
|
||||
*/
|
||||
public static AMReceiver whit(Dialog dialog) {
|
||||
checkNull(dialog);
|
||||
CheckUtil.checkNull(dialog);
|
||||
return AriaManager.getInstance(dialog.getContext()).get(dialog);
|
||||
}
|
||||
|
||||
@ -177,7 +178,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Dialog的通用任务
|
||||
*/
|
||||
public static AriaManager get(Dialog dialog) {
|
||||
checkNull(dialog);
|
||||
CheckUtil.checkNull(dialog);
|
||||
return AriaManager.getInstance(dialog.getContext());
|
||||
}
|
||||
|
||||
@ -185,7 +186,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Dialog的通用任务
|
||||
*/
|
||||
public static AriaManager get(PopupWindow popupWindow) {
|
||||
checkNull(popupWindow);
|
||||
CheckUtil.checkNull(popupWindow);
|
||||
return AriaManager.getInstance(popupWindow.getContentView().getContext());
|
||||
}
|
||||
|
||||
@ -193,7 +194,7 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Fragment的通用任务
|
||||
*/
|
||||
public static AriaManager get(Fragment fragment) {
|
||||
checkNull(fragment);
|
||||
CheckUtil.checkNull(fragment);
|
||||
return AriaManager.getInstance(
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? fragment.getContext()
|
||||
: fragment.getActivity());
|
||||
@ -203,16 +204,12 @@ import com.arialyy.aria.core.task.Task;
|
||||
* 处理Fragment的通用任务
|
||||
*/
|
||||
public static AriaManager get(android.support.v4.app.Fragment fragment) {
|
||||
checkNull(fragment);
|
||||
CheckUtil.checkNull(fragment);
|
||||
return AriaManager.getInstance(
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? fragment.getContext()
|
||||
: fragment.getActivity());
|
||||
}
|
||||
|
||||
private static void checkNull(Object obj) {
|
||||
if (obj == null) throw new IllegalArgumentException("不能传入空对象");
|
||||
}
|
||||
|
||||
public static class SimpleSchedulerListener implements OnSchedulerListener {
|
||||
|
||||
@Override public void onTaskPre(Task task) {
|
||||
|
@ -217,6 +217,10 @@ import java.util.Set;
|
||||
key = clsName;
|
||||
}
|
||||
handlePopupWindowLift((PopupWindow) obj);
|
||||
} else if (obj instanceof Service) {
|
||||
key = clsName;
|
||||
} else if (obj instanceof Application) {
|
||||
key = clsName;
|
||||
}
|
||||
}
|
||||
if (obj instanceof Activity || obj instanceof Service) {
|
||||
|
@ -33,7 +33,7 @@ import java.util.Arrays;
|
||||
* functioning of the <code>RandomAccessFile</code> methods that are not
|
||||
* overridden here relies on the implementation of those methods in the
|
||||
* superclass.
|
||||
* Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )
|
||||
* Author : Avinash Lakshman ( alakshman@facebook.com) Prashant Malik ( pmalik@facebook.com )
|
||||
*/
|
||||
|
||||
public final class BufferedRandomAccessFile extends RandomAccessFile {
|
||||
|
@ -31,6 +31,10 @@ import java.util.regex.Pattern;
|
||||
public class CheckUtil {
|
||||
private static final String TAG = "CheckUtil";
|
||||
|
||||
public static void checkNull(Object obj) {
|
||||
if (obj == null) throw new IllegalArgumentException("不能传入空对象");
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查sql的expression是否合法
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@ Aria,致力于让下载傻瓜化</br>
|
||||
## 下载
|
||||
[](https://bintray.com/arialyy/maven/Aria/_latestVersion)</br>
|
||||
```java
|
||||
compile 'com.arialyy.aria:Aria:2.4.0'
|
||||
compile 'com.arialyy.aria:Aria:2.4.1'
|
||||
```
|
||||
|
||||
## 示例
|
||||
@ -134,6 +134,7 @@ Aria支持https下载,如果你希望使用自己的ca证书,那么你需要
|
||||
|
||||
***
|
||||
## 开发日志
|
||||
+ v_2.4.1 修复下载慢的问题,修复application、service 不能使用的问题
|
||||
+ v_2.4.0 支持https链接下载
|
||||
+ v_2.3.8 修复数据错乱的bug、添加fragment支持
|
||||
+ v_2.3.6 添加dialog、popupWindow支持
|
||||
|
Reference in New Issue
Block a user