Skip to content

Commit

Permalink
v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
cjyyx committed Mar 20, 2024
1 parent 89b8e09 commit 0f3ceb7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ android {

defaultConfig {
applicationId "com.cjyyxn.screenfilter"
minSdk 30
minSdk 29
targetSdk 33
versionCode 6
versionName "1.5"
versionCode 7
versionName "1.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 6,
"versionName": "1.5",
"versionCode": 7,
"versionName": "1.6",
"outputFile": "app-release.apk"
}
],
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/cjyyxn/screenfilter/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
Expand All @@ -20,9 +21,11 @@ public class AppConfig {
* 手机屏幕的最大亮度,单位为 nit
*/
public static final float MAX_SCREEN_LIGHT = 500f;

/**
* Settings.System.SCREEN_BRIGHTNESS 相关的值
* 安卓开发者文档中说取值是 0-255
* 安卓系统取值是 0-255
* MIUI取值是 0-128
*/
public static final int SETTING_SCREEN_BRIGHTNESS = getSettingScreenBrightness();

Expand All @@ -42,8 +45,10 @@ private static String getSystemProperty(String prop) {
private static int getSettingScreenBrightness() {
String miui = getSystemProperty("ro.miui.ui.version.name");
if (miui != null && !miui.isEmpty()) {
Log.d("ccjy", "检测到 MIUI 系统");
return 128;
}
Log.d("ccjy", "检测到非 MIUI 系统");
return 255;
}

Expand Down

0 comments on commit 0f3ceb7

Please sign in to comment.