Skip to content

Commit c3487f8

Browse files
committed
优化搜索功能性能
适配悬浮窗新版本
1 parent d25fc27 commit c3487f8

File tree

12 files changed

+447
-410
lines changed

12 files changed

+447
-410
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
Apache License
3-
Version 2.0, January 2004
3+
Version 2.0, January 2020
44
http://www.apache.org/licenses/
55

66
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright [yyyy] [name of copyright owner]
190+
Copyright 2020 Huang JinQun
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

Logcat.apk

1.06 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ allprojects {
2626
```groovy
2727
dependencies {
2828
// 日志调试框架:https://github.com/getActivity/Logcat
29-
debugImplementation 'com.github.getActivity:Logcat:9.8'
29+
debugImplementation 'com.github.getActivity:Logcat:9.9'
3030
}
3131
```
3232

app/AppSignature.jks

2.13 KB
Binary file not shown.

app/build.gradle

Lines changed: 66 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,67 @@
1-
apply plugin: 'com.android.application'
2-
3-
android {
4-
compileSdkVersion 30
5-
6-
defaultConfig {
7-
applicationId "com.hjq.logcat.demo"
8-
minSdkVersion 16
9-
targetSdkVersion 30
10-
versionCode 98
11-
versionName "9.8"
12-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13-
}
14-
15-
// 使用 JDK 1.8
16-
compileOptions {
17-
targetCompatibility JavaVersion.VERSION_1_8
18-
sourceCompatibility JavaVersion.VERSION_1_8
19-
}
20-
21-
buildTypes {
22-
release {
23-
minifyEnabled false
24-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25-
}
26-
}
27-
}
28-
29-
dependencies {
30-
implementation fileTree(include: ['*.jar'], dir: 'libs')
31-
debugImplementation project(':library')
32-
33-
// AppCompat 库:https://developer.android.google.cn/jetpack/androidx/releases/appcompat?hl=zh-cn
34-
implementation 'androidx.appcompat:appcompat:1.3.0'
35-
// Material 库:https://github.com/material-components/material-components-android
36-
implementation 'com.google.android.material:material:1.3.0'
37-
38-
// 标题栏:https://github.com/getActivity/TitleBar
39-
implementation 'com.github.getActivity:TitleBar:8.6'
40-
41-
// 内存泄漏捕捉:https://github.com/square/leakcanary
42-
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 30
5+
6+
defaultConfig {
7+
applicationId "com.hjq.logcat.demo"
8+
minSdkVersion 16
9+
targetSdkVersion 30
10+
versionCode 99
11+
versionName "9.9"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
}
14+
15+
// 使用 JDK 1.8
16+
compileOptions {
17+
targetCompatibility JavaVersion.VERSION_1_8
18+
sourceCompatibility JavaVersion.VERSION_1_8
19+
}
20+
21+
// Apk 签名的那些事:https://www.jianshu.com/p/a1f8e5896aa2
22+
signingConfigs {
23+
config {
24+
storeFile file(StoreFile)
25+
storePassword StorePassword
26+
keyAlias KeyAlias
27+
keyPassword KeyPassword
28+
}
29+
}
30+
31+
buildTypes {
32+
debug {
33+
minifyEnabled false
34+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35+
signingConfig signingConfigs.config
36+
}
37+
38+
release {
39+
minifyEnabled true
40+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
41+
signingConfig signingConfigs.config
42+
}
43+
}
44+
45+
applicationVariants.all { variant ->
46+
// apk 输出文件名配置
47+
variant.outputs.all { output ->
48+
outputFileName = rootProject.getName() + '.apk'
49+
}
50+
}
51+
}
52+
53+
dependencies {
54+
implementation fileTree(include: ['*.jar'], dir: 'libs')
55+
debugImplementation project(':library')
56+
57+
// AppCompat 库:https://developer.android.google.cn/jetpack/androidx/releases/appcompat?hl=zh-cn
58+
implementation 'androidx.appcompat:appcompat:1.3.0'
59+
// Material 库:https://github.com/material-components/material-components-android
60+
implementation 'com.google.android.material:material:1.3.0'
61+
62+
// 标题栏:https://github.com/getActivity/TitleBar
63+
implementation 'com.github.getActivity:TitleBar:8.6'
64+
65+
// 内存泄漏捕捉:https://github.com/square/leakcanary
66+
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
4367
}

app/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
StoreFile = AppSignature.jks
2+
StorePassword = AndroidProject
3+
KeyAlias = AndroidProject
4+
KeyPassword = AndroidProject

build.gradle

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
1-
buildscript {
2-
repositories {
3-
// 阿里云云效仓库:https://maven.aliyun.com/mvn/guide
4-
maven { url 'https://maven.aliyun.com/repository/jcenter' }
5-
maven { url 'https://maven.aliyun.com/repository/google' }
6-
// 华为开源镜像:https://mirrors.huaweicloud.com/
7-
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
8-
// JitPack 远程仓库:https://jitpack.io
9-
maven { url 'https://jitpack.io' }
10-
mavenCentral()
11-
google()
12-
// noinspection JcenterRepositoryObsolete
13-
jcenter()
14-
}
15-
dependencies {
16-
classpath 'com.android.tools.build:gradle:4.1.2'
17-
}
18-
}
19-
20-
allprojects {
21-
repositories {
22-
maven { url 'https://maven.aliyun.com/repository/jcenter' }
23-
maven { url 'https://maven.aliyun.com/repository/google' }
24-
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
25-
maven { url 'https://jitpack.io' }
26-
mavenCentral()
27-
google()
28-
// noinspection JcenterRepositoryObsolete
29-
jcenter()
30-
}
31-
}
32-
33-
task clean(type: Delete) {
34-
delete rootProject.buildDir
1+
buildscript {
2+
repositories {
3+
// 阿里云云效仓库:https://maven.aliyun.com/mvn/guide
4+
maven { url 'https://maven.aliyun.com/repository/jcenter' }
5+
maven { url 'https://maven.aliyun.com/repository/google' }
6+
// 华为开源镜像:https://mirrors.huaweicloud.com/
7+
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
8+
// JitPack 远程仓库:https://jitpack.io
9+
maven { url 'https://jitpack.io' }
10+
mavenCentral()
11+
google()
12+
// noinspection JcenterRepositoryObsolete
13+
jcenter()
14+
}
15+
dependencies {
16+
classpath 'com.android.tools.build:gradle:4.1.2'
17+
}
18+
}
19+
20+
allprojects {
21+
repositories {
22+
maven { url 'https://maven.aliyun.com/repository/jcenter' }
23+
maven { url 'https://maven.aliyun.com/repository/google' }
24+
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
25+
maven { url 'https://jitpack.io' }
26+
mavenCentral()
27+
google()
28+
// noinspection JcenterRepositoryObsolete
29+
jcenter()
30+
}
31+
32+
// 将构建文件统一输出到项目根目录下的 build 文件夹
33+
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
34+
}
35+
36+
task clean(type: Delete) {
37+
delete rootProject.buildDir
3538
}

library/build.gradle

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
apply plugin: 'com.android.library'
2-
3-
android {
4-
5-
// 资源前缀限制
6-
resourcePrefix "logcat_"
7-
8-
compileSdkVersion 30
9-
10-
defaultConfig {
11-
minSdkVersion 16
12-
versionCode 98
13-
versionName "9.8"
14-
}
15-
16-
lintOptions {
17-
abortOnError false
18-
}
19-
20-
android.libraryVariants.all { variant ->
21-
// aar 输出文件名配置
22-
variant.outputs.all { output ->
23-
outputFileName = "${rootProject.name}-${android.defaultConfig.versionName}.aar"
24-
}
25-
}
26-
}
27-
28-
afterEvaluate {
29-
// 排除 BuildConfig.class
30-
generateReleaseBuildConfig.enabled = false
31-
generateDebugBuildConfig.enabled = false
32-
}
33-
34-
dependencies {
35-
// 悬浮窗框架:https://github.com/getActivity/XToast
36-
implementation 'com.github.getActivity:XToast:8.1'
37-
}
38-
39-
tasks.withType(Javadoc) {
40-
options.addStringOption('Xdoclint:none', '-quiet')
41-
options.addStringOption('encoding', 'UTF-8')
42-
options.addStringOption('charSet', 'UTF-8')
43-
}
44-
45-
task sourcesJar(type: Jar) {
46-
from android.sourceSets.main.java.srcDirs
47-
classifier = 'sources'
48-
}
49-
50-
task javadoc(type: Javadoc) {
51-
source = android.sourceSets.main.java.srcDirs
52-
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
53-
}
54-
55-
task javadocJar(type: Jar, dependsOn: javadoc) {
56-
classifier = 'javadoc'
57-
from javadoc.destinationDir
58-
}
59-
60-
artifacts {
61-
archives javadocJar
62-
archives sourcesJar
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
5+
// 资源前缀限制
6+
resourcePrefix "logcat_"
7+
8+
compileSdkVersion 30
9+
10+
defaultConfig {
11+
minSdkVersion 16
12+
versionCode 99
13+
versionName "9.9"
14+
}
15+
16+
lintOptions {
17+
abortOnError false
18+
}
19+
20+
android.libraryVariants.all { variant ->
21+
// aar 输出文件名配置
22+
variant.outputs.all { output ->
23+
outputFileName = "${rootProject.name}-${android.defaultConfig.versionName}.aar"
24+
}
25+
}
26+
}
27+
28+
afterEvaluate {
29+
// 排除 BuildConfig.class
30+
generateReleaseBuildConfig.enabled = false
31+
generateDebugBuildConfig.enabled = false
32+
}
33+
34+
dependencies {
35+
// 悬浮窗框架:https://github.com/getActivity/XToast
36+
implementation 'com.github.getActivity:XToast:8.2'
37+
}
38+
39+
tasks.withType(Javadoc) {
40+
options.addStringOption('Xdoclint:none', '-quiet')
41+
options.addStringOption('encoding', 'UTF-8')
42+
options.addStringOption('charSet', 'UTF-8')
43+
}
44+
45+
task sourcesJar(type: Jar) {
46+
from android.sourceSets.main.java.srcDirs
47+
classifier = 'sources'
48+
}
49+
50+
task javadoc(type: Javadoc) {
51+
source = android.sourceSets.main.java.srcDirs
52+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
53+
}
54+
55+
task javadocJar(type: Jar, dependsOn: javadoc) {
56+
classifier = 'javadoc'
57+
from javadoc.destinationDir
58+
}
59+
60+
artifacts {
61+
archives javadocJar
62+
archives sourcesJar
6363
}

0 commit comments

Comments
 (0)