Skip to content

Commit f099a1f

Browse files
committed
see 06/29 log
1 parent 83735f3 commit f099a1f

Some content is hidden

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

51 files changed

+1262
-635
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* `19/06/29` [add] ClickUtils#OnMultiClickListener, and remove dangerous function. Publish v1.24.6.
2+
* `19/06/28` [add] LanguageUtils. Publish v1.24.5.
13
* `19/06/20` [fix] BusUtils' permission. Publish v1.24.4.
24
* `19/06/19` [fix] UriUtils. Publish v1.24.3.
35
* `19/06/18` [add] ClickUtils, ViewUtils.

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
4343

44-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.24.4-brightgreen.svg
44+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.24.6-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

4747
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ If this project helps you a lot and you want to support the project's developmen
4141

4242
[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
4343

44-
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.24.4-brightgreen.svg
44+
[aucSvg]: https://img.shields.io/badge/AndroidUtilCode-v1.24.6-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

4747
[apiSvg]: https://img.shields.io/badge/API-14+-brightgreen.svg

gradle/config/config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ gradle.ext {
88
compileSdkVersion = 27
99
minSdkVersion = 14
1010
targetSdkVersion = 27
11-
versionCode = 1_024_004
12-
versionName = '1.24.4'// E.g. 1.9.72 => 1,009,072
11+
versionCode = 1_024_006
12+
versionName = '1.24.6'// E.g. 1.9.72 => 1,009,072
1313

1414
// lib version
1515
kotlin_version = '1.3.10'

launcher/app/src/main/java/com/blankj/launcher/app/LauncherApp.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import android.content.Context;
44

55
import com.blankj.lib.common.CommonApplication;
6-
import com.blankj.utilcode.util.LanguageUtils;
7-
8-
import java.util.Locale;
96

107
/**
118
* <pre>
@@ -32,7 +29,6 @@ protected void attachBaseContext(Context base) {
3229
public void onCreate() {
3330
super.onCreate();
3431
sInstance = this;
35-
LanguageUtils.applyLanguage(getBaseContext(), Locale.SIMPLIFIED_CHINESE);
3632
}
3733
}
3834

lib/common/src/main/res/values/styles.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111

1212
<style name="TextStyle">
1313
<item name="android:textSize">@dimen/font_16</item>
14-
<item name="android:textColor">@drawable/base_sel_button_txt_color</item>
14+
<item name="android:textColor">@color/darkGrayDark</item>
1515
</style>
1616

1717
<style name="WideBtnStyle" parent="TextStyle">
1818
<item name="android:textAllCaps">false</item>
19+
<item name="android:textColor">@drawable/base_sel_button_txt_color</item>
1920
<item name="android:background">@drawable/base_sel_button_bg</item>
2021
<item name="android:layout_marginTop">@dimen/spacing_6</item>
2122
<item name="android:layout_marginBottom">@dimen/spacing_6</item>

subutil/README-CN.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
## APIs
77

88

9+
* ### 应用商店相关 -> [AppStoreUtils.java][appStore.java] -> [Demo][appStore.demo]
10+
```
11+
getAppStoreIntent: 获取跳转应用商店意图
12+
```
13+
914
* ### 剪贴板相关 -> [ClipboardUtils.java][clipboard.java] -> [Test][clipboard.test]
1015
```
1116
copyText : 复制文本到剪贴板
@@ -26,6 +31,25 @@ bd09ToWGS84 : BD09 坐标转 WGS84 坐标
2631
wgs84ToBd09 : WGS84 坐标转 BD09 坐标
2732
```
2833

34+
* ### 国家相关 -> [CountryUtils.java][country.java] -> [Demo][country.demo]
35+
```
36+
getCountryCodeBySim : 根据 Sim 卡获取国家码
37+
getCountryCodeByLanguage: 根据系统语言获取国家码
38+
getCountryBySim : 根据 Sim 卡获取国家
39+
getCountryByLanguage : 根据系统语言获取国家
40+
```
41+
42+
* ### 危险相关 -> [DangerousUtils.java][dangerous.java] -> [Demo][dangerous.demo]
43+
```
44+
installAppSilent : 静默安装 App
45+
uninstallAppSilent : 静默卸载 App
46+
shutdown : 关机
47+
reboot : 重启
48+
reboot2Recovery : 重启到 recovery
49+
reboot2Bootloader : 重启到 bootloader
50+
setMobileDataEnabled: 打开或关闭移动数据
51+
```
52+
2953
* ### 定位相关 -> [LocationUtils.java][location.java] -> [Demo][location.demo]
3054
```
3155
isGpsEnabled : 判断 Gps 是否可用
@@ -53,12 +77,21 @@ getSurnameFirstLetter: 根据名字获取姓氏的首字母
5377

5478

5579

80+
[appStore.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/AppStoreUtils.java
81+
[appStore.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/appStore/AppStoreActivity.kt
82+
5683
[clipboard.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/ClipboardUtils.java
5784
[clipboard.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/test/java/com/blankj/subutil/util/ClipboardUtilsTest.java
5885

5986
[coordinate.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/CoordinateUtils.java
6087
[coordinate.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/test/java/com/blankj/subutil/util/CoordinateUtilsTest.java
6188

89+
[country.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/CountryUtils.java
90+
[country.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/country/CountryActivity.kt
91+
92+
[dangerous.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/DangerousUtils.java
93+
[dangerous.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/dangerous/DangerousActivity.kt
94+
6295
[location.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/LocationUtils.java
6396
[location.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/location/LocationActivity.kt
6497

subutil/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ You should copy the following classes which you want to use in your project.
66
## APIs
77

88

9+
* ### About AppStore -> [AppStoreUtils.java][appStore.java] -> [Demo][appStore.demo]
10+
```
11+
getAppStoreIntent
12+
```
13+
914
* ### About Clipboard -> [ClipboardUtils.java][clipboard.java] -> [Test][clipboard.test]
1015
```
1116
copyText
@@ -26,6 +31,25 @@ bd09ToWGS84
2631
wgs84ToBd09
2732
```
2833

34+
* ### About Country -> [CountryUtils.java][country.java] -> [Demo][country.demo]
35+
```
36+
getCountryCodeBySim
37+
getCountryCodeByLanguage
38+
getCountryBySim
39+
getCountryByLanguage
40+
```
41+
42+
* ### About Dangerous -> [DangerousUtils.java][dangerous.java] -> [Demo][dangerous.demo]
43+
```
44+
installAppSilent
45+
uninstallAppSilent
46+
shutdown
47+
reboot
48+
reboot2Recovery
49+
reboot2Bootloader
50+
setMobileDataEnabled
51+
```
52+
2953
* ### About Location -> [LocationUtils.java][location.java] -> [Demo][location.demo]
3054
```
3155
isGpsEnabled
@@ -53,12 +77,21 @@ getSurnameFirstLetter
5377

5478

5579

80+
[appStore.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/AppStoreUtils.java
81+
[appStore.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/appStore/AppStoreActivity.kt
82+
5683
[clipboard.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/ClipboardUtils.java
5784
[clipboard.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/test/java/com/blankj/subutil/util/ClipboardUtilsTest.java
5885

5986
[coordinate.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/CoordinateUtils.java
6087
[coordinate.test]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/test/java/com/blankj/subutil/util/CoordinateUtilsTest.java
6188

89+
[country.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/CountryUtils.java
90+
[country.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/country/CountryActivity.kt
91+
92+
[dangerous.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/DangerousUtils.java
93+
[dangerous.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/dangerous/DangerousActivity.kt
94+
6295
[location.java]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/lib/src/main/java/com/blankj/subutil/util/LocationUtils.java
6396
[location.demo]: https://github.com/Blankj/AndroidUtilCode/blob/master/subutil/pkg/src/main/java/com/blankj/subutil/pkg/feature/location/LocationActivity.kt
6497

subutil/lib/src/main/java/com/blankj/subutil/util/CountryUtils.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public class CountryUtils {
2020

2121
private static HashMap<String, String> countryCodeMap;
2222

23+
/**
24+
* Return the country code by sim card.
25+
*
26+
* @param defaultValue The default value.
27+
* @return the country code
28+
*/
2329
public static String getCountryCodeBySim(String defaultValue) {
2430
String code = getCountryCodeFromMap().get(getCountryBySim());
2531
if (code == null) {
@@ -28,6 +34,12 @@ public static String getCountryCodeBySim(String defaultValue) {
2834
return code;
2935
}
3036

37+
/**
38+
* Return the country code by system language.
39+
*
40+
* @param defaultValue The default value.
41+
* @return the country code
42+
*/
3143
public static String getCountryCodeByLanguage(String defaultValue) {
3244
String code = getCountryCodeFromMap().get(getCountryByLanguage());
3345
if (code == null) {
@@ -36,10 +48,11 @@ public static String getCountryCodeByLanguage(String defaultValue) {
3648
return code;
3749
}
3850

39-
public static String getCountryByLanguage() {
40-
return Resources.getSystem().getConfiguration().locale.getCountry();
41-
}
42-
51+
/**
52+
* Return the country by sim card.
53+
*
54+
* @return the country
55+
*/
4356
public static String getCountryBySim() {
4457
TelephonyManager manager = (TelephonyManager) Utils.getApp().getSystemService(Context.TELEPHONY_SERVICE);
4558
if (manager != null) {
@@ -48,6 +61,15 @@ public static String getCountryBySim() {
4861
return "";
4962
}
5063

64+
/**
65+
* Return the country by system language.
66+
*
67+
* @return the country
68+
*/
69+
public static String getCountryByLanguage() {
70+
return Resources.getSystem().getConfiguration().locale.getCountry();
71+
}
72+
5173
private static HashMap<String, String> getCountryCodeFromMap() {
5274
if (countryCodeMap == null) {
5375
countryCodeMap = new HashMap<>(256);

0 commit comments

Comments
 (0)