chore(winboll): 改造winboll模块适配API 26-30并兼容Java 7
- 调整minSdkVersion从23到26,符合API 26-30适配范围要求 - 修复PatternLockActivity.java中3处lambda表达式, 改为Java 7兼容的匿名内部类形式 - 保持Gradle插件7.2.1、compileSdkVersion 30、 targetSdkVersion 30及Java 11编译配置不变 Modified files: - winboll/build.gradle - winboll/build.properties - winboll/src/main/java/cc/winboll/studio/winboll/activities/PatternLockActivity.java
This commit is contained in:
@@ -24,7 +24,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.winboll"
|
applicationId "cc.winboll.studio.winboll"
|
||||||
minSdkVersion 23
|
minSdkVersion 26
|
||||||
// 适配MIUI12
|
// 适配MIUI12
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed May 06 11:22:14 CST 2026
|
#Wed May 06 13:39:52 CST 2026
|
||||||
stageCount=27
|
stageCount=27
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.11
|
baseVersion=15.11
|
||||||
publishVersion=15.11.26
|
publishVersion=15.11.26
|
||||||
buildCount=20
|
buildCount=22
|
||||||
baseBetaVersion=15.11.27
|
baseBetaVersion=15.11.27
|
||||||
|
|||||||
@@ -65,7 +65,12 @@ public class PatternLockActivity extends BaseWinBoLLActivity {
|
|||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
getSupportActionBar().setSubtitle(TAG);
|
getSupportActionBar().setSubtitle(TAG);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
toolbar.setNavigationOnClickListener(v -> finish());
|
toolbar.setNavigationOnClickListener(new android.view.View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(android.view.View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
mContainer = findViewById(R.id.container);
|
mContainer = findViewById(R.id.container);
|
||||||
mPatternView = new PatternView(this);
|
mPatternView = new PatternView(this);
|
||||||
@@ -111,12 +116,15 @@ public class PatternLockActivity extends BaseWinBoLLActivity {
|
|||||||
private void showErrorState() {
|
private void showErrorState() {
|
||||||
mIsInErrorState = true;
|
mIsInErrorState = true;
|
||||||
invalidatePattern();
|
invalidatePattern();
|
||||||
mHandler.postDelayed(() -> {
|
mHandler.postDelayed(new Runnable() {
|
||||||
mIsInErrorState = false;
|
@Override
|
||||||
SharedPreferences prefs = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
|
public void run() {
|
||||||
prefs.edit().putBoolean(KEY_ERROR_STATE, false).apply();
|
mIsInErrorState = false;
|
||||||
invalidatePattern();
|
SharedPreferences prefs = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
|
||||||
if (mPatternView != null) mPatternView.invalidate();
|
prefs.edit().putBoolean(KEY_ERROR_STATE, false).apply();
|
||||||
|
invalidatePattern();
|
||||||
|
if (mPatternView != null) mPatternView.invalidate();
|
||||||
|
}
|
||||||
}, PATTERN_ERROR_DURATION);
|
}, PATTERN_ERROR_DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +146,12 @@ public class PatternLockActivity extends BaseWinBoLLActivity {
|
|||||||
android.app.AlertDialog alertDialog = new android.app.AlertDialog.Builder(this)
|
android.app.AlertDialog alertDialog = new android.app.AlertDialog.Builder(this)
|
||||||
.setTitle("设置成功")
|
.setTitle("设置成功")
|
||||||
.setMessage("图案密码已设置成功")
|
.setMessage("图案密码已设置成功")
|
||||||
.setPositiveButton("确定", (dialog, which) -> finish())
|
.setPositiveButton("确定", new android.content.DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(android.content.DialogInterface dialog, int which) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.create();
|
.create();
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
|
|||||||
Reference in New Issue
Block a user