适配 androidX

v3.7
laoyuyu 5 years ago
parent 43915ad204
commit ac43c9b93b
  1. 14
      AppFrame/build.gradle
  2. 5
      AppFrame/src/main/java/com/arialyy/frame/base/BaseDialog.java
  3. 2
      AppFrame/src/main/java/com/arialyy/frame/base/BaseFragment.java
  4. 2
      AppFrame/src/main/java/com/arialyy/frame/base/BaseViewModule.java
  5. 7
      AppFrame/src/main/java/com/arialyy/frame/cache/AbsCache.java
  6. 4
      AppFrame/src/main/java/com/arialyy/frame/cache/CacheUtil.java
  7. 9
      AppFrame/src/main/java/com/arialyy/frame/core/AbsActivity.java
  8. 5
      AppFrame/src/main/java/com/arialyy/frame/core/AbsAlertDialog.java
  9. 3
      AppFrame/src/main/java/com/arialyy/frame/core/AbsDialog.java
  10. 16
      AppFrame/src/main/java/com/arialyy/frame/core/AbsDialogFragment.java
  11. 16
      AppFrame/src/main/java/com/arialyy/frame/core/AbsFragment.java
  12. 2
      AppFrame/src/main/java/com/arialyy/frame/core/AbsPopupWindow.java
  13. 2
      AppFrame/src/main/java/com/arialyy/frame/core/BindingFactory.java
  14. 3
      AppFrame/src/main/java/com/arialyy/frame/core/PermissionHelp.java
  15. 7
      AppFrame/src/main/java/com/arialyy/frame/http/HttpUtil.java
  16. 2
      AppFrame/src/main/java/com/arialyy/frame/http/inf/IRequest.java
  17. 11
      AppFrame/src/main/java/com/arialyy/frame/module/AbsModule.java
  18. 4
      AppFrame/src/main/java/com/arialyy/frame/permission/PermissionManager.java
  19. 4
      AppFrame/src/main/java/com/arialyy/frame/permission/PermissionUtil.java
  20. 3
      AppFrame/src/main/java/com/arialyy/frame/temp/AbsTempView.java
  21. 4
      AppFrame/src/main/java/com/arialyy/frame/util/AESEncryption.java
  22. 4
      AppFrame/src/main/java/com/arialyy/frame/util/AndroidUtils.java
  23. 6
      AppFrame/src/main/java/com/arialyy/frame/util/FileUtil.java
  24. 2
      Aria/build.gradle
  25. 19
      Aria/src/main/java/com/arialyy/aria/core/Aria.java
  26. 6
      Aria/src/main/java/com/arialyy/aria/core/AriaManager.java
  27. 4
      Aria/src/main/java/com/arialyy/aria/core/WidgetLiftManager.java
  28. 2
      Aria/src/main/java/com/arialyy/aria/core/common/AbsThreadTask.java
  29. 2
      Aria/src/main/java/com/arialyy/aria/core/common/BaseDelegate.java
  30. 2
      Aria/src/main/java/com/arialyy/aria/core/common/ProtocolType.java
  31. 2
      Aria/src/main/java/com/arialyy/aria/core/common/ftp/FTPSDelegate.java
  32. 2
      Aria/src/main/java/com/arialyy/aria/core/common/ftp/FtpDelegate.java
  33. 4
      Aria/src/main/java/com/arialyy/aria/core/common/http/HttpDelegate.java
  34. 2
      Aria/src/main/java/com/arialyy/aria/core/config/ConfigType.java
  35. 2
      Aria/src/main/java/com/arialyy/aria/core/download/AbsGroupConfigHandler.java
  36. 4
      Aria/src/main/java/com/arialyy/aria/core/download/DownloadReceiver.java
  37. 2
      Aria/src/main/java/com/arialyy/aria/core/download/FtpDirNormalTarget.java
  38. 2
      Aria/src/main/java/com/arialyy/aria/core/download/FtpDirStartTarget.java
  39. 4
      Aria/src/main/java/com/arialyy/aria/core/download/FtpNormalTarget.java
  40. 5
      Aria/src/main/java/com/arialyy/aria/core/download/FtpStartTarget.java
  41. 2
      Aria/src/main/java/com/arialyy/aria/core/download/GroupNormalTarget.java
  42. 2
      Aria/src/main/java/com/arialyy/aria/core/download/GroupStartTarget.java
  43. 2
      Aria/src/main/java/com/arialyy/aria/core/download/HttpGroupConfigHandler.java
  44. 2
      Aria/src/main/java/com/arialyy/aria/core/download/HttpNormalTarget.java
  45. 4
      Aria/src/main/java/com/arialyy/aria/core/download/HttpStartTarget.java
  46. 2
      Aria/src/main/java/com/arialyy/aria/core/download/m3u8/ITsMergeHandler.java
  47. 2
      Aria/src/main/java/com/arialyy/aria/core/download/m3u8/M3U8Delegate.java
  48. 2
      Aria/src/main/java/com/arialyy/aria/core/download/m3u8/M3U8LiveDelegate.java
  49. 2
      Aria/src/main/java/com/arialyy/aria/core/download/m3u8/M3U8VodDelegate.java
  50. 2
      Aria/src/main/java/com/arialyy/aria/core/inf/AbsTarget.java
  51. 2
      Aria/src/main/java/com/arialyy/aria/core/inf/ReceiverType.java
  52. 2
      Aria/src/main/java/com/arialyy/aria/core/inf/TaskSchedulerType.java
  53. 2
      Aria/src/main/java/com/arialyy/aria/core/manager/TaskWrapperManager.java
  54. 2
      Aria/src/main/java/com/arialyy/aria/core/upload/FtpNormalTarget.java
  55. 4
      Aria/src/main/java/com/arialyy/aria/core/upload/FtpStartTarget.java
  56. 2
      Aria/src/main/java/com/arialyy/aria/core/upload/HttpNormalTarget.java
  57. 2
      Aria/src/main/java/com/arialyy/aria/core/upload/HttpStartTarget.java
  58. 4
      Aria/src/main/java/com/arialyy/aria/core/upload/UploadReceiver.java
  59. 2
      Aria/src/main/java/com/arialyy/aria/core/upload/uploader/FtpFISAdapter.java
  60. 9
      Aria/src/main/java/com/arialyy/aria/util/WeakHandler.java
  61. 4
      app/build.gradle
  62. 2
      app/src/main/AndroidManifest.xml
  63. 20
      app/src/main/java/com/arialyy/simple/MainActivity.java
  64. 4
      app/src/main/java/com/arialyy/simple/base/BaseActivity.java
  65. 2
      app/src/main/java/com/arialyy/simple/base/BaseDialog.java
  66. 34
      app/src/main/java/com/arialyy/simple/base/adapter/AbsHolder.java
  67. 3
      app/src/main/java/com/arialyy/simple/base/adapter/AbsRVAdapter.java
  68. 2
      app/src/main/java/com/arialyy/simple/base/adapter/RvItemClickSupport.java
  69. 4
      app/src/main/java/com/arialyy/simple/common/DialogModule.java
  70. 16
      app/src/main/java/com/arialyy/simple/common/DirChooseDialog.java
  71. 14
      app/src/main/java/com/arialyy/simple/core/download/DownloadActivity.java
  72. 6
      app/src/main/java/com/arialyy/simple/core/download/FtpDownloadActivity.java
  73. 4
      app/src/main/java/com/arialyy/simple/core/download/FtpDownloadModule.java
  74. 4
      app/src/main/java/com/arialyy/simple/core/download/HighestPriorityActivity.java
  75. 11
      app/src/main/java/com/arialyy/simple/core/download/HttpDownloadModule.java
  76. 9
      app/src/main/java/com/arialyy/simple/core/download/KotlinDownloadActivity.kt
  77. 7
      app/src/main/java/com/arialyy/simple/core/download/SingleTaskActivity.java
  78. 6
      app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8LiveDLoadActivity.java
  79. 4
      app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8LiveModule.java
  80. 8
      app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodDLoadActivity.java
  81. 4
      app/src/main/java/com/arialyy/simple/core/download/m3u8/M3U8VodModule.java
  82. 4
      app/src/main/java/com/arialyy/simple/core/download/m3u8/VideoPlayerFragment.java
  83. 6
      app/src/main/java/com/arialyy/simple/core/download/multi_download/MultiDownloadActivity.java
  84. 6
      app/src/main/java/com/arialyy/simple/core/download/multi_download/MultiTaskActivity.java
  85. 2
      app/src/main/java/com/arialyy/simple/core/download/service_download/DownloadNotification.java
  86. 2
      app/src/main/java/com/arialyy/simple/core/download/service_download/DownloadService.java
  87. 6
      app/src/main/java/com/arialyy/simple/core/upload/FtpUploadActivity.java
  88. 4
      app/src/main/java/com/arialyy/simple/core/upload/UploadModule.java
  89. 4
      app/src/main/java/com/arialyy/simple/modlue/CommonModule.java
  90. 2
      app/src/main/java/com/arialyy/simple/util/AppUtil.java
  91. 2
      app/src/main/java/com/arialyy/simple/widget/SubStateLinearLayout.java
  92. 12
      app/src/main/java/com/arialyy/simple/widget/SvgTextView.java
  93. 2
      app/src/main/res/layout/activity_download_mean.xml
  94. 2
      app/src/main/res/layout/activity_highest_priority.xml
  95. 2
      app/src/main/res/layout/activity_main.xml
  96. 3
      app/src/main/res/layout/activity_multi.xml
  97. 2
      app/src/main/res/layout/activity_multi_download.xml
  98. 2
      app/src/main/res/layout/activity_test.xml
  99. 2
      app/src/main/res/layout/dialog_choose_dir.xml
  100. 2
      app/src/main/res/layout/fragment_video_player.xml
  101. Some files were not shown because too many files have changed in this diff Show More

@ -10,7 +10,7 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
@ -25,11 +25,11 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
api "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
api 'androidx.appcompat:appcompat:1.0.2'
api 'com.google.code.gson:gson:2.8.2'
api 'io.reactivex:rxandroid:1.2.0'
api 'io.reactivex:rxjava:1.1.5'
@ -39,10 +39,10 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.1'
api "android.arch.lifecycle:runtime:${rootProject.ext.lifecycleVersion}"
api "android.arch.lifecycle:extensions:${rootProject.ext.lifecycleVersion}"
annotationProcessor "android.arch.lifecycle:compiler:${rootProject.ext.lifecycleVersion}"
api 'androidx.lifecycle:lifecycle-runtime:2.0.0'
api 'androidx.lifecycle:lifecycle-extensions:2.0.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0'
}

@ -6,13 +6,10 @@ import android.animation.AnimatorSet;
import android.animation.IntEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Dialog;
import android.databinding.ViewDataBinding;
import androidx.databinding.ViewDataBinding;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.BounceInterpolator;

@ -1,6 +1,6 @@
package com.arialyy.frame.base;
import android.databinding.ViewDataBinding;
import androidx.databinding.ViewDataBinding;
import com.arialyy.frame.core.AbsFragment;
/**

@ -1,6 +1,6 @@
package com.arialyy.frame.base;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import com.arialyy.frame.base.net.NetManager;
import com.arialyy.frame.util.StringUtil;

@ -1,18 +1,15 @@
package com.arialyy.frame.cache;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.util.LruCache;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.collection.LruCache;
import com.arialyy.frame.util.AndroidUtils;
import com.arialyy.frame.util.AppUtils;
import com.arialyy.frame.util.FileUtil;
import com.arialyy.frame.util.StreamUtil;
import com.arialyy.frame.util.StringUtil;
import com.arialyy.frame.util.show.FL;
import com.arialyy.frame.util.show.L;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;

@ -2,12 +2,10 @@ package com.arialyy.frame.cache;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.arialyy.frame.util.DrawableUtil;
import com.arialyy.frame.util.show.L;
import com.google.gson.Gson;
import java.io.UnsupportedEncodingException;
/**

@ -1,14 +1,13 @@
package com.arialyy.frame.core;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.arialyy.frame.module.AbsModule;
import com.arialyy.frame.module.IOCProxy;
import com.arialyy.frame.temp.AbsTempView;

@ -3,9 +3,8 @@ package com.arialyy.frame.core;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import com.arialyy.frame.module.AbsModule;
import com.arialyy.frame.module.IOCProxy;
import com.arialyy.frame.util.StringUtil;

@ -2,9 +2,8 @@ package com.arialyy.frame.core;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Window;
import androidx.annotation.NonNull;
import com.arialyy.frame.module.AbsModule;
import com.arialyy.frame.module.IOCProxy;
import com.arialyy.frame.util.StringUtil;

@ -2,23 +2,21 @@ package com.arialyy.frame.core;
import android.app.Activity;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.DialogFragment;
import com.arialyy.frame.module.AbsModule;
import com.arialyy.frame.module.IOCProxy;
import com.arialyy.frame.util.StringUtil;
import com.lyy.frame.R;
/**
* Created by lyy on 2015/11/4.
* DialogFragment
@ -69,7 +67,7 @@ public abstract class AbsDialogFragment<VB extends ViewDataBinding> extends Dial
}
}
public <T extends View> T findViewById(@IdRes int id){
public <T extends View> T findViewById(@IdRes int id) {
return mRootView.findViewById(id);
}

@ -2,22 +2,21 @@ package com.arialyy.frame.core;
import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentContainer;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentContainer;
import androidx.viewpager.widget.ViewPager;
import com.arialyy.frame.module.AbsModule;
import com.arialyy.frame.module.IOCProxy;
import com.arialyy.frame.temp.AbsTempView;
@ -26,7 +25,6 @@ import com.arialyy.frame.temp.TempView;
import com.arialyy.frame.util.ReflectionUtil;
import com.arialyy.frame.util.StringUtil;
import com.arialyy.frame.util.show.L;
import java.lang.reflect.Field;
/**

@ -4,11 +4,11 @@ import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupWindow;
import androidx.annotation.NonNull;
import com.arialyy.frame.module.AbsModule;
import com.arialyy.frame.module.IOCProxy;
import com.arialyy.frame.util.StringUtil;

@ -1,6 +1,6 @@
package com.arialyy.frame.core;
import android.databinding.ViewDataBinding;
import androidx.databinding.ViewDataBinding;
import java.util.HashMap;
import java.util.Map;

@ -4,8 +4,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.arialyy.frame.permission.OnPermissionCallback;
import com.arialyy.frame.permission.PermissionManager;
import com.arialyy.frame.util.AndroidVersionUtil;

@ -3,15 +3,12 @@ package com.arialyy.frame.http;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.arialyy.frame.cache.CacheUtil;
import com.arialyy.frame.http.inf.IResponse;
import com.arialyy.frame.util.show.L;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
@ -25,14 +22,12 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**

@ -1,6 +1,6 @@
package com.arialyy.frame.http.inf;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
/**
* 网络请求类

@ -1,23 +1,14 @@
package com.arialyy.frame.module;
import android.content.Context;
import android.databinding.ViewDataBinding;
import android.text.TextUtils;
import android.util.SparseIntArray;
import android.view.View;
import androidx.databinding.ViewDataBinding;
import com.arialyy.frame.core.AbsActivity;
import com.arialyy.frame.core.BindingFactory;
import com.arialyy.frame.module.inf.ModuleListener;
import com.arialyy.frame.util.ObjUtil;
import com.arialyy.frame.util.StringUtil;
import com.arialyy.frame.util.show.L;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* Created by AriaLyy on 2015/2/3.
* 抽象的module

@ -4,11 +4,9 @@ import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.app.Fragment;
import android.util.SparseArray;
import com.arialyy.frame.util.show.L;
import androidx.fragment.app.Fragment;
import java.util.Arrays;
import java.util.List;

@ -7,13 +7,11 @@ import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import androidx.fragment.app.Fragment;
import com.arialyy.frame.util.AndroidVersionUtil;
import com.arialyy.frame.util.show.L;
import com.arialyy.frame.util.show.T;
import java.util.ArrayList;
import java.util.List;

@ -1,12 +1,11 @@
package com.arialyy.frame.temp;
import android.content.Context;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import com.arialyy.frame.util.StringUtil;
import com.arialyy.frame.util.show.L;

@ -1,11 +1,9 @@
package com.arialyy.frame.util;
import android.annotation.SuppressLint;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import java.io.File;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;

@ -17,8 +17,8 @@ import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.v4.content.FileProvider;
import androidx.annotation.NonNull;
import androidx.core.content.FileProvider;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.WindowManager;

@ -6,12 +6,10 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.arialyy.frame.util.show.FL;
import com.arialyy.frame.util.show.L;
import java.io.BufferedInputStream;
@ -31,8 +29,6 @@ import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Enumeration;
import java.util.Formatter;
import java.util.Locale;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

@ -24,7 +24,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'androidx.appcompat:appcompat:1.0.0'
api project(':AriaAnnotations')
api 'com.arialyy.aria:aria-ftp-plug:1.0.4' //

@ -23,9 +23,9 @@ import android.app.Dialog;
import android.app.Service;
import android.content.Context;
import android.os.Build;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.widget.PopupWindow;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.arialyy.aria.core.download.DownloadReceiver;
import com.arialyy.aria.core.upload.UploadReceiver;
import com.arialyy.aria.util.ALog;
@ -86,8 +86,8 @@ import com.arialyy.aria.util.ALog;
* @param obj 观察者对象为本类对象使用{@code this}
*/
public static DownloadReceiver download(Object obj) {
if (AriaManager.getInstance() != null){
return AriaManager.getInstance().download(obj);
if (AriaManager.getInstance() != null) {
return AriaManager.getInstance().download(obj);
}
return get(convertContext(obj)).download(obj);
}
@ -100,7 +100,7 @@ import com.arialyy.aria.util.ALog;
* @param obj 观察者对象为本类对象使用{@code this}
*/
public static UploadReceiver upload(Object obj) {
if (AriaManager.getInstance() != null){
if (AriaManager.getInstance() != null) {
return AriaManager.getInstance().upload(obj);
}
return get(convertContext(obj)).upload(obj);
@ -111,9 +111,10 @@ import com.arialyy.aria.util.ALog;
*/
public static AriaManager get(Context context) {
if (context == null) {
throw new NullPointerException("context 无效,在非【Activity、Service、Application、DialogFragment、Fragment、PopupWindow、Dialog】,"
+ "请参考【https://aria.laoyuyu.me/aria_doc/start/any_java.html】,参数请使用 download(this) 或 upload(this);"
+ "不要使用 download(getContext()) 或 upload(getContext())");
throw new NullPointerException(
"context 无效,在非【Activity、Service、Application、DialogFragment、Fragment、PopupWindow、Dialog】,"
+ "请参考【https://aria.laoyuyu.me/aria_doc/start/any_java.html】,参数请使用 download(this) 或 upload(this);"
+ "不要使用 download(getContext()) 或 upload(getContext())");
}
return AriaManager.getInstance(context);
}
@ -139,7 +140,7 @@ import com.arialyy.aria.util.ALog;
return ((DialogFragment) obj).getContext();
} else if (obj instanceof android.app.DialogFragment) {
return ((android.app.DialogFragment) obj).getActivity();
} else if (obj instanceof android.support.v4.app.Fragment) {
} else if (obj instanceof Fragment) {
return ((Fragment) obj).getContext();
} else if (obj instanceof android.app.Fragment) {
return ((android.app.Fragment) obj).getActivity();

@ -29,9 +29,9 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.widget.PopupWindow;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.arialyy.aria.core.command.CommandManager;
import com.arialyy.aria.core.common.QueueMod;
import com.arialyy.aria.core.common.RecordHandler;
@ -385,7 +385,7 @@ import org.xml.sax.SAXException;
relateSubClass(type, obj, ((DialogFragment) obj).getActivity());
} else if (obj instanceof android.app.DialogFragment) {
relateSubClass(type, obj, ((android.app.DialogFragment) obj).getActivity());
} else if (obj instanceof android.support.v4.app.Fragment) {
} else if (obj instanceof Fragment) {
relateSubClass(type, obj, ((Fragment) obj).getActivity());
} else if (obj instanceof android.app.Fragment) {
relateSubClass(type, obj, ((android.app.Fragment) obj).getActivity());

@ -20,8 +20,8 @@ import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Message;
import android.support.v4.app.DialogFragment;
import android.widget.PopupWindow;
import androidx.fragment.app.DialogFragment;
import com.arialyy.aria.util.ALog;
import com.arialyy.aria.util.CommonUtil;
import java.lang.reflect.Field;
@ -46,7 +46,7 @@ final class WidgetLiftManager {
/**
* 处理DialogFragment事件
*
* @param dialogFragment {@link android.support.v4.app.DialogFragment}
* @param dialogFragment {@link DialogFragment}
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB) boolean handleDialogFragmentLift(
DialogFragment dialogFragment) {

@ -20,7 +20,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import com.arialyy.aria.core.AriaManager;
import com.arialyy.aria.core.config.BaseTaskConfig;
import com.arialyy.aria.core.config.DGroupConfig;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.common;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.controller.ControllerType;
import com.arialyy.aria.core.common.controller.FeatureController;
import com.arialyy.aria.core.inf.AbsTarget;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.common;
import android.support.annotation.StringDef;
import androidx.annotation.StringDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@ -15,8 +15,8 @@
*/
package com.arialyy.aria.core.common.ftp;
import android.support.annotation.CheckResult;
import android.text.TextUtils;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.FtpUrlEntity;
import com.arialyy.aria.core.common.BaseDelegate;
import com.arialyy.aria.core.common.ProtocolType;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.common.ftp;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import android.text.TextUtils;
import com.arialyy.aria.core.FtpUrlEntity;
import com.arialyy.aria.core.common.BaseDelegate;

@ -15,9 +15,9 @@
*/
package com.arialyy.aria.core.common.http;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.aria.core.common.BaseDelegate;
import com.arialyy.aria.core.common.RequestEnum;
import com.arialyy.aria.core.common.Suggest;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.config;
import android.support.annotation.IntDef;
import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import android.text.TextUtils;
import com.arialyy.aria.core.event.ErrorEvent;
import com.arialyy.aria.core.inf.AbsTarget;

@ -15,9 +15,9 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.annotations.TaskEnum;
import com.arialyy.aria.core.AriaManager;
import com.arialyy.aria.core.command.CancelAllCmd;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsNormalTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.ftp.FtpDelegate;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsStartTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.ftp.FtpDelegate;

@ -15,8 +15,8 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.aria.core.common.AbsNormalTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.ftp.FtpDelegate;

@ -15,12 +15,11 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.aria.core.common.AbsStartTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.ftp.FtpDelegate;
import com.arialyy.aria.core.inf.AbsTaskWrapper;
import com.arialyy.aria.core.inf.ITaskWrapper;
import com.arialyy.aria.util.CommonUtil;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsNormalTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.http.HttpDelegate;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsStartTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.http.HttpDelegate;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.inf.AbsTarget;
import com.arialyy.aria.orm.DbEntity;
import com.arialyy.aria.util.ALog;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsNormalTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.http.HttpDelegate;

@ -15,8 +15,8 @@
*/
package com.arialyy.aria.core.download;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.aria.core.common.AbsStartTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.http.HttpDelegate;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download.m3u8;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import java.util.List;
/**

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download.m3u8;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.BaseDelegate;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.download.DTaskWrapper;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download.m3u8;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.BaseDelegate;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.download.DTaskWrapper;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.download.m3u8;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.BaseDelegate;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.download.DTaskWrapper;

@ -15,8 +15,8 @@
*/
package com.arialyy.aria.core.inf;
import android.support.annotation.CheckResult;
import android.text.TextUtils;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.controller.NormalController;
import com.arialyy.aria.core.common.controller.StartController;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.inf;
import android.support.annotation.StringDef;
import androidx.annotation.StringDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@ -1,6 +1,6 @@
package com.arialyy.aria.core.inf;
import android.support.annotation.IntDef;
import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.manager;
import android.support.v4.util.LruCache;
import androidx.collection.LruCache;
import com.arialyy.aria.core.download.DGTaskWrapper;
import com.arialyy.aria.core.download.DTaskWrapper;
import com.arialyy.aria.core.inf.AbsTaskWrapper;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.upload;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsNormalTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.ftp.FtpDelegate;

@ -15,8 +15,8 @@
*/
package com.arialyy.aria.core.upload;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.aria.core.common.AbsStartTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.ftp.FtpDelegate;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.upload;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsNormalTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.http.HttpDelegate;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.upload;
import android.support.annotation.CheckResult;
import androidx.annotation.CheckResult;
import com.arialyy.aria.core.common.AbsStartTarget;
import com.arialyy.aria.core.common.Suggest;
import com.arialyy.aria.core.common.http.HttpDelegate;

@ -15,9 +15,9 @@
*/
package com.arialyy.aria.core.upload;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
import com.arialyy.annotations.TaskEnum;
import com.arialyy.aria.core.AriaManager;
import com.arialyy.aria.core.command.CancelAllCmd;

@ -15,7 +15,7 @@
*/
package com.arialyy.aria.core.upload.uploader;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.arialyy.aria.util.BufferedRandomAccessFile;
import java.io.IOException;
import java.io.InputStream;

@ -27,10 +27,9 @@ package com.arialyy.aria.util;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import java.lang.ref.WeakReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@ -49,7 +48,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/
@SuppressWarnings("unused") public class WeakHandler {
private final Handler.Callback mCallback;
// hard reference to Callback. We need to keep callback in memory
// hard reference to Callback. We need to keep callback in memory
private final ExecHandler mExec;
private Lock mLock = new ReentrantLock();
@SuppressWarnings("ConstantConditions") @VisibleForTesting final ChainedRef mRunnables =

@ -56,8 +56,8 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlin_version}"
api project(':Aria')

@ -53,7 +53,7 @@
<service android:name=".core.download.service_download.DownloadService"/>
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">

@ -17,18 +17,18 @@
package com.arialyy.simple;
import android.Manifest;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.frame.permission.OnPermissionCallback;
import com.arialyy.frame.permission.PermissionManager;
import com.arialyy.frame.util.show.T;
@ -36,15 +36,15 @@ import com.arialyy.simple.base.BaseActivity;
import com.arialyy.simple.base.adapter.AbsHolder;
import com.arialyy.simple.base.adapter.AbsRVAdapter;
import com.arialyy.simple.base.adapter.RvItemClickSupport;
import com.arialyy.simple.core.download.m3u8.M3U8LiveDLoadActivity;
import com.arialyy.simple.core.download.m3u8.M3U8VodDLoadActivity;
import com.arialyy.simple.databinding.ActivityMainBinding;
import com.arialyy.simple.core.download.DownloadActivity;
import com.arialyy.simple.core.download.FtpDownloadActivity;
import com.arialyy.simple.core.download.group.DownloadGroupActivity;
import com.arialyy.simple.core.download.group.FTPDirDownloadActivity;
import com.arialyy.simple.core.download.m3u8.M3U8LiveDLoadActivity;
import com.arialyy.simple.core.download.m3u8.M3U8VodDLoadActivity;
import com.arialyy.simple.core.upload.FtpUploadActivity;
import com.arialyy.simple.core.upload.HttpUploadActivity;
import com.arialyy.simple.databinding.ActivityMainBinding;
import com.arialyy.simple.modlue.CommonModule;
import com.arialyy.simple.to.NormalTo;
import java.util.ArrayList;

@ -16,10 +16,10 @@
package com.arialyy.simple.base;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import androidx.appcompat.widget.Toolbar;
import androidx.databinding.ViewDataBinding;
import com.arialyy.frame.core.AbsActivity;
import com.arialyy.frame.util.AndroidVersionUtil;
import com.arialyy.simple.R;

@ -16,7 +16,7 @@
package com.arialyy.simple.base;
import android.databinding.ViewDataBinding;
import androidx.databinding.ViewDataBinding;
import android.os.Bundle;
import com.arialyy.frame.core.AbsDialogFragment;

@ -15,33 +15,31 @@
*/
package com.arialyy.simple.base.adapter;
import android.support.annotation.IdRes;
import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.View;
import androidx.annotation.IdRes;
import androidx.recyclerview.widget.RecyclerView;
/**
* Created by lyy on 2015/12/3.
* 通用Holder
*/
public class AbsHolder extends RecyclerView.ViewHolder {
private View mView;
private SparseArray<View> mViews = new SparseArray<>();
private View mView;
private SparseArray<View> mViews = new SparseArray<>();
public AbsHolder(View itemView) {
super(itemView);
mView = itemView;
}
public AbsHolder(View itemView) {
super(itemView);
mView = itemView;
}
@SuppressWarnings("unchecked")
public <T extends View> T findViewById(@IdRes int id) {
View view = mViews.get(id);
if (view == null) {
view = mView.findViewById(id);
mViews.put(id, view);
}
return (T) view;
@SuppressWarnings("unchecked")
public <T extends View> T findViewById(@IdRes int id) {
View view = mViews.get(id);
if (view == null) {
view = mView.findViewById(id);
mViews.put(id, view);
}
return (T) view;
}
}

@ -16,11 +16,10 @@
package com.arialyy.simple.base.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;

@ -15,10 +15,10 @@
*/
package com.arialyy.simple.base.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.simple.R;
/*

@ -16,9 +16,9 @@
package com.arialyy.simple.common;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.text.TextUtils;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.aria.util.ALog;
import com.arialyy.frame.base.BaseViewModule;
import java.io.File;

@ -17,31 +17,27 @@ package com.arialyy.simple.common;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;
import com.arialyy.aria.util.ALog;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseDialog;
import com.arialyy.simple.base.adapter.AbsHolder;
import com.arialyy.simple.base.adapter.AbsRVAdapter;
import com.arialyy.simple.base.adapter.RvItemClickSupport;
import com.arialyy.simple.databinding.DialogChooseDirBinding;
import com.arialyy.simple.databinding.DialogMsgBinding;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

@ -16,24 +16,24 @@
package com.arialyy.simple.core.download;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.simple.MainActivity;
import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseActivity;
import com.arialyy.simple.base.adapter.AbsHolder;
import com.arialyy.simple.base.adapter.AbsRVAdapter;
import com.arialyy.simple.base.adapter.RvItemClickSupport;
import com.arialyy.simple.databinding.ActivityDownloadMeanBinding;
import com.arialyy.simple.core.download.multi_download.MultiTaskActivity;
import com.arialyy.simple.databinding.ActivityDownloadMeanBinding;
import com.arialyy.simple.modlue.CommonModule;
import com.arialyy.simple.to.NormalTo;
import java.util.ArrayList;

@ -15,12 +15,12 @@
*/
package com.arialyy.simple.core.download;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.common.controller.ControllerType;

@ -16,12 +16,12 @@
package com.arialyy.simple.core.download;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.text.TextUtils;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.util.ALog;

@ -16,13 +16,13 @@
package com.arialyy.simple.core.download;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;

@ -16,11 +16,11 @@
package com.arialyy.simple.core.download;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.util.ALog;
@ -47,8 +47,9 @@ public class HttpDownloadModule extends BaseViewModule {
* 单任务下载的信息
*/
LiveData<DownloadEntity> getHttpDownloadInfo(Context context) {
//String url = AppUtil.getConfigValue(context, HTTP_URL_KEY, defUrl);
String url = "http://sdkdown.muzhiwan.com/openfile/2019/05/21/com.netease.tom.mzw_5ce3ef8754d05.apk";
String url = AppUtil.getConfigValue(context, HTTP_URL_KEY, defUrl);
//String url =
// "http://sdkdown.muzhiwan.com/openfile/2019/05/21/com.netease.tom.mzw_5ce3ef8754d05.apk";
String filePath = AppUtil.getConfigValue(context, HTTP_PATH_KEY, defFilePath);
singDownloadInfo = Aria.download(context).getFirstDownloadEntity(url);
@ -59,7 +60,7 @@ public class HttpDownloadModule extends BaseViewModule {
singDownloadInfo.setFilePath(filePath);
singDownloadInfo.setFileName(file.getName());
} else {
AppUtil.setConfigValue(context, HTTP_PATH_KEY, singDownloadInfo.getDownloadPath());
AppUtil.setConfigValue(context, HTTP_PATH_KEY, singDownloadInfo.getFilePath());
AppUtil.setConfigValue(context, HTTP_URL_KEY, singDownloadInfo.getUrl());
}
liveData.postValue(singDownloadInfo);

@ -16,8 +16,6 @@
package com.arialyy.simple.core.download
import android.arch.lifecycle.Observer
import android.arch.lifecycle.ViewModelProviders
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
@ -27,6 +25,8 @@ import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.widget.Toast
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.arialyy.annotations.Download
import com.arialyy.aria.core.Aria
import com.arialyy.aria.core.download.DownloadEntity
@ -37,6 +37,7 @@ import com.arialyy.aria.util.ALog
import com.arialyy.aria.util.CommonUtil
import com.arialyy.frame.util.show.T
import com.arialyy.simple.R
import com.arialyy.simple.R.string
import com.arialyy.simple.base.BaseActivity
import com.arialyy.simple.common.ModifyPathDialog
import com.arialyy.simple.common.ModifyUrlDialog
@ -96,11 +97,11 @@ class KotlinDownloadActivity : BaseActivity<ActivitySingleKotlinBinding>() {
return@Observer
}
if (entity.state == IEntity.STATE_STOP) {
binding.stateStr = getString(R.string.resume)
binding.stateStr = getString(string.resume)
}
if (Aria.download(this).load(entity.id).isRunning) {
binding.stateStr = getString(R.string.stop)
binding.stateStr = getString(string.stop)
}
if (entity.fileSize != 0L) {

@ -16,22 +16,21 @@
package com.arialyy.simple.core.download;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.common.RequestEnum;
import com.arialyy.aria.core.common.controller.ControllerType;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.core.download.DownloadTask;

@ -16,15 +16,15 @@
package com.arialyy.simple.core.download.m3u8;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.common.controller.ControllerType;

@ -16,11 +16,11 @@
package com.arialyy.simple.core.download.m3u8;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.util.ALog;

@ -16,16 +16,16 @@
package com.arialyy.simple.core.download.m3u8;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.arialyy.annotations.Download;
import com.arialyy.annotations.M3U8;
import com.arialyy.aria.core.Aria;

@ -16,11 +16,11 @@
package com.arialyy.simple.core.download.m3u8;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.util.ALog;

@ -1,17 +1,17 @@
package com.arialyy.simple.core.download.m3u8;
import android.annotation.SuppressLint;
import android.arch.lifecycle.ViewModelProviders;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.SparseArray;
import android.view.SurfaceHolder;
import android.view.View;
import android.widget.SeekBar;
import androidx.annotation.RequiresApi;
import androidx.lifecycle.ViewModelProviders;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.core.download.m3u8.M3U8Entity;
import com.arialyy.aria.util.ALog;

@ -17,11 +17,11 @@
package com.arialyy.simple.core.download.multi_download;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.annotations.Download;
import com.arialyy.annotations.DownloadGroup;
import com.arialyy.aria.core.Aria;
@ -76,7 +76,7 @@ public class MultiDownloadActivity extends BaseActivity<ActivityMultiDownloadBin
Log.d(TAG, task.getTaskName() + ", " + task.getState());
}
@Download.onWait void onWait(DownloadTask task){
@Download.onWait void onWait(DownloadTask task) {
mAdapter.updateState(task.getEntity());
}

@ -18,11 +18,11 @@ package com.arialyy.simple.core.download.multi_download;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.arialyy.annotations.Download;
import com.arialyy.annotations.DownloadGroup;
import com.arialyy.aria.core.Aria;

@ -18,7 +18,7 @@ package com.arialyy.simple.core.download.service_download;
import android.app.NotificationManager;
import android.content.Context;
import android.support.v4.app.NotificationCompat;
import androidx.core.app.NotificationCompat;
import com.arialyy.simple.R;
/**

@ -19,7 +19,7 @@ import android.app.Service;
import android.content.Intent;
import android.os.Environment;
import android.os.IBinder;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadTask;

@ -15,14 +15,14 @@
*/
package com.arialyy.simple.core.upload;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.arialyy.annotations.Upload;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.common.controller.ControllerType;

@ -16,10 +16,10 @@
package com.arialyy.simple.core.upload;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;
import android.os.Environment;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.upload.UploadEntity;
import com.arialyy.frame.base.BaseViewModule;

@ -15,10 +15,10 @@
*/
package com.arialyy.simple.modlue;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.content.Context;
import android.content.Intent;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.arialyy.frame.base.BaseViewModule;
import com.arialyy.simple.MainActivity;
import com.arialyy.simple.R;

@ -22,7 +22,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.support.v4.content.FileProvider;
import androidx.core.content.FileProvider;
import android.text.TextUtils;
import com.arialyy.aria.core.inf.AbsEntity;
import com.arialyy.aria.util.ALog;

@ -16,13 +16,13 @@
package com.arialyy.simple.widget;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.simple.R;
import java.util.LinkedList;

@ -17,10 +17,7 @@ package com.arialyy.simple.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.databinding.BindingAdapter;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.support.v7.widget.AppCompatImageView;
import android.text.Html;
import android.text.TextUtils;
import android.util.AttributeSet;
@ -28,6 +25,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.DrawableRes;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.databinding.BindingAdapter;
import com.arialyy.simple.R;
public class SvgTextView extends RelativeLayout {
@ -64,17 +64,15 @@ public class SvgTextView extends RelativeLayout {
attributes.recycle();
}
public void setIconClickListener(View.OnClickListener listener){
public void setIconClickListener(View.OnClickListener listener) {
icon.setOnClickListener(listener);
}
@BindingAdapter(value = {"svg_text_view_icon"})
@BindingAdapter(value = { "svg_text_view_icon" })
public static void bindAttr(SvgTextView svgTextView, @DrawableRes int drawable) {
svgTextView.icon.setImageResource(drawable);
}
public void setIcon(@DrawableRes int drawable) {
icon.setImageResource(drawable);
}

@ -11,7 +11,7 @@
<include layout="@layout/layout_bar"/>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -42,7 +42,7 @@
android:background="@android:color/darker_gray"
/>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -9,7 +9,7 @@
<include layout="@layout/layout_bar"/>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<RelativeLayout
@ -11,7 +10,7 @@
>
<include layout="@layout/layout_bar"/>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -11,7 +11,7 @@
<include layout="@layout/layout_bar"/>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -6,7 +6,7 @@
android:orientation="vertical"
>
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"

@ -56,7 +56,7 @@
android:textStyle="bold"
/>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"

@ -25,7 +25,7 @@
android:paddingRight="8dp"
>
<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/control_bt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save