Skip to content

Commit 4bed20f

Browse files
committed
see 03/26 log
1 parent 5f0b789 commit 4bed20f

File tree

78 files changed

+2280
-2782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2280
-2782
lines changed

buildApp.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ dependencies {
8282
}
8383

8484
def getSuffix() {
85-
if (project.path == ":feature_launcher_app") return ""
86-
return "." + project.path.substring(":feature_".length(), project.path.length() - "_app".length())
85+
if (project.name == "feature_launcher_app") return ""
86+
return "." + project.name.substring("feature_".length(), project.name.length() - "_app".length())
8787
}
8888

8989
def configSigning() {

buildSrc/src/main/groovy/Config.groovy

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Config {
1515
static minSdkVersion = 14
1616
static targetSdkVersion = 29
1717
static versionCode = 1_026_001
18-
static versionName = '1.26.1-alpha3'// E.g. 1.9.72 => 1,009,072
18+
static versionName = '1.26.1-alpha7'// E.g. 1.9.72 => 1,009,072
1919

2020
// lib version
2121
static gradlePluginVersion = '3.5.0'
@@ -25,24 +25,24 @@ class Config {
2525
static depConfig = [
2626
/*Never delete this line*/
2727
/*Generated by "config.json"*/
28-
plugin_api_gradle_plugin : new DepConfig(true, true, ":plugin:api-gradle-plugin"),
29-
plugin_bus_gradle_plugin : new DepConfig(true, true, ":plugin:bus-gradle-plugin"),
30-
feature_mock : new DepConfig(false, true, ":feature:mock"),
31-
feature_launcher_app : new DepConfig(true, true, ":feature:launcher:app"),
32-
feature_main_app : new DepConfig(false, true, ":feature:main:app"),
33-
feature_main_pkg : new DepConfig(true, true, ":feature:main:pkg"),
34-
feature_subutil_app : new DepConfig(false, true, ":feature:subutil:app"),
35-
feature_subutil_pkg : new DepConfig(true, true, ":feature:subutil:pkg"),
36-
feature_subutil_export : new DepConfig(true, true, ":feature:subutil:export"),
37-
feature_utilcode_app : new DepConfig(false, true, ":feature:utilcode:app"),
38-
feature_utilcode_pkg : new DepConfig(true, true, ":feature:utilcode:pkg"),
39-
feature_utilcode_export : new DepConfig(true, true, ":feature:utilcode:export"),
40-
lib_base : new DepConfig(true, true, ":lib:base"),
41-
lib_common : new DepConfig(true, true, ":lib:common"),
42-
lib_subutil : new DepConfig(true, true, ":lib:subutil"),
43-
lib_utilcode : new DepConfig(true, true, ":lib:utilcode", "com.blankj:utilcode:1.26.0"),
44-
lib_utildebug : new DepConfig(true, true, ":lib:utildebug", "com.blankj:utildebug:1.25.10-alpha5"),
45-
lib_utildebug_no_op : new DepConfig(true, true, ":lib:utildebug-no-op", "com.blankj:utildebug-no-op:1.25.10-alpha5"),
28+
plugin_api_gradle_plugin : new DepConfig(true , true , ":plugin:api-gradle-plugin"),
29+
plugin_bus_gradle_plugin : new DepConfig(true , true , ":plugin:bus-gradle-plugin"),
30+
feature_mock : new DepConfig(false, true , ":feature:mock"),
31+
feature_launcher_app : new DepConfig(true , true , ":feature:launcher:app"),
32+
feature_main_app : new DepConfig(false, true , ":feature:main:app"),
33+
feature_main_pkg : new DepConfig(true , true , ":feature:main:pkg"),
34+
feature_subutil_app : new DepConfig(false, true , ":feature:subutil:app"),
35+
feature_subutil_pkg : new DepConfig(true , true , ":feature:subutil:pkg"),
36+
feature_subutil_export : new DepConfig(true , true , ":feature:subutil:export"),
37+
feature_utilcode_app : new DepConfig(false, true , ":feature:utilcode:app"),
38+
feature_utilcode_pkg : new DepConfig(true , true , ":feature:utilcode:pkg"),
39+
feature_utilcode_export : new DepConfig(true , true , ":feature:utilcode:export"),
40+
lib_base : new DepConfig(true , true , ":lib:base"),
41+
lib_common : new DepConfig(true , true , ":lib:common"),
42+
lib_subutil : new DepConfig(true , true , ":lib:subutil"),
43+
lib_utilcode : new DepConfig(true , true , ":lib:utilcode", "com.blankj:utilcode:$versionName"),
44+
lib_utildebug : new DepConfig(true , true , ":lib:utildebug"),
45+
lib_utildebug_no_op : new DepConfig(true , true , ":lib:utildebug-no-op"),
4646
/*Never delete this line*/
4747
plugin_gradle : new DepConfig(pluginPath: "com.android.tools.build:gradle:$gradlePluginVersion"),
4848
plugin_kotlin : new DepConfig(pluginPath: "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"),
@@ -53,7 +53,7 @@ class Config {
5353
// 本地第一次上传插件新的版本需设置 isApply = false, useLocal = true
5454
// 本地上传成功之后 isApply = true 即可应用插件来调试,后续版本更新无需设置 isApply = false
5555
// 发布版本的话把 isApply = false, useLocal = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
56-
plugin_api : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:api-gradle-plugin:1.4-r1", pluginId: "com.blankj.api"),
56+
plugin_api : new DepConfig(isApply: false, useLocal: true, pluginPath: "com.blankj:api-gradle-plugin:1.4-r1", pluginId: "com.blankj.api"),
5757
//./gradlew plugin:api-gradle-plugin:uploadArchives // 上传到本地 maven
5858
//./gradlew plugin:api-gradle-plugin:bintrayUpload // 上传到 jcenter
5959
plugin_bus : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:bus-gradle-plugin:2.6-r2", pluginId: "com.blankj.bus"),
@@ -86,4 +86,4 @@ class Config {
8686
test_robolectric : new DepConfig("org.robolectric:robolectric:4.3.1"),
8787
]
8888
}
89-
//./gradlew clean :lib:utilcode:bintrayUpload
89+
//./gradlew clean lib:lib_utilcode:bintrayUpload

buildSrc/src/main/groovy/ConfigUtils.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ConfigUtils {
3131
config.dep = config.pluginPath
3232
} else {
3333
if (config.useLocal) {
34-
config.dep = gradle.rootProject.findProject(config.localPath)
34+
config.dep = gradle.rootProject.findProject(config.projectPath)
3535
} else {
3636
config.dep = config.remotePath
3737
}

buildSrc/src/main/groovy/DepConfig.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DepConfig {
5050
this.remotePath = remotePath
5151
}
5252

53-
void setPluginPath(String pluginPath){
53+
void setPluginPath(String pluginPath) {
5454
this.pluginPath = pluginPath
5555
this.remotePath = pluginPath
5656
}
@@ -75,8 +75,8 @@ class DepConfig {
7575
return splits.length == 3 ? splits[2] : null
7676
}
7777

78-
String getLocalPath() {
79-
return ":" + localPath.replace(":", "_").substring(1)
78+
String getProjectPath() {
79+
return localPath.substring(0, localPath.lastIndexOf(":")) + ":" + localPath.substring(1).replace(":", "_")
8080
}
8181

8282
@Override

config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
{"isApply": true, "useLocal": true, "localPath": ":lib:base"},
2121
{"isApply": true, "useLocal": true, "localPath": ":lib:common"},
2222
{"isApply": true, "useLocal": true, "localPath": ":lib:subutil"},
23-
{"isApply": true, "useLocal": true, "localPath": ":lib:utilcode", "remotePath": "com.blankj:utilcode:1.26.0"},
24-
{"isApply": true, "useLocal": true, "localPath": ":lib:utildebug", "remotePath": "com.blankj:utildebug:1.25.10-alpha5"},
25-
{"isApply": true, "useLocal": true, "localPath": ":lib:utildebug-no-op", "remotePath": "com.blankj:utildebug-no-op:1.25.10-alpha5"}
23+
{"isApply": true, "useLocal": true, "localPath": ":lib:utilcode", "remotePath": "com.blankj:utilcode:$versionName"},
24+
{"isApply": true, "useLocal": true, "localPath": ":lib:utildebug"},
25+
{"isApply": true, "useLocal": true, "localPath": ":lib:utildebug-no-op"}
2626
]
2727
}

feature/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/dangerous/DangerousActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class DangerousActivity : CommonActivity() {
8787
CommonItemClick(R.string.dangerous_reboot_to_bootloader) {
8888
ToastUtils.showShort(DangerousUtils.reboot2Bootloader().toString())
8989
},
90-
CommonItemSwitch(R.string.dangerous_data_enabled, Utils.Func1 {
90+
CommonItemSwitch(R.string.dangerous_data_enabled, Utils.Supplier {
9191
NetworkUtils.getMobileDataEnabled()
92-
}, Utils.Func1 {
92+
}, Utils.Consumer {
9393
if (AppUtils.isAppSystem()) {
9494
DangerousUtils.setMobileDataEnabled(it)
9595
}

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/app/AppActivity.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ class AppActivity : CommonActivity() {
4949
return R.string.demo_app
5050
}
5151

52+
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
53+
super.onActivityResult(requestCode, resultCode, data)
54+
LogUtils.e(requestCode, resultCode)
55+
}
56+
5257
override fun bindItems(): List<CommonItem<*>> {
5358
return CollectionUtils.newArrayList(
5459
CommonItemTitle("isAppRoot", AppUtils.isAppRoot().toString()),

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bar/nav/BarNavActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ class BarNavActivity : CommonActivity() {
4242
if (BarUtils.isSupportNavBar()) {
4343
add(CommonItemSwitch(
4444
R.string.bar_nav_visibility,
45-
Utils.Func1 {
45+
Utils.Supplier {
4646
BarUtils.isNavBarVisible(this@BarNavActivity)
4747
},
48-
Utils.Func1 {
48+
Utils.Consumer {
4949
BarUtils.setNavBarVisibility(this@BarNavActivity, it)
5050
}
5151
))
5252

5353
add(CommonItemSwitch(
5454
R.string.bar_nav_light_mode,
55-
Utils.Func1 {
55+
Utils.Supplier {
5656
BarUtils.isNavBarLightMode(this@BarNavActivity)
5757
},
58-
Utils.Func1 {
58+
Utils.Consumer {
5959
BarUtils.setNavBarLightMode(this@BarNavActivity, it)
6060
}
6161
))

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bar/status/BarStatusActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ class BarStatusActivity : CommonActivity() {
3737
CommonItemTitle("getStatusBarHeight", BarUtils.getStatusBarHeight().toString()),
3838
CommonItemSwitch(
3939
R.string.bar_status_visibility,
40-
Utils.Func1 {
40+
Utils.Supplier {
4141
BarUtils.isStatusBarVisible(this)
4242
},
43-
Utils.Func1 {
43+
Utils.Consumer {
4444
BarUtils.setStatusBarVisibility(this, it)
4545
}
4646
),
4747
CommonItemSwitch(
4848
R.string.bar_status_light_mode,
49-
Utils.Func1 {
49+
Utils.Supplier {
5050
BarUtils.isStatusBarLightMode(this)
5151
},
52-
Utils.Func1 {
52+
Utils.Consumer {
5353
BarUtils.setStatusBarLightMode(this, it)
5454
}
5555
)

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bar/status/BarStatusActivityDrawer.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ class BarStatusActivityDrawer : CommonActivity() {
7373
})
7474

7575
return CollectionUtils.newArrayList(
76-
CommonItemSwitch(R.string.bar_status_title_alpha, Utils.Func1 {
76+
CommonItemSwitch(R.string.bar_status_title_alpha, Utils.Supplier {
7777
updateStatusBar()
78-
return@Func1 mAlphaStatus
79-
}, Utils.Func1 {
78+
return@Supplier mAlphaStatus
79+
}, Utils.Consumer {
8080
mAlphaStatus = it
8181
if (mAlphaStatus) {
8282
barStatusDrawerRootLl.setBackgroundResource(R.drawable.image_lena)
@@ -86,9 +86,9 @@ class BarStatusActivityDrawer : CommonActivity() {
8686
commonItemAdapter.replaceItem(2, randomColorItem, true)
8787
}
8888
}),
89-
CommonItemSwitch(R.string.bar_status_is_front, Utils.Func1 {
90-
return@Func1 mFrontStatus
91-
}, Utils.Func1 {
89+
CommonItemSwitch(R.string.bar_status_is_front, Utils.Supplier {
90+
return@Supplier mFrontStatus
91+
}, Utils.Consumer {
9292
mFrontStatus = it
9393
updateStatusBar()
9494
}),

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/brightness/BrightnessActivity.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import android.content.Intent
55
import android.os.Build
66
import android.widget.SeekBar
77
import com.blankj.common.activity.CommonActivity
8-
import com.blankj.common.activity.CommonActivityItemsView
9-
import com.blankj.common.activity.CommonActivityTitleView
108
import com.blankj.common.item.CommonItem
119
import com.blankj.common.item.CommonItemSeekBar
1210
import com.blankj.common.item.CommonItemSwitch
@@ -70,10 +68,10 @@ class BrightnessActivity : CommonActivity() {
7068
}),
7169
CommonItemSwitch(
7270
R.string.brightness_auto_brightness,
73-
Utils.Func1 {
71+
Utils.Supplier {
7472
BrightnessUtils.isAutoBrightnessEnabled()
7573
},
76-
Utils.Func1 {
74+
Utils.Consumer {
7775
BrightnessUtils.setAutoBrightnessEnabled(it)
7876
}
7977
)

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/bus/BusActivity.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import android.content.Context
44
import android.content.Intent
55
import android.support.annotation.Keep
66
import com.blankj.common.activity.CommonActivity
7-
import com.blankj.common.activity.CommonActivityTitleView
87
import com.blankj.common.item.CommonItem
98
import com.blankj.common.item.CommonItemClick
109
import com.blankj.common.item.CommonItemTitle
1110
import com.blankj.utilcode.pkg.R
1211
import com.blankj.utilcode.util.BusUtils
1312
import com.blankj.utilcode.util.CollectionUtils
14-
import com.blankj.utilcode.util.Utils
13+
import com.blankj.utilcode.util.ThreadUtils
1514
import kotlin.random.Random
1615

1716

@@ -52,7 +51,7 @@ class BusActivity : CommonActivity() {
5251
@BusUtils.Bus(tag = TAG_IO, threadMode = BusUtils.ThreadMode.IO)
5352
fun testIo() {
5453
val currentThread = Thread.currentThread().toString()
55-
Utils.runOnUiThread(Runnable {
54+
ThreadUtils.runOnUiThread(Runnable {
5655
titleItem.title = currentThread
5756
})
5857
}

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/click/ClickActivity.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ class ClickActivity : CommonActivity() {
3434

3535
override fun bindItems(): MutableList<CommonItem<*>> {
3636
return CollectionUtils.newArrayList(
37-
ClickItem(R.string.click_view_scale_default, Utils.Func1 {
37+
ClickItem(R.string.click_view_scale_default, Utils.Consumer {
3838
ClickUtils.applyPressedViewScale(it)
3939
}),
40-
ClickItem(R.string.click_view_scale_half, Utils.Func1 {
40+
ClickItem(R.string.click_view_scale_half, Utils.Consumer {
4141
ClickUtils.applyPressedViewScale(it, -0.5f)
4242
}),
43-
ClickItem(R.string.click_view_alpha_default, Utils.Func1 {
43+
ClickItem(R.string.click_view_alpha_default, Utils.Consumer {
4444
ClickUtils.applyPressedViewAlpha(it)
4545
}),
46-
ClickItem(R.string.click_bg_alpha_default, Utils.Func1 {
46+
ClickItem(R.string.click_bg_alpha_default, Utils.Consumer {
4747
ClickUtils.applyPressedBgAlpha(it)
4848
}),
49-
ClickItem(R.string.click_bg_dark_default, Utils.Func1 {
49+
ClickItem(R.string.click_bg_dark_default, Utils.Consumer {
5050
ClickUtils.applyPressedBgDark(it)
5151
}),
52-
ClickItem(R.string.click_single_debouncing, Utils.Func1 {
52+
ClickItem(R.string.click_single_debouncing, Utils.Consumer {
5353
ClickUtils.applyPressedBgDark(it)
5454
ClickUtils.applySingleDebouncing(it, 5000) {
5555
SnackbarUtils.with(mContentView)
@@ -59,7 +59,7 @@ class ClickActivity : CommonActivity() {
5959
.show()
6060
}
6161
}),
62-
ClickItem(R.string.click_global_debouncing, Utils.Func1 {
62+
ClickItem(R.string.click_global_debouncing, Utils.Consumer {
6363
ClickUtils.applyPressedBgDark(it)
6464
ClickUtils.applySingleDebouncing(it, 5000) {
6565
SnackbarUtils.with(mContentView)
@@ -69,7 +69,7 @@ class ClickActivity : CommonActivity() {
6969
.show()
7070
}
7171
}),
72-
ClickItem(R.string.click_multi, Utils.Func1 {
72+
ClickItem(R.string.click_multi, Utils.Consumer {
7373
ClickUtils.applyPressedBgDark(it)
7474
it.setOnClickListener(object : ClickUtils.OnMultiClickListener(5) {
7575
override fun onTriggerClick(v: View) {
@@ -92,11 +92,11 @@ class ClickActivity : CommonActivity() {
9292

9393
class ClickItem : CommonItem<ClickItem> {
9494

95-
private val mFunc1: Utils.Func1<Unit, View>;
95+
private val mConsumer: Utils.Consumer<View>;
9696
private val mTitle: String
9797

98-
constructor(@StringRes title: Int, func1: Utils.Func1<Unit, View>) : super(R.layout.common_item_title_click) {
99-
mFunc1 = func1
98+
constructor(@StringRes title: Int, consumer: Utils.Consumer<View>) : super(R.layout.common_item_title_click) {
99+
mConsumer = consumer
100100
mTitle = StringUtils.getString(title)
101101
}
102102

@@ -110,6 +110,6 @@ class ClickItem : CommonItem<ClickItem> {
110110
.setDuration(SnackbarUtils.LENGTH_LONG)
111111
.show()
112112
}
113-
mFunc1.call(holder.itemView)
113+
mConsumer.accept(holder.itemView)
114114
}
115115
}

feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/flashlight/FlashlightActivity.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.blankj.utilcode.pkg.feature.flashlight
33
import android.content.Context
44
import android.content.Intent
55
import com.blankj.common.activity.CommonActivity
6-
import com.blankj.common.activity.CommonActivityTitleView
76
import com.blankj.common.item.CommonItem
87
import com.blankj.common.item.CommonItemSwitch
98
import com.blankj.common.item.CommonItemTitle
@@ -53,10 +52,10 @@ class FlashlightActivity : CommonActivity() {
5352
if (FlashlightUtils.isFlashlightEnable()) {
5453
add(CommonItemSwitch(
5554
R.string.flashlight_status,
56-
Utils.Func1 {
55+
Utils.Supplier {
5756
FlashlightUtils.isFlashlightOn()
5857
},
59-
Utils.Func1 {
58+
Utils.Consumer {
6059
FlashlightUtils.setFlashlightStatus(it)
6160
}
6261
))

0 commit comments

Comments
 (0)