优化代码

This commit is contained in:
TonyJiangWJ 2022-01-15 21:46:56 +08:00
parent ad1bbecc7e
commit ddce6e6b97
5 changed files with 19 additions and 8 deletions

View File

@ -96,7 +96,7 @@ android {
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
// include "x86", "armeabi-v7a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.

View File

@ -24,7 +24,7 @@ public class Timer {
* SparseArray存在线程安全问题 改为ConcurrentHashMap
*/
private Map<Integer, Runnable> mHandlerCallbacks = new ConcurrentHashMap<>();
private AtomicInteger mCallbackMaxId = new AtomicInteger();
private AtomicInteger mCallbackMaxId = new AtomicInteger(1);
private WeakReference<ScriptRuntime> mRuntime;
private Handler mHandler;
private long mMaxCallbackUptimeMillis = 0;

View File

@ -78,6 +78,9 @@ public class ViewExtras {
}
public static void recycle(View view) {
if (view == null) {
return;
}
ViewExtras extras;
Object tag = view.getTag(R.id.view_tag_view_extras);
if (tag instanceof ViewExtras) {

View File

@ -6,8 +6,13 @@ buildscript {
ext.kotlin_version = '1.6.10'
ext.junit_version = '4.13.2'
repositories {
mavenCentral()
google()
jcenter()
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
maven { url "https://maven.aliyun.com/repository/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
@ -19,12 +24,15 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
mavenCentral()
google()
maven { url "https://jitpack.io" }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
maven { url "https://maven.aliyun.com/repository/public" }
}
}

View File

@ -40,7 +40,7 @@ android {
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "armeabi-v7a", "arm64-v8a"
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false