Skip to content

Commit bc1fade

Browse files
committed
see 02/12 log
1 parent 31c5a6b commit bc1fade

File tree

15 files changed

+364
-343
lines changed

15 files changed

+364
-343
lines changed

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.12.5-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.12.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 ptoject helps you a lot, and you would like to support this ptoject's fu
4141

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

44-
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.12.5-brightgreen.svg
44+
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.12.6-brightgreen.svg
4545
[auc]: https://github.com/Blankj/AndroidUtilCode
4646

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

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies {
5656
// LeakCanary
5757
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
5858
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
59-
// implementation 'com.blankj:utilcode:1.12.5'
59+
// implementation 'com.blankj:utilcode:1.12.6'
6060
}
6161

6262

app/src/main/java/com/blankj/androidutilcode/feature/core/network/NetworkActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void initView(Bundle savedInstanceState, View view) {
7373
tvAboutNetworkAsync = findViewById(R.id.tv_about_network_async);
7474
findViewById(R.id.btn_open_wireless_settings).setOnClickListener(this);
7575
findViewById(R.id.btn_set_wifi_enabled).setOnClickListener(this);
76-
setAboutNetwork();
76+
updateAboutNetwork();
7777
}
7878

7979
@Override
@@ -112,10 +112,10 @@ public void onWidgetClick(View view) {
112112
NetworkUtils.setWifiEnabled(!NetworkUtils.getWifiEnabled());
113113
break;
114114
}
115-
setAboutNetwork();
115+
updateAboutNetwork();
116116
}
117117

118-
private void setAboutNetwork() {
118+
private void updateAboutNetwork() {
119119
tvAboutNetwork.setText(new SpanUtils()
120120
.appendLine("isConnected: " + NetworkUtils.isConnected())
121121
.appendLine("getMobileDataEnabled: " + NetworkUtils.getMobileDataEnabled())

app/src/main/java/com/blankj/androidutilcode/feature/core/screen/ScreenActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void initData(Bundle bundle) {
3737

3838
@Override
3939
public int bindLayout() {
40-
return R.layout.activity_brightness;
40+
return R.layout.activity_screen;
4141
}
4242

4343
@Override

subutil/src/main/java/com/blankj/subutil/util/BrightnessUtils.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,19 @@ public static int getBrightness() {
9191
*
9292
* @param brightness 亮度值
9393
*/
94-
public static void setBrightness(@IntRange(from = 0, to = 255) final int brightness) {
94+
public static boolean setBrightness(@IntRange(from = 0, to = 255) final int brightness) {
95+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
96+
&& !Settings.System.canWrite(Utils.getApp())) {
97+
Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS);
98+
intent.setData(Uri.parse("package:" + Utils.getApp().getPackageName()));
99+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
100+
Utils.getApp().startActivity(intent);
101+
return false;
102+
}
95103
ContentResolver resolver = Utils.getApp().getContentResolver();
96-
Settings.System.putInt(resolver, Settings.System.SCREEN_BRIGHTNESS, brightness);
104+
boolean b = Settings.System.putInt(resolver, Settings.System.SCREEN_BRIGHTNESS, brightness);
97105
resolver.notifyChange(Settings.System.getUriFor("screen_brightness"), null);
106+
return b;
98107
}
99108

100109
/**

utilcode/README-CN.md

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

33
Gradle:
44
```groovy
5-
compile 'com.blankj:utilcode:1.12.5'
5+
compile 'com.blankj:utilcode:1.12.6'
66
```
77

88

utilcode/README.md

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

33
Gradle:
44
```groovy
5-
compile 'com.blankj:utilcode:1.12.5'
5+
compile 'com.blankj:utilcode:1.12.6'
66
```
77

88

utilcode/src/main/java/com/blankj/utilcode/constant/MemoryConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* author: Blankj
1111
* blog : http://blankj.com
1212
* time : 2017/03/13
13-
* desc : The constants of memory
13+
* desc : The constants of memory.
1414
* </pre>
1515
*/
1616
public final class MemoryConstants {

utilcode/src/main/java/com/blankj/utilcode/constant/PermissionConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* author: Blankj
1515
* blog : http://blankj.com
1616
* time : 2017/12/29
17-
* desc : The constants of permission
17+
* desc : The constants of permission.
1818
* </pre>
1919
*/
2020
@SuppressLint("InlinedApi")

0 commit comments

Comments
 (0)