Skip to content

Commit

Permalink
see 10/25 log
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankj committed Oct 24, 2020
1 parent f06baa3 commit 538d76c
Show file tree
Hide file tree
Showing 81 changed files with 2,500 additions and 1,460 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
* `20/09/06` [add] DebouncingUtils.
* `20/10/24` [add] Publish v1.30.0.
* `20/10/23` [fix] LanguageUtils crash on some device.
* `20/10/21` [add] LogUtils.Config#setOnConsoleOutputListener, setOnFileOutputListener, addFileExtraHead. LogUtils.getCurrentLogFilePath.
* `20/10/20` [opt] ToastUtils.
* `20/10/12` [add] PermissionUtils#explain.
* `20/10/10` [add] ClipboardUtils.
* `20/10/08` [add] VolumeUtils.
* `20/09/06` [add] DebouncingUtils#isValid.
* `20/09/04` [fix] ToastUtils adapt SDK 30.
* `20/05/28` [fix] IntentUtils#getInstallAppIntent file exist wrong. Publish v1.29.0.
* `20/05/23` [fix] BusUtils#postSticky times not right. Publish v1.28.6.
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Config {
static compileSdkVersion = 29
static minSdkVersion = 14
static targetSdkVersion = 29
static versionCode = 1_029_000
static versionName = '1.29.0'// E.g. 1.9.72 => 1,009,072
static versionCode = 1_030_000
static versionName = '1.30.0'// E.g. 1.9.72 => 1,009,072

// lib version
static gradlePluginVersion = '3.5.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.blankj.launcher.app;

import android.content.Context;

import com.blankj.common.CommonApplication;
import com.blankj.utilcode.util.ResourceUtils;

/**
* <pre>
Expand All @@ -21,11 +18,6 @@ public static LauncherApp getInstance() {
return sInstance;
}

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
}

@Override
public void onCreate() {
super.onCreate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ class DangerousActivity : CommonActivity() {
CommonItemClick(R.string.dangerous_reboot_to_bootloader) {
ToastUtils.showShort(DangerousUtils.reboot2Bootloader().toString())
},
CommonItemSwitch(R.string.dangerous_data_enabled, Utils.Supplier {
NetworkUtils.getMobileDataEnabled()
}, Utils.Consumer {
if (AppUtils.isAppSystem()) {
DangerousUtils.setMobileDataEnabled(it)
}
}),
CommonItemSwitch(
R.string.dangerous_data_enabled,
{ NetworkUtils.getMobileDataEnabled() },
{
if (AppUtils.isAppSystem()) {
DangerousUtils.setMobileDataEnabled(it)
}
}
),
CommonItemClick(R.string.dangerous_send_sms_silent) {
DangerousUtils.sendSmsSilent("10000", "sendSmsSilent")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ import com.blankj.utilcode.util.PermissionUtils
*/
class LocationActivity : CommonActivity() {

private var lastLatitude: String = "unknown"
private var lastLongitude: String = "unknown"
private var latitude: String = "unknown"
private var longitude: String = "unknown"
private var country: String = "unknown"
private var locality: String = "unknown"
private var street: String = "unknown"

companion object {
fun start(context: Context) {
PermissionHelper.request(context, object : PermissionUtils.SimpleCallback {
Expand All @@ -48,18 +56,17 @@ class LocationActivity : CommonActivity() {
mLocationService.setOnGetLocationListener(object : LocationService.OnGetLocationListener {
override fun getLocation(lastLatitude: String, lastLongitude: String, latitude: String,
longitude: String, country: String, locality: String, street: String) {
this@LocationActivity.apply {
this.lastLatitude = lastLatitude
this.lastLongitude = lastLongitude
this.latitude = latitude
this.longitude = longitude
this.country = country
this.locality = locality
this.street = street
}
runOnUiThread {
itemsView.updateItems(
CollectionUtils.newArrayList<CommonItem<*>>(
CommonItemTitle("lastLatitude", lastLatitude),
CommonItemTitle("lastLongitude", lastLongitude),
CommonItemTitle("latitude", latitude),
CommonItemTitle("longitude", longitude),
CommonItemTitle("getCountryName", country),
CommonItemTitle("getLocality", locality),
CommonItemTitle("getStreet", street)
)
)
itemsView.updateItems(bindItems())
}
}
})
Expand All @@ -72,13 +79,13 @@ class LocationActivity : CommonActivity() {

override fun bindItems(): MutableList<CommonItem<*>> {
return CollectionUtils.newArrayList(
CommonItemTitle("lastLatitude", "unknown"),
CommonItemTitle("lastLongitude", "unknown"),
CommonItemTitle("latitude", "unknown"),
CommonItemTitle("longitude", "unknown"),
CommonItemTitle("getCountryName", "unknown"),
CommonItemTitle("getLocality", "unknown"),
CommonItemTitle("getStreet", "unknown")
CommonItemTitle("lastLatitude", lastLatitude),
CommonItemTitle("lastLongitude", lastLongitude),
CommonItemTitle("latitude", latitude),
CommonItemTitle("longitude", longitude),
CommonItemTitle("getCountryName", country),
CommonItemTitle("getLocality", locality),
CommonItemTitle("getStreet", street)
)
}

Expand Down
13 changes: 10 additions & 3 deletions feature/utilcode/pkg/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
android:name=".feature.click.ClickActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name=".feature.clipboard.ClipboardActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name=".feature.device.DeviceActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
Expand Down Expand Up @@ -190,7 +194,7 @@
android:launchMode="singleTop">
<meta-data
android:name="activity_meta_data"
android:value="ActivityMetaData" />
android:value="D1234567890123456789012345678901234567890" />
</activity>
<activity
android:name=".feature.mvp.MvpActivity"
Expand Down Expand Up @@ -257,8 +261,7 @@
android:launchMode="singleTop" />
<activity
android:name=".feature.toast.ToastActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name=".feature.uiMessage.UiMessageActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
Expand All @@ -267,6 +270,10 @@
android:name=".feature.vibrate.VibrateActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />
<activity
android:name=".feature.volume.VolumeActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTop" />

<meta-data
android:name="app_meta_data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.blankj.utilcode.pkg.feature.brightness.BrightnessActivity
import com.blankj.utilcode.pkg.feature.bus.BusActivity
import com.blankj.utilcode.pkg.feature.clean.CleanActivity
import com.blankj.utilcode.pkg.feature.click.ClickActivity
import com.blankj.utilcode.pkg.feature.clipboard.ClipboardActivity
import com.blankj.utilcode.pkg.feature.device.DeviceActivity
import com.blankj.utilcode.pkg.feature.file.FileActivity
import com.blankj.utilcode.pkg.feature.flashlight.FlashlightActivity
Expand Down Expand Up @@ -47,8 +48,11 @@ import com.blankj.utilcode.pkg.feature.span.SpanActivity
import com.blankj.utilcode.pkg.feature.toast.ToastActivity
import com.blankj.utilcode.pkg.feature.uiMessage.UiMessageActivity
import com.blankj.utilcode.pkg.feature.vibrate.VibrateActivity
import com.blankj.utilcode.pkg.feature.volume.VolumeActivity
import com.blankj.utilcode.pkg.helper.DialogHelper
import com.blankj.utilcode.util.CollectionUtils
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ThreadUtils
import com.blankj.utilcode.util.UtilsTransActivity

/**
Expand Down Expand Up @@ -76,6 +80,9 @@ class CoreUtilActivity : CommonActivity() {
return CollectionUtils.newArrayList(
CommonItemClick(R.string.demo_activity, true) {
ActivityActivity.start(this)
ThreadUtils.runOnUiThreadDelayed(Runnable {

}, 2000)
},
CommonItemClick(R.string.demo_adapt_screen, true) {
AdaptScreenActivity.start(this)
Expand All @@ -101,6 +108,9 @@ class CoreUtilActivity : CommonActivity() {
CommonItemClick(R.string.demo_click, true) {
ClickActivity.start(this)
},
CommonItemClick(R.string.demo_clipboard, true) {
ClipboardActivity.start(this)
},
CommonItemClick(R.string.demo_crash) {
throw NullPointerException("crash test")
},
Expand Down Expand Up @@ -202,6 +212,9 @@ class CoreUtilActivity : CommonActivity() {
},
CommonItemClick(R.string.demo_vibrate, true) {
VibrateActivity.start(this)
},
CommonItemClick(R.string.demo_volume, true) {
VolumeActivity.start(this)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package com.blankj.utilcode.pkg.feature.api
import android.content.Context
import android.content.Intent
import com.blankj.common.activity.CommonActivity
import com.blankj.common.activity.CommonActivityItemsView
import com.blankj.common.activity.CommonActivityTitleView
import com.blankj.common.item.CommonItem
import com.blankj.common.item.CommonItemClick
import com.blankj.utilcode.pkg.R
Expand Down Expand Up @@ -34,7 +32,7 @@ class ApiActivity : CommonActivity() {
return R.string.demo_api
}

override fun bindItems(): List<CommonItem<*>> {
override fun bindItems(): MutableList<CommonItem<*>> {
return CollectionUtils.newArrayList(
CommonItemClick(R.string.api_invoke_with_params) {
ApiUtils.getApi(OtherModuleApi::class.java).invokeWithParams(OtherModuleApi.ApiBean("params"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AppActivity : CommonActivity() {
LogUtils.e(requestCode, resultCode)
}

override fun bindItems(): List<CommonItem<*>> {
override fun bindItems(): MutableList<CommonItem<*>> {
return CollectionUtils.newArrayList(
CommonItemTitle("isAppRoot", AppUtils.isAppRoot().toString()),
CommonItemTitle("isAppDebug", AppUtils.isAppDebug().toString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,14 @@ class BarNavActivity : CommonActivity() {
if (BarUtils.isSupportNavBar()) {
add(CommonItemSwitch(
R.string.bar_nav_visibility,
Utils.Supplier {
BarUtils.isNavBarVisible(this@BarNavActivity)
},
Utils.Consumer {
BarUtils.setNavBarVisibility(this@BarNavActivity, it)
}
{ BarUtils.isNavBarVisible(this@BarNavActivity) },
{ BarUtils.setNavBarVisibility(this@BarNavActivity, it) }
))

add(CommonItemSwitch(
R.string.bar_nav_light_mode,
Utils.Supplier {
BarUtils.isNavBarLightMode(this@BarNavActivity)
},
Utils.Consumer {
BarUtils.setNavBarLightMode(this@BarNavActivity, it)
}
{ BarUtils.isNavBarLightMode(this@BarNavActivity) },
{ BarUtils.setNavBarLightMode(this@BarNavActivity, it) }
))

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,13 @@ class BarStatusActivity : CommonActivity() {
CommonItemTitle("getStatusBarHeight", BarUtils.getStatusBarHeight().toString()),
CommonItemSwitch(
R.string.bar_status_visibility,
Utils.Supplier {
BarUtils.isStatusBarVisible(this)
},
Utils.Consumer {
BarUtils.setStatusBarVisibility(this, it)
}
{ BarUtils.isStatusBarVisible(this) },
{ BarUtils.setStatusBarVisibility(this, it) }
),
CommonItemSwitch(
R.string.bar_status_light_mode,
Utils.Supplier {
BarUtils.isStatusBarLightMode(this)
},
Utils.Consumer {
BarUtils.setStatusBarLightMode(this, it)
}
{ BarUtils.isStatusBarLightMode(this) },
{ BarUtils.setStatusBarLightMode(this, it) }
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ class BarStatusActivityAlpha : CommonActivity() {

private fun getItems(): List<CommonItem<*>> {
return CollectionUtils.newArrayList<CommonItem<*>>(
CommonItemSeekBar("Status Bar Alpha", 255, mAlpha, object : SeekBar.OnSeekBarChangeListener {
CommonItemSeekBar("Status Bar Alpha", 255, object : CommonItemSeekBar.ProgressListener() {
override fun getCurValue(): Int {
return mAlpha
}

override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
mAlpha = progress
updateStatusBar()
}

override fun onStartTrackingTouch(seekBar: SeekBar?) {}

override fun onStopTrackingTouch(seekBar: SeekBar?) {}
}).apply {
backgroundColor = ColorUtils.setAlphaComponent(backgroundColor, 0.5f)
}
Expand Down
Loading

0 comments on commit 538d76c

Please sign in to comment.