> {
+ return CollectionUtils.newArrayList(
+ getItemSeekBar("Voice Call", AudioManager.STREAM_VOICE_CALL),
+ getItemSeekBar("System", AudioManager.STREAM_SYSTEM),
+ getItemSeekBar("Music", AudioManager.STREAM_MUSIC),
+ getItemSeekBar("Ring", AudioManager.STREAM_RING),
+ getItemSeekBar("Alarm", AudioManager.STREAM_ALARM),
+ getItemSeekBar("Notification", AudioManager.STREAM_NOTIFICATION),
+ getItemSeekBar("Dtmf", AudioManager.STREAM_DTMF)
+ )
+ }
+
+ private fun getItemSeekBar(title: CharSequence, streamType: Int): CommonItemSeekBar {
+ return CommonItemSeekBar(title, VolumeUtils.getMaxVolume(streamType), object : CommonItemSeekBar.ProgressListener() {
+ override fun getCurValue(): Int {
+ return VolumeUtils.getVolume(streamType)
+ }
+
+ override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+ VolumeUtils.setVolume(streamType, progress, AudioManager.FLAG_SHOW_UI)
+ }
+ })
+ }
+
+ override fun onResume() {
+ super.onResume()
+ itemsView.updateItems(bindItems())
+ }
+}
diff --git a/feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/helper/DialogHelper.kt b/feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/helper/DialogHelper.kt
index 6643ec7806..7d38fda3ca 100644
--- a/feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/helper/DialogHelper.kt
+++ b/feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/helper/DialogHelper.kt
@@ -4,7 +4,6 @@ import android.content.Context
import android.content.DialogInterface
import android.graphics.Bitmap
import android.graphics.drawable.ColorDrawable
-import android.support.v4.app.FragmentActivity
import android.text.method.ScrollingMovementMethod
import android.view.Gravity
import android.view.View
@@ -13,6 +12,7 @@ import android.widget.Button
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
+import androidx.fragment.app.FragmentActivity
import com.blankj.base.dialog.BaseDialogFragment
import com.blankj.base.dialog.DialogLayoutCallback
import com.blankj.utilcode.pkg.R
@@ -155,4 +155,4 @@ object DialogHelper {
override fun onDismiss(dialog: BaseDialogFragment) {}
}).show()
}
-}
+}
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/layout/activity_adaptscreen.xml b/feature/utilcode/pkg/src/main/res/layout/activity_adaptscreen.xml
new file mode 100644
index 0000000000..278fe8c2c6
--- /dev/null
+++ b/feature/utilcode/pkg/src/main/res/layout/activity_adaptscreen.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/feature/utilcode/pkg/src/main/res/layout/adaptscreen_close_activity.xml b/feature/utilcode/pkg/src/main/res/layout/adaptscreen_close_activity.xml
index 0214eb4806..2f8476a4a0 100644
--- a/feature/utilcode/pkg/src/main/res/layout/adaptscreen_close_activity.xml
+++ b/feature/utilcode/pkg/src/main/res/layout/adaptscreen_close_activity.xml
@@ -7,7 +7,7 @@
android:fillViewport="true"
tools:context=".feature.adaptScreen.AdaptCloseActivity">
-
@@ -42,6 +42,6 @@
android:textSize="30pt"
app:layout_constraintTop_toBottomOf="@id/adaptScreenCloseAdaptDpTv" />
-
+
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/layout/adaptscreen_height_activity.xml b/feature/utilcode/pkg/src/main/res/layout/adaptscreen_height_activity.xml
index 819d6bb99d..75fa87e8e5 100644
--- a/feature/utilcode/pkg/src/main/res/layout/adaptscreen_height_activity.xml
+++ b/feature/utilcode/pkg/src/main/res/layout/adaptscreen_height_activity.xml
@@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:context=".feature.adaptScreen.AdaptHeightActivity">
-
@@ -93,6 +93,6 @@
android:textSize="30pt" />
-
+
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/layout/adaptscreen_width_activity.xml b/feature/utilcode/pkg/src/main/res/layout/adaptscreen_width_activity.xml
index 9c5e953ecb..b6bfdb2c80 100644
--- a/feature/utilcode/pkg/src/main/res/layout/adaptscreen_width_activity.xml
+++ b/feature/utilcode/pkg/src/main/res/layout/adaptscreen_width_activity.xml
@@ -7,7 +7,7 @@
android:fillViewport="true"
tools:context=".feature.adaptScreen.AdaptWidthActivity">
-
@@ -148,6 +148,6 @@
-
+
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/layout/bar_status_fragment_activity.xml b/feature/utilcode/pkg/src/main/res/layout/bar_status_fragment_activity.xml
index 23dbb69305..16518fc22f 100644
--- a/feature/utilcode/pkg/src/main/res/layout/bar_status_fragment_activity.xml
+++ b/feature/utilcode/pkg/src/main/res/layout/bar_status_fragment_activity.xml
@@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
-
-
+
+
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/values-en-rUS/strings.xml b/feature/utilcode/pkg/src/main/res/values-en-rUS/strings.xml
index 84ac729412..20efc6c063 100644
--- a/feature/utilcode/pkg/src/main/res/values-en-rUS/strings.xml
+++ b/feature/utilcode/pkg/src/main/res/values-en-rUS/strings.xml
@@ -3,11 +3,10 @@
Language Demo
- Language
- Language App Context
- Language Activity Context
Apply Simple Chinese
Apply American
+ Apply English
+ Apply Arabic
Apply System
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/values-zh-rCN/strings.xml b/feature/utilcode/pkg/src/main/res/values-zh-rCN/strings.xml
index d1ba24cff1..e06759a6d0 100644
--- a/feature/utilcode/pkg/src/main/res/values-zh-rCN/strings.xml
+++ b/feature/utilcode/pkg/src/main/res/values-zh-rCN/strings.xml
@@ -3,11 +3,10 @@
语言例子
- 语言
- App 上下文语言
- Activity 上下文语言
- 应用简体中文
- 应用英语
- 应用系统语言
+ 设置简体中文
+ 设置美语
+ 设置英语
+ 设置阿拉伯语
+ 设置系统语言
\ No newline at end of file
diff --git a/feature/utilcode/pkg/src/main/res/values/strings.xml b/feature/utilcode/pkg/src/main/res/values/strings.xml
index 5bea803e40..551f9adbaf 100644
--- a/feature/utilcode/pkg/src/main/res/values/strings.xml
+++ b/feature/utilcode/pkg/src/main/res/values/strings.xml
@@ -9,6 +9,7 @@
BusUtils Demo
CleanUtils Demo
ClickUtils Demo
+ ClipboardUtils Demo
CrashUtils Demo
DeviceUtils Demo
FileUtils Demo
@@ -41,6 +42,7 @@
UiMessage Demo
TransActivity Demo
VibrateUtils Demo
+ VolumeUtils Demo
Shared Element
@@ -139,6 +141,7 @@
Clean Internal Databases
Clean Internal SP
Clean External Cache
+ cleanAppUserData
Click View Scale Default
@@ -227,18 +230,20 @@
Close Dialog
- Language
- Language App Context
- Language Activity Context
+ Relaunch App
Apply Simple Chinese
Apply American
+ Apply English
+ Apply Arabic
Apply System
Log Switch
- Console Switch
+ Console Switch
+ Console Listener Switch
Head Switch
File Switch
+ File Listener Switch
Border Switch
Single Tag Switch
Log With No Tag
@@ -325,15 +330,23 @@
Show Short
Show Long
+ Show Null
+ Show Empty
Show Green Font
Show Bg Color
Show Bg Resource
Show Span
+ Show Left Icon
+ Show Dark Mode
+ Show Long String
+ A toast is a view containing a quick little message for the user. The ToastUtils class helps you create and show those.
Show Custom View
Custom View
Show Middle
+ Show Top
Cancel
Show Toast Dialog
+ Show Toast When Start Activity
Short
Long
Green Font
@@ -341,6 +354,7 @@
Custom Bg
Spannable String
Middle
+ Top
Add Listener Id
@@ -352,5 +366,6 @@
Vibrate 1000ms
Vibrate Custom
+ Vibrate Background
Cancel
diff --git a/gradle.properties b/gradle.properties
index 63f495a02a..b9d5f2bcbf 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -13,10 +13,14 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#org.gradle.jvmargs=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
+
+android.enableJetifier=true
+android.useAndroidX=true
+
org.gradle.jvmargs=-Xmx8192m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8
org.gradle.daemon=true
#org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.caching=true
-#-Dorg.gradle.debug=true --no-daemon
\ No newline at end of file
+#-Dorg.gradle.debug=true --no-daemon
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
deleted file mode 100644
index 76bb5fea66..0000000000
--- a/gradle/publish.gradle
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- 1. must add the following classpath in root build.gradle
- classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
- classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
-
- 2. add bintrayUser, bintrayKey in root local.properties
-
- 3. copy the file to the directory of gradle, and apply the file in the module
- apply from: "${rootDir.path}/gradle/publish.gradle"
- publish {
- name = "UtilCode"
- groupId = "com.blankj"
- artifactId = "utilcode"
- version = "xx.xx"
- website = "https://github.com/Blankj/AndroidUtilCode"
- }
-
- 4. execute following command to publish
- ./gradlew bintrayUpload -> upload to bintray
- ./gradlew mavenLocal -> upload to local maven
-*/
-
-apply plugin: "com.github.dcendents.android-maven"
-apply plugin: "com.jfrog.bintray"
-
-extensions.create('publish', PublishExtension)
-
-afterEvaluate {
- def ext = project['publish'] as PublishExtension
- loadBintray(ext)
- configMaven(project, ext)
- configBintray(project, ext)
- configJavadoc(project, ext)
-}
-
-private void loadBintray(PublishExtension ext) {
- Properties properties = new Properties()
- File localPropertiesFile = project.rootProject.file("local.properties");
- if (localPropertiesFile.exists()) {
- properties.load(localPropertiesFile.newDataInputStream())
- ext.bintrayUser = properties.getProperty("bintrayUser")
- ext.bintrayKey = properties.getProperty("bintrayKey")
- }
-}
-
-def configMaven(Project project, PublishExtension ext) {
- project.group = ext.groupId
- project.version = ext.version
-
- project.install {
- repositories.mavenInstaller {
- configPom(pom, ext)
- }
- }
-
- project.tasks.create("mavenLocal", Upload) {
- group("publishing")
- configuration = project.configurations.archives
-
- repositories.mavenDeployer {
- repository(url: uri("${project.rootDir.path}/mavenLocal"))
- configPom(pom, ext)
- }
-
- doFirst {
- ext.check(false)
- }
- }
-
- project.tasks.findByName("bintrayUpload").doFirst {
- ext.check(true)
- }
-}
-
-def configPom(pom, PublishExtension ext) {
- pom.project {
- name ext.name
- groupId ext.groupId
- artifactId ext.artifactId
- version ext.version
- packaging isAndroid() ? "aar" : "jar"
- description ext.name
- url ext.website
-
- scm {
- url ext.website
- connection ext.website
- developerConnection ext.website + ".git"
- }
-
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- }
- }
-
- developers {
- developer {
- id ext.bintrayUser
- name ext.bintrayUser
- }
- }
- }
-
- pom.whenConfigured {
- // 检测 module 中的 dependencies 是否有源码依赖
- // 如果是源码依赖,而且没有在 config 中配置 remotePath,那么发布到仓库,其他地方依赖该库时会找不到源码的那个库
- it.dependencies.findAll { dep -> dep.version == "unspecified" }.collect { dep ->
- DepConfig config = Config.depConfig.get(dep.artifactId)
- if (config == null || config.version == null) {
- // 源码依赖而且没有在 config 中配置 remotePath,直接报错
- System.err.println("The module of <" + dep.artifactId + "> should publish to maven first.")
- throw new RuntimeException()
- }
- dep.groupId = config.groupId
- dep.version = config.version
- // 源码依赖,但配置了 remotePath,让 pom 中写入 remotePath
- GLog.l("Please check <${dep.groupId}:${dep.artifactId}:${dep.version}> is published.")
- }
- }
-}
-
-def configBintray(Project project, PublishExtension ext) {
- project.bintray {
- user = ext.bintrayUser
- key = ext.bintrayKey
- configurations = ['archives']
- override = false
- publish = true
- pkg {
- repo = "maven"
- name = ext.name
- websiteUrl = ext.website
- vcsUrl = ext.website + '.git'
- licenses = ["Apache-2.0"]
- }
- }
-}
-
-private void configJavadoc(Project project, PublishExtension ext) {
- if (isAndroid()) {
- // This generates sources.jar
- task sourcesJar(type: Jar) {
- classifier = 'sources'
- from android.sourceSets.main.java.source
- }
-
- task javadoc(type: Javadoc) {
- source = android.sourceSets.main.java.source
- classpath += configurations.compile
- classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
- }
-
- task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
- }
- } else {
- task sourcesJar(type: Jar, dependsOn: classes) {
- classifier = 'sources'
- from sourceSets.main.allSource
- }
-
- task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
- }
- }
-
- if (project.hasProperty("kotlin")) {
- // Disable creating javadocs
- project.tasks.withType(Javadoc) {
- enabled = false
- }
- }
-
- javadoc {
- options {
- encoding "UTF-8"
- charSet 'UTF-8'
- author true
- version ext.version
- links "http://docs.oracle.com/javase/7/docs/api"
- title "${ext.name} ${ext.version}"
- }
- }
-
- artifacts {
- archives javadocJar
- archives sourcesJar
- }
-}
-
-def isAndroid() {
- return project.getPlugins().hasPlugin('com.android.application') ||
- project.getPlugins().hasPlugin('com.android.library')
-}
-
-class PublishExtension {
- String name
- String groupId
- String artifactId
- String version
- String website
-
- String bintrayUser
- String bintrayKey
-
- void check(boolean isBintray) {
- checkField(name, "name")
- checkField(groupId, "groupId")
- checkField(artifactId, "artifactId")
- checkField(version, "version")
- checkField(website, "website")
-
- if (isBintray) {
- if (isBintrayEmpty()) {
- throw new NullPointerException("U should set bintrayUser and bintrayKey in local.properties")
- }
- }
- }
-
- boolean isBintrayEmpty() {
- return isEmpty(bintrayUser) || isEmpty(bintrayKey)
- }
-
- static void checkField(String field, String fieldName) {
- if (isEmpty(field)) {
- throw new NullPointerException("$fieldName is empty!!")
- }
- }
-
- static boolean isEmpty(String str) {
- return str == null || str.length() == 0
- }
-}
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 13372aef5e..5c2d1cf016 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e4718dff4d..1e0ae1a108 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
diff --git a/gradlew b/gradlew
index 9d82f78915..b0d6d0ab5d 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,20 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
##############################################################################
##
@@ -6,20 +22,38 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
-warn ( ) {
+warn () {
echo "$*"
}
-die ( ) {
+die () {
echo
echo "$*"
echo
@@ -30,6 +64,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,26 +75,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -85,7 +105,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -150,11 +170,19 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 8a0b282aa6..15e1ee37a7 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,90 +1,100 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/lib/base/build.gradle b/lib/base/build.gradle
index 20033bc3f0..b7eb9d588c 100644
--- a/lib/base/build.gradle
+++ b/lib/base/build.gradle
@@ -1,15 +1,14 @@
dependencies {
- implementation fileTree(include: ['*.jar'], dir: 'libs')
- api Config.depConfig.lib_subutil.dep
- api Config.depConfig.lib_utilcode.dep
+ api Config.modules.lib_subutil.dep
+ api Config.modules.lib_utilcode.dep
- api Config.depConfig.support_appcompat_v7.dep
- api Config.depConfig.support_design.dep
- api Config.depConfig.support_multidex.dep
- api Config.depConfig.support_constraint.dep
- api Config.depConfig.kotlin.dep
- api Config.depConfig.free_proguard.dep
- api Config.depConfig.swipe_panel.dep
- api Config.depConfig.eventbus_lib.dep
- compileOnly Config.depConfig.lib_utildebug_no_op.dep
+ api Config.libs.androidx_appcompat.path
+ api Config.libs.androidx_material.path
+ api Config.libs.androidx_multidex.path
+ api Config.libs.androidx_constraint.path
+ api Config.libs.kotlin.path
+ api Config.libs.free_proguard.path
+ api Config.libs.swipe_panel.path
+ api Config.libs.eventbus_lib.path
+ compileOnly Config.modules.lib_utildebug_no_op.dep
}
\ No newline at end of file
diff --git a/lib/base/src/main/java/com/blankj/base/BaseActivity.java b/lib/base/src/main/java/com/blankj/base/BaseActivity.java
index c0c1fce1ce..c0348203f8 100644
--- a/lib/base/src/main/java/com/blankj/base/BaseActivity.java
+++ b/lib/base/src/main/java/com/blankj/base/BaseActivity.java
@@ -2,10 +2,12 @@
import android.app.Activity;
import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.annotation.LayoutRes;
+import androidx.appcompat.app.AppCompatActivity;
+
import com.blankj.utilcode.util.ClickUtils;
/**
diff --git a/lib/base/src/main/java/com/blankj/base/BaseApplication.java b/lib/base/src/main/java/com/blankj/base/BaseApplication.java
index aedea57cb4..f1fd6186c0 100644
--- a/lib/base/src/main/java/com/blankj/base/BaseApplication.java
+++ b/lib/base/src/main/java/com/blankj/base/BaseApplication.java
@@ -2,7 +2,8 @@
import android.app.Application;
import android.content.Context;
-import android.support.multidex.MultiDex;
+
+import androidx.multidex.MultiDex;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.CrashUtils;
@@ -74,15 +75,16 @@ public String format(ArrayList arrayList) {
return "LogUtils Formatter ArrayList { " + arrayList.toString() + " }";
}
})
- .setFileWriter(null);
+ .addFileExtraHead("ExtraKey", "ExtraValue");
LogUtils.i(config.toString());
}
private void initCrash() {
CrashUtils.init(new CrashUtils.OnCrashListener() {
@Override
- public void onCrash(String crashInfo, Throwable e) {
- LogUtils.e(crashInfo);
+ public void onCrash(CrashUtils.CrashInfo crashInfo) {
+ crashInfo.addExtraHead("extraKey", "extraValue");
+ LogUtils.e(crashInfo.toString());
AppUtils.relaunchApp();
}
});
diff --git a/lib/base/src/main/java/com/blankj/base/BaseFragment.java b/lib/base/src/main/java/com/blankj/base/BaseFragment.java
index 2ff0a90913..ab2b8877fe 100644
--- a/lib/base/src/main/java/com/blankj/base/BaseFragment.java
+++ b/lib/base/src/main/java/com/blankj/base/BaseFragment.java
@@ -2,13 +2,6 @@
import android.content.Context;
import android.os.Bundle;
-import android.support.annotation.IdRes;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
-import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -17,6 +10,14 @@
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.ClickUtils;
+import androidx.annotation.IdRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
/**
*
* author: Blankj
@@ -89,7 +90,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
} else {
ft.show(this);
}
- ft.commitAllowingStateLoss();
+ ft.commitNowAllowingStateLoss();
}
Bundle bundle = getArguments();
initData(bundle);
diff --git a/lib/base/src/main/java/com/blankj/base/IBaseView.java b/lib/base/src/main/java/com/blankj/base/IBaseView.java
index 282649b774..821cbf4399 100644
--- a/lib/base/src/main/java/com/blankj/base/IBaseView.java
+++ b/lib/base/src/main/java/com/blankj/base/IBaseView.java
@@ -1,11 +1,12 @@
package com.blankj.base;
import android.os.Bundle;
-import android.support.annotation.LayoutRes;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
import android.view.View;
+import androidx.annotation.LayoutRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
/**
*
diff --git a/lib/base/src/main/java/com/blankj/base/dialog/BaseDialog.java b/lib/base/src/main/java/com/blankj/base/dialog/BaseDialog.java
index 274f451a56..1599d8becc 100644
--- a/lib/base/src/main/java/com/blankj/base/dialog/BaseDialog.java
+++ b/lib/base/src/main/java/com/blankj/base/dialog/BaseDialog.java
@@ -4,13 +4,14 @@
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
-import android.support.annotation.NonNull;
import android.view.View;
import android.view.Window;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.ThreadUtils;
+import androidx.annotation.NonNull;
+
/**
*
* author: blankj
diff --git a/lib/base/src/main/java/com/blankj/base/dialog/BaseDialogFragment.java b/lib/base/src/main/java/com/blankj/base/dialog/BaseDialogFragment.java
index d83dc5cc32..e115e78878 100644
--- a/lib/base/src/main/java/com/blankj/base/dialog/BaseDialogFragment.java
+++ b/lib/base/src/main/java/com/blankj/base/dialog/BaseDialogFragment.java
@@ -6,12 +6,6 @@
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -21,6 +15,13 @@
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ThreadUtils;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
+
/**
*
* author: blankj
diff --git a/lib/base/src/main/java/com/blankj/base/dialog/DialogCallback.java b/lib/base/src/main/java/com/blankj/base/dialog/DialogCallback.java
index 7d1c6e632a..defd34483f 100644
--- a/lib/base/src/main/java/com/blankj/base/dialog/DialogCallback.java
+++ b/lib/base/src/main/java/com/blankj/base/dialog/DialogCallback.java
@@ -2,9 +2,10 @@
import android.app.Activity;
import android.app.Dialog;
-import android.support.annotation.NonNull;
import android.view.Window;
+import androidx.annotation.NonNull;
+
/**
*
* author: blankj
diff --git a/lib/base/src/main/java/com/blankj/base/mvp/BaseModel.java b/lib/base/src/main/java/com/blankj/base/mvp/BaseModel.java
index 84c930fd74..b48ed32f23 100644
--- a/lib/base/src/main/java/com/blankj/base/mvp/BaseModel.java
+++ b/lib/base/src/main/java/com/blankj/base/mvp/BaseModel.java
@@ -1,10 +1,9 @@
package com.blankj.base.mvp;
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.MutableLiveData;
-import android.support.annotation.CallSuper;
import android.util.Log;
+import androidx.annotation.CallSuper;
+
/**
*
* author: blankj
@@ -15,8 +14,6 @@
*/
public abstract class BaseModel {
- LiveData