Compare commits
15 Commits
appbase-v1
...
appbase-v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b882d14ab | ||
|
|
1074a47ae7 | ||
|
|
721a4034dd | ||
|
|
07959be091 | ||
|
|
3e1531d356 | ||
|
|
4a0b58feda | ||
|
|
28ae2631a6 | ||
|
|
87d23829ae | ||
|
|
07bfd44c65 | ||
|
|
32a8c0dfa1 | ||
|
|
0a8707b02b | ||
|
|
3ef885e8c1 | ||
|
|
d9b99ee371 | ||
|
|
6f7414b576 | ||
|
|
2f6e297bab |
@@ -30,7 +30,7 @@ android {
|
|||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.1"
|
versionName "15.2"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Fri Mar 28 15:50:14 HKT 2025
|
#Sat Mar 29 11:27:54 HKT 2025
|
||||||
stageCount=3
|
stageCount=3
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.1
|
baseVersion=15.2
|
||||||
publishVersion=15.1.2
|
publishVersion=15.2.2
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.1.3
|
baseBetaVersion=15.2.3
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import cc.winboll.studio.libappbase.sos.SOS;
|
|||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
||||||
|
|
||||||
public class MainActivity extends WinBollActivityBase implements IWinBollActivity {
|
public class MainActivity extends WinBollActivityBase implements IWinBollActivity {
|
||||||
|
|
||||||
@@ -68,12 +69,6 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
|
||||||
return true;
|
|
||||||
} else if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
|
|
||||||
moveTaskToBack(true);
|
|
||||||
}
|
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
@@ -91,6 +86,7 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
public void onSwitchDebugMode(View view) {
|
public void onSwitchDebugMode(View view) {
|
||||||
boolean isDebuging = ((CheckBox)view).isChecked();
|
boolean isDebuging = ((CheckBox)view).isChecked();
|
||||||
GlobalApplication.setIsDebuging(isDebuging);
|
GlobalApplication.setIsDebuging(isDebuging);
|
||||||
|
GlobalApplication.saveDebugStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPreviewGlobalCrashActivity(View view) {
|
public void onPreviewGlobalCrashActivity(View view) {
|
||||||
@@ -142,6 +138,8 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
startService(intent);
|
startService(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onStopTestDemoService(View view) {
|
public void onStopTestDemoService(View view) {
|
||||||
Intent intent = new Intent(this, TestDemoService.class);
|
Intent intent = new Intent(this, TestDemoService.class);
|
||||||
|
|||||||
@@ -9,7 +9,11 @@ import android.app.Activity;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import cc.winboll.studio.appbase.App;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||||
|
|
||||||
@@ -41,8 +45,34 @@ public class WinBollActivityBase extends AppCompatActivity implements IWinBollAc
|
|||||||
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
|
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
|
||||||
super.onPostCreate(savedInstanceState, persistentState);
|
super.onPostCreate(savedInstanceState, persistentState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||||
|
return true;
|
||||||
|
} else if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
|
||||||
|
//moveTaskToBack(true);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void exit() {
|
||||||
|
YesNoAlertDialog.show(this, "Exit " + getString(R.string.app_name), "Close all activity and exit?", new YesNoAlertDialog.OnDialogResultListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onYes() {
|
||||||
|
App.getWinBollActivityManager().finishAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNo() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ public class New2Activity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||||
return true;
|
return true;
|
||||||
} else if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
|
|
||||||
moveTaskToBack(true);
|
|
||||||
}
|
}
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ public class NewActivity extends WinBollActivityBase implements IWinBollActivity
|
|||||||
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||||
return true;
|
return true;
|
||||||
} else if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
|
|
||||||
moveTaskToBack(true);
|
|
||||||
}
|
}
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Fri Mar 28 15:50:14 HKT 2025
|
#Sat Mar 29 11:27:54 HKT 2025
|
||||||
stageCount=3
|
stageCount=3
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.1
|
baseVersion=15.2
|
||||||
publishVersion=15.1.2
|
publishVersion=15.2.2
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.1.3
|
baseBetaVersion=15.2.3
|
||||||
|
|||||||
@@ -25,9 +25,12 @@ public class GlobalApplication extends Application {
|
|||||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||||
|
|
||||||
public static void setIsDebuging(boolean isDebuging) {
|
public static void setIsDebuging(boolean isDebuging) {
|
||||||
|
GlobalApplication.isDebuging = isDebuging;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveDebugStatus() {
|
||||||
if (_GlobalApplication != null) {
|
if (_GlobalApplication != null) {
|
||||||
GlobalApplication.isDebuging = isDebuging;
|
APPBaseModel.saveBeanToFile(getAPPBaseModelFilePath(), new APPBaseModel(GlobalApplication.isDebuging));
|
||||||
APPBaseModel.saveBeanToFile(getAPPBaseModelFilePath(), new APPBaseModel(isDebuging));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +72,7 @@ public class GlobalApplication extends Application {
|
|||||||
APPBaseModel appBaseModel = APPBaseModel.loadBeanFromFile(getAPPBaseModelFilePath(), APPBaseModel.class);
|
APPBaseModel appBaseModel = APPBaseModel.loadBeanFromFile(getAPPBaseModelFilePath(), APPBaseModel.class);
|
||||||
if (appBaseModel == null) {
|
if (appBaseModel == null) {
|
||||||
setIsDebuging(false);
|
setIsDebuging(false);
|
||||||
|
saveDebugStatus();
|
||||||
} else {
|
} else {
|
||||||
setIsDebuging(appBaseModel.isDebuging());
|
setIsDebuging(appBaseModel.isDebuging());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,17 @@ public class LogUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean isLoggable(String tag, LOG_LEVEL logLevel) {
|
static boolean isLoggable(String tag, LOG_LEVEL logLevel) {
|
||||||
return _IsInited && mapTAGList.get(tag) && isInTheLevel(logLevel);
|
if (!_IsInited) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (mapTAGList.get(tag) == null
|
||||||
|
|| !mapTAGList.get(tag)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isInTheLevel(logLevel)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean isInTheLevel(LOG_LEVEL logLevel) {
|
static boolean isInTheLevel(LOG_LEVEL logLevel) {
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package cc.winboll.studio.libappbase.dialogs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/28 17:40:47
|
||||||
|
* @Date 2024/08/12 14:46:25
|
||||||
|
* @Describe 询问用户确定与否的选择框
|
||||||
|
*/
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
|
||||||
|
public class YesNoAlertDialog {
|
||||||
|
|
||||||
|
public static final String TAG = "YesNoAlertDialog";
|
||||||
|
|
||||||
|
public static void show(Context context, String szTitle, String szMessage, final OnDialogResultListener listener) {
|
||||||
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
|
context);
|
||||||
|
|
||||||
|
// set title
|
||||||
|
alertDialogBuilder.setTitle(szTitle);
|
||||||
|
|
||||||
|
// set dialog message
|
||||||
|
alertDialogBuilder
|
||||||
|
.setMessage(szMessage)
|
||||||
|
.setCancelable(true)
|
||||||
|
.setOnCancelListener(new DialogInterface.OnCancelListener(){
|
||||||
|
@Override
|
||||||
|
public void onCancel(DialogInterface dialog) {
|
||||||
|
listener.onNo();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setPositiveButton("YES", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
// if this button is clicked, close
|
||||||
|
// current activity
|
||||||
|
listener.onYes();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("NO", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
// if this button is clicked, just close
|
||||||
|
// the dialog box and do nothing
|
||||||
|
dialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// create alert dialog
|
||||||
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
|
// show it
|
||||||
|
alertDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnDialogResultListener {
|
||||||
|
abstract void onYes();
|
||||||
|
abstract void onNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,7 +47,7 @@ public class MyActivityLifecycleCallbacks implements Application.ActivityLifecyc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showActivityeInfo() {
|
public void showActivityeInfo() {
|
||||||
ToastUtils.show("ActivityeInfo : " + mInfo);
|
//ToastUtils.show("ActivityeInfo : " + mInfo);
|
||||||
LogUtils.d(TAG, "ActivityeInfo : " + mInfo);
|
LogUtils.d(TAG, "ActivityeInfo : " + mInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class WinBollActivityManager {
|
|||||||
resumeActivity(context, tag);
|
resumeActivity(context, tag);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ToastUtils.show("startWinBollActivity(Context context, Class<T> clazz)");
|
//ToastUtils.show("startWinBollActivity(Context context, Class<T> clazz)");
|
||||||
|
|
||||||
// 新建一个任务窗口
|
// 新建一个任务窗口
|
||||||
Intent intent = new Intent(context, clazz);
|
Intent intent = new Intent(context, clazz);
|
||||||
|
|||||||
Reference in New Issue
Block a user