Compare commits
54 Commits
apputils-v
...
apputils-v
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d4ea79b950 | ||
![]() |
06a40a4298 | ||
![]() |
35835d746e | ||
![]() |
5f3d03ba7d | ||
![]() |
1d372ff9ae | ||
![]() |
4a1e398755 | ||
![]() |
107be6d6ad | ||
![]() |
19db567a7d | ||
![]() |
b14add854e | ||
![]() |
104d9fa283 | ||
![]() |
dd041e5d78 | ||
![]() |
2f019ae176 | ||
![]() |
b5b4fbd3f5 | ||
![]() |
548dcf74ed | ||
![]() |
547bf894c6 | ||
![]() |
09e6429726 | ||
![]() |
3ad9bb262e | ||
![]() |
15992da22f | ||
![]() |
7fb4e665f9 | ||
![]() |
6a82889926 | ||
![]() |
7272cc4e5b | ||
![]() |
1f7d112a8a | ||
![]() |
936e214015 | ||
![]() |
46e95d1b1f | ||
![]() |
15173f7af3 | ||
![]() |
6f3b6c40af | ||
![]() |
42ffba69e5 | ||
![]() |
f021e8a1a3 | ||
![]() |
02ce7dedb0 | ||
![]() |
8e290cd5e6 | ||
![]() |
37f2aa5f1b | ||
![]() |
10cc69940b | ||
![]() |
bfdff9ff2f | ||
![]() |
12c6129a61 | ||
![]() |
ea10d1b540 | ||
![]() |
81f6ff592e | ||
![]() |
e6f22e9212 | ||
![]() |
8ce8f383fa | ||
![]() |
35d32b384f | ||
![]() |
85e86ddf05 | ||
![]() |
99bf804625 | ||
![]() |
261259e61e | ||
![]() |
9aaf3433bd | ||
![]() |
b739510951 | ||
![]() |
903359d9a2 | ||
![]() |
69e7e72ed8 | ||
![]() |
a96ba362b4 | ||
![]() |
6447bcf924 | ||
![]() |
18ed325731 | ||
![]() |
16e3d10b63 | ||
![]() |
8b0e8b00ae | ||
![]() |
7f61ff1470 | ||
![]() |
c4e0c23a0c | ||
![]() |
c7d26bbc3d |
@@ -29,7 +29,7 @@ android {
|
||||
// versionName 更新后需要手动设置
|
||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "9.2"
|
||||
versionName "9.3"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@@ -51,7 +51,5 @@ android {
|
||||
dependencies {
|
||||
api project(':libapputils')
|
||||
|
||||
api 'cc.winboll.studio:libappbase:1.1.0'
|
||||
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Jan 22 21:22:05 HKT 2025
|
||||
stageCount=5
|
||||
#Wed Feb 12 19:50:03 HKT 2025
|
||||
stageCount=3
|
||||
libraryProject=libapputils
|
||||
baseVersion=9.2
|
||||
publishVersion=9.2.4
|
||||
baseVersion=9.3
|
||||
publishVersion=9.3.2
|
||||
buildCount=0
|
||||
baseBetaVersion=9.2.5
|
||||
baseBetaVersion=9.3.3
|
||||
|
@@ -8,7 +8,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_winboll"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||
android:theme="@style/MyAppTheme"
|
||||
android:supportsRtl="true">
|
||||
|
||||
<activity
|
||||
@@ -27,10 +27,8 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".TestWinBollActivity"/>
|
||||
|
||||
<activity android:name=".TestStringToQrCodeViewActivity"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@@ -6,11 +6,13 @@ package cc.winboll.studio.apputils;
|
||||
* @Describe 全局应用类
|
||||
*/
|
||||
import android.app.Application;
|
||||
import android.view.Gravity;
|
||||
import cc.winboll.studio.GlobalApplication;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.hjq.toast.style.WhiteToastStyle;
|
||||
import cc.winboll.studio.libapputils.app.WinBollUtils;
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.app.MyActivityLifecycleCallbacks;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.bean.DebugBean;
|
||||
|
||||
public class App extends GlobalApplication {
|
||||
|
||||
@@ -18,12 +20,68 @@ public class App extends GlobalApplication {
|
||||
|
||||
public static final String _ACTION_DEBUGVIEW = App.class.getName() + "_ACTION_DEBUGVIEW";
|
||||
|
||||
//static volatile WinBollApplication _WinBollApplication = null;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
|
||||
// 标记当前应用是否处于调试状态
|
||||
static volatile boolean isDebug = false;
|
||||
|
||||
public synchronized static void setIsDebug(boolean isDebug) {
|
||||
App.isDebug = isDebug;
|
||||
}
|
||||
|
||||
public static boolean isDebug() {
|
||||
return isDebug;
|
||||
}
|
||||
|
||||
MyActivityLifecycleCallbacks getMyActivityLifecycleCallbacks() {
|
||||
return mMyActivityLifecycleCallbacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context getApplicationContext() {
|
||||
return super.getApplicationContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplication() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 初始化 WinBoll 框架
|
||||
WinBollUtils.getInstance(this).init(this);
|
||||
|
||||
}
|
||||
// 应用环境初始化, 基本调试环境
|
||||
//
|
||||
// 初始化日志模块
|
||||
//LogUtils.init(this);
|
||||
|
||||
try {
|
||||
// 初始化 Toast 框架
|
||||
// ToastUtils.init(this);
|
||||
// // 设置 Toast 布局样式
|
||||
// //ToastUtils.setView(R.layout.view_toast);
|
||||
// ToastUtils.setStyle(new WhiteToastStyle());
|
||||
// ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
// 设置应用调试标志
|
||||
DebugBean debugBean = DebugBean.loadBean(this, DebugBean.class);
|
||||
if (debugBean == null) {
|
||||
//ToastUtils.show("debugBean == null");
|
||||
setIsDebug(false);
|
||||
} else {
|
||||
//ToastUtils.show("saveDebugStatus(" + String.valueOf(debugBean.isDebuging()) + ")");
|
||||
setIsDebug(debugBean.isDebuging());
|
||||
}
|
||||
// 应用窗口管理模块参数设置
|
||||
//
|
||||
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks();
|
||||
registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
// 设置默认 WinBoll 应用 UI 类型
|
||||
WinBollActivityManager.getInstance(this).setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||
//ToastUtils.show("WinBollUI_TYPE " + getWinBollUI_TYPE());
|
||||
} catch (Exception e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,30 +1,81 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.apputils.R;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||
import cc.winboll.studio.libapputils.activities.QRCodeDecodeActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||
import cc.winboll.studio.libapputils.view.AboutView;
|
||||
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
final public class MainActivity extends WinBollActivity {
|
||||
final public class MainActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "MainActivity";
|
||||
|
||||
public static final int REQUEST_QRCODEDECODE_ACTIVITY = 0;
|
||||
|
||||
Toolbar mToolbar;
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
public AppCompatActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
String szBranchName = "apputils";
|
||||
|
||||
APPInfo appInfo = AboutActivityFactory.buildDefaultAPPInfo();
|
||||
appInfo.setAppName("APPUtils");
|
||||
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription("APPUtils Description");
|
||||
appInfo.setAppGitName("APP");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(szBranchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");
|
||||
appInfo.setAppAPKName("APPUtils");
|
||||
appInfo.setAppAPKFolderName("APPUtils");
|
||||
return appInfo;
|
||||
//return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitymainToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,8 +84,19 @@ final public class MainActivity extends WinBollActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
//Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||
//setActionBar(toolbar);
|
||||
// 初始化工具栏
|
||||
mToolbar = findViewById(R.id.activitymainToolbar1);
|
||||
setSupportActionBar(mToolbar);
|
||||
if (isEnableDisplayHomeAsUp()) {
|
||||
// 显示后退按钮
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
getSupportActionBar().setSubtitle(getTag());
|
||||
|
||||
checkResolveActivity();
|
||||
archiveInstance();
|
||||
|
||||
|
||||
|
||||
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
||||
//if (prosessIntents(getIntent())) return;
|
||||
@@ -46,6 +108,79 @@ final public class MainActivity extends WinBollActivity {
|
||||
// LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG));
|
||||
}
|
||||
|
||||
boolean checkResolveActivity() {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
//Intent intent = new Intent("your_action_here");
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
if (resolveInfoList.size() > 0) {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里有定义
|
||||
if (intent.getAction() != null) {
|
||||
if (intent.getAction().equals(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW)) {
|
||||
App.setIsDebug(true);
|
||||
//ToastUtils.show!("WinBollApplication.setIsDebug(true) by action : " + intent.getAction());
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里没有定义
|
||||
//ToastUtils.show("false : " + intent.getAction());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// action在清单文件中没有声明
|
||||
ToastUtils.show("false");
|
||||
return false;
|
||||
}
|
||||
|
||||
void archiveInstance() {
|
||||
Intent intent = getIntent();
|
||||
StringBuilder sb = new StringBuilder("\n### Archive Instance ###\n");
|
||||
|
||||
if (intent != null) {
|
||||
ComponentName componentName = intent.getComponent();
|
||||
if (componentName != null) {
|
||||
String packageName = componentName.getPackageName();
|
||||
//Log.d("AppStarter", "启动本应用的应用包名: " + packageName);
|
||||
sb.append("启动本应用的应用包名: \n" + packageName);
|
||||
}
|
||||
|
||||
sb.append("\nImplicit Intent Tracker :\n接收到的 Intent 动作: \n" + intent.getAction());
|
||||
Set<String> categories = intent.getCategories();
|
||||
if (categories != null) {
|
||||
for (String category : categories) {
|
||||
sb.append("\n接收到的 Intent 类别 :\n" + category);
|
||||
}
|
||||
}
|
||||
Uri data = intent.getData();
|
||||
if (data != null) {
|
||||
sb.append("\n接收到的 Intent 数据 :\n" + data.toString());
|
||||
}
|
||||
} else {
|
||||
sb.append("Intent is null.");
|
||||
}
|
||||
sb.append("\n\n");
|
||||
LogUtils.d(TAG, sb.toString());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
// 缓存当前 activity
|
||||
WinBollActivityManager.getInstance(this).add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
WinBollActivityManager.getInstance(this).registeRemove(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
public void onTestLogClick(View view) {
|
||||
LogUtils.d(TAG, "onTestLogClick");
|
||||
Toast.makeText(getApplication(), "onTestLogClick", Toast.LENGTH_SHORT).show();
|
||||
@@ -61,32 +196,6 @@ final public class MainActivity extends WinBollActivity {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
// setSubTitle("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// exit();
|
||||
}
|
||||
|
||||
// void exit() {
|
||||
// YesNoAlertDialog.OnDialogResultListener listener = new YesNoAlertDialog.OnDialogResultListener(){
|
||||
//
|
||||
// @Override
|
||||
// public void onYes() {
|
||||
// WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNo() {
|
||||
// }
|
||||
// };
|
||||
// YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
||||
// }
|
||||
|
||||
//
|
||||
// 处理传入的 Intent 数据
|
||||
//
|
||||
@@ -130,61 +239,86 @@ final public class MainActivity extends WinBollActivity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitymainToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
//ToastUtils.show("onCreateOptionsMenu");
|
||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||
if (isAddWinBollToolBar()) {
|
||||
//ToastUtils.show("mIWinBoll.isAddWinBollToolBar()");
|
||||
getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
|
||||
}
|
||||
if (App.isDebug()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_studio_debug, menu);
|
||||
}
|
||||
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.item_testwinboll) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestWinBollActivity.class);
|
||||
if (item.getItemId() == R.id.item_exit) {
|
||||
exit();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_about) {
|
||||
AboutActivityFactory.showAboutActivity(this, getAppInfo());
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
||||
} else if (item.getItemId() == R.id.item_testqrcodedecodeactivity) {
|
||||
Intent intent = new Intent(this, QRCodeDecodeActivity.class);
|
||||
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
||||
} else if(item.getItemId() == R.id.item_about) {
|
||||
openAboutActivity();
|
||||
} else if (item.getItemId() == R.id.item_testcrashreport) {
|
||||
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
|
||||
getString(i);
|
||||
}
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_log) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_exitdebug) {
|
||||
AboutView.setApp2NormalMode(this);
|
||||
return true;
|
||||
} else if (item.getItemId() == android.R.id.home) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
void openAboutActivity() {
|
||||
Intent intent = new Intent(this, AboutActivity.class);
|
||||
APPInfo appInfo = new APPInfo();
|
||||
appInfo.setAppName("APPUtils");
|
||||
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription("APPUtils Description");
|
||||
appInfo.setAppGitName("APP");
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");
|
||||
appInfo.setAppAPKName("APPUtils");
|
||||
appInfo.setAppAPKFolderName("APPUtils");
|
||||
intent.putExtra(AboutActivity.EXTRA_APPINFO, appInfo);
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AboutActivity.class);
|
||||
|
||||
void about() {
|
||||
// Intent intent = new Intent(this, AboutActivity.class);
|
||||
// intent.putExtra(AboutActivity.EXTRA_APPINFO, AboutActivityFactory.buildAPPBranchInfo(this));
|
||||
// WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AboutActivity.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void exit() {
|
||||
YesNoAlertDialog.OnDialogResultListener listener = new YesNoAlertDialog.OnDialogResultListener(){
|
||||
|
||||
@Override
|
||||
public void onYes() {
|
||||
WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNo() {
|
||||
}
|
||||
};
|
||||
YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (WinBollActivityManager.getInstance(getApplicationContext()).isFirstIWinBollActivity(this)) {
|
||||
exit();
|
||||
} else {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
public void onTestAboutActivity(View view) {
|
||||
//ToastUtils.show("onTestAboutActivity");
|
||||
openAboutActivity();
|
||||
about();
|
||||
}
|
||||
|
||||
public void onTestJavascriptHtmlActivity(View view) {
|
||||
@@ -193,18 +327,20 @@ final public class MainActivity extends WinBollActivity {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AssetsHtmlActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
||||
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
||||
ToastUtils.show(text);
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*@Override
|
||||
protected void onActivithyResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
||||
if (data != null) {
|
||||
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
||||
ToastUtils.show(text);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
//ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
||||
super.prosessActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@@ -1,19 +1,31 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.view.StringToQrCodeView;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/17 19:50:46
|
||||
*/
|
||||
public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
||||
|
||||
public class TestStringToQrCodeViewActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "TestStringToQrCodeViewActivity";
|
||||
|
||||
|
||||
StringToQrCodeView mStringToQrCodeView;
|
||||
|
||||
@Override
|
||||
public AppCompatActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
@@ -21,17 +33,17 @@ public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityteststringtoqrcodeviewToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,10 +53,4 @@ public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
||||
setContentView(R.layout.activity_teststringtoqrcodeview);
|
||||
mStringToQrCodeView = findViewById(R.id.activityteststringtoqrcodeviewStringToQrCodeView1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
}
|
||||
|
@@ -1,52 +0,0 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/13 15:09:46
|
||||
*/
|
||||
public class TestWinBollActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "TestWinBollActivity";
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitytestwinbollToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_testwinboll);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -60,12 +60,11 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right">
|
||||
|
||||
<Button
|
||||
<cc.winboll.studio.libapputils.view.AboutBranchButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAllCaps="false"
|
||||
android:text="Test AboutActivity"
|
||||
android:onClick="onTestAboutActivity"/>
|
||||
android:text="About"
|
||||
android:textAllCaps="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -4,7 +4,4 @@
|
||||
<color name="colorPrimary">#FF196ABC</color>
|
||||
<color name="colorPrimaryDark">#FF002B57</color>
|
||||
<color name="colorAccent">#FF80BFFF</color>
|
||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||
<color name="colorToastShadow">#FF000000</color>
|
||||
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||
</resources>
|
||||
|
@@ -1,3 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="MyAppTheme" parent="APPBaseTheme">
|
||||
</style>
|
||||
|
||||
<style name="GlobalCrashActivityTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
|
||||
<item name="colorTittle">@color/colorAccent</item>
|
||||
<item name="colorTittleBackgound">@color/colorPrimary</item>
|
||||
<item name="colorText">@color/colorAccent</item>
|
||||
<item name="colorTextBackgound">@color/colorPrimaryDark</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
@@ -34,11 +34,11 @@ dependencies {
|
||||
api 'org.jsoup:jsoup:1.13.1'
|
||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
|
||||
api 'androidx.appcompat:appcompat:1.0.0'
|
||||
api 'androidx.fragment:fragment:1.0.0'
|
||||
api 'com.google.android.material:material:1.0.0'
|
||||
api 'androidx.appcompat:appcompat:1.3.1'
|
||||
api 'androidx.fragment:fragment:1.1.0'
|
||||
api 'com.google.android.material:material:1.1.0'
|
||||
|
||||
api 'cc.winboll.studio:libappbase:1.1.0'
|
||||
api 'cc.winboll.studio:libappbase:1.4.1'
|
||||
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Wed Jan 22 21:22:05 HKT 2025
|
||||
stageCount=5
|
||||
#Wed Feb 12 19:50:03 HKT 2025
|
||||
stageCount=3
|
||||
libraryProject=libapputils
|
||||
baseVersion=9.2
|
||||
publishVersion=9.2.4
|
||||
baseVersion=9.3
|
||||
publishVersion=9.3.2
|
||||
buildCount=0
|
||||
baseBetaVersion=9.2.5
|
||||
baseBetaVersion=9.3.3
|
||||
|
@@ -9,33 +9,56 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.view.AboutView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
final public class AboutActivity extends WinBollActivity {
|
||||
final public class AboutActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "AboutActivity";
|
||||
|
||||
public static final String EXTRA_APPINFO = "EXTRA_APPINFO";
|
||||
|
||||
|
||||
APPInfo mAPPInfo;
|
||||
|
||||
@Override
|
||||
public AppCompatActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityaboutToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -47,28 +70,12 @@ final public class AboutActivity extends WinBollActivity {
|
||||
if (mAPPInfo == null) {
|
||||
mAPPInfo = new APPInfo();
|
||||
}
|
||||
|
||||
|
||||
AboutView aboutView = new AboutView(this, mAPPInfo);
|
||||
LinearLayout llMain = findViewById(R.id.activityaboutLinearLayout1);
|
||||
llMain.addView(aboutView);
|
||||
|
||||
ToastUtils.show(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityaboutToolbar1);
|
||||
//ToastUtils.show(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,7 +84,6 @@ final public class AboutActivity extends WinBollActivity {
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.item_help) {
|
||||
@@ -85,6 +91,4 @@ final public class AboutActivity extends WinBollActivity {
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -11,22 +11,22 @@ import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.view.SimpleWebView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import android.os.PersistableBundle;
|
||||
|
||||
public class AssetsHtmlActivity extends WinBollActivity {
|
||||
public class AssetsHtmlActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "AssetsHtmlActivity";
|
||||
|
||||
|
||||
public static final String EXTRA_HTMLFILENAME = "EXTRA_HTMLFILENAME";
|
||||
|
||||
|
||||
String mszHelpIndexFilePath = "";
|
||||
Uri mszHelpIndexFileUri;
|
||||
Context mContext;
|
||||
@@ -34,24 +34,34 @@ public class AssetsHtmlActivity extends WinBollActivity {
|
||||
// Assets 文件夹里的 Html 文件的名称
|
||||
String mszHtmlFileName;
|
||||
|
||||
@Override
|
||||
public AppCompatActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityassetshtmlToolbar1);
|
||||
}
|
||||
|
||||
@@ -81,7 +91,7 @@ public class AssetsHtmlActivity extends WinBollActivity {
|
||||
if (szTemp != null && !szTemp.trim().equals("")) {
|
||||
mszHtmlFileName = szTemp.trim();
|
||||
}
|
||||
ToastUtils.show(mszHtmlFileName);
|
||||
//ToastUtils.show(mszHtmlFileName);
|
||||
}
|
||||
|
||||
// 与其他应用分享 html 帮助
|
||||
@@ -107,13 +117,6 @@ public class AssetsHtmlActivity extends WinBollActivity {
|
||||
// myWebView.loadUrl(mszHelpIndexFileUri.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
|
||||
super.onPostCreate(savedInstanceState, persistentState);
|
||||
setSubTitle(mszHtmlFileName);
|
||||
//setSubTitle(TAG);
|
||||
}
|
||||
|
||||
//
|
||||
void initWebViewFromAssets(String szHtmlFileName) {
|
||||
try {
|
||||
|
@@ -9,25 +9,38 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.journeyapps.barcodescanner.BarcodeCallback;
|
||||
import com.journeyapps.barcodescanner.BarcodeResult;
|
||||
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||
import java.util.List;
|
||||
|
||||
public class QRCodeDecodeActivity extends WinBollActivity {
|
||||
public class QRCodeDecodeActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "QRCodeDecodeActivity";
|
||||
public static final String EXTRA_RESULT = "EXTRA_RESULT";
|
||||
|
||||
public static final String EXTRA_RESULT = "EXTRA_RESULT";
|
||||
private static final int REQUEST_CAMERA_PERMISSION = 1;
|
||||
|
||||
TextView resultTextView;
|
||||
DecoratedBarcodeView barcodeView;
|
||||
|
||||
@Override
|
||||
public AppCompatActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
@@ -35,18 +48,18 @@ public class QRCodeDecodeActivity extends WinBollActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityqrcodedecodeToolbar1);
|
||||
}
|
||||
|
||||
@@ -66,7 +79,7 @@ public class QRCodeDecodeActivity extends WinBollActivity {
|
||||
startScanning();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void startScanning() {
|
||||
|
@@ -1,240 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.ads;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/12/09 15:37:35
|
||||
* @Describe WinBoll 应用推广视图
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.RelativeLayout;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
public class ADsView extends RelativeLayout {
|
||||
|
||||
public static final String TAG = "ADsView";
|
||||
|
||||
public volatile boolean mIsHandling;
|
||||
public volatile boolean mIsAddNewLog;
|
||||
|
||||
Context mContext;
|
||||
WebView mWebView;
|
||||
//ScrollView mScrollView;
|
||||
//TextView mTextView;
|
||||
//CheckBox mSelectableCheckBox;
|
||||
//LogViewThread mLogViewThread;
|
||||
//LogViewHandler mLogViewHandler;
|
||||
//Spinner mLogLevelSpinner;
|
||||
//ArrayAdapter<CharSequence> mLogLevelSpinnerAdapter;
|
||||
|
||||
public ADsView(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public ADsView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public ADsView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public ADsView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
// public void start() {
|
||||
// mLogViewThread = new LogViewThread(LogView.this);
|
||||
// mLogViewThread.start();
|
||||
// // 显示日志
|
||||
// showAndScrollLogView();
|
||||
// }
|
||||
//
|
||||
// public void scrollLogUp() {
|
||||
// mScrollView.post(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
|
||||
// // 日志显示结束
|
||||
// mLogViewHandler.setIsHandling(false);
|
||||
// // 检查是否添加了新日志
|
||||
// if (mLogViewHandler.isAddNewLog()) {
|
||||
// // 有新日志添加,先更改新日志标志
|
||||
// mLogViewHandler.setIsAddNewLog(false);
|
||||
// // 再次发送显示日志的显示
|
||||
// Message message = mLogViewHandler.obtainMessage(LogViewHandler.MSG_LOGVIEW_UPDATE);
|
||||
// mLogViewHandler.sendMessage(message);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
void initView(Context context) {
|
||||
mContext = context;
|
||||
|
||||
// mLogViewHandler = new LogViewHandler();
|
||||
// 加载视图布局
|
||||
View viewMain = inflate(mContext, cc.winboll.studio.libapputils.R.layout.view_ads, null);
|
||||
mWebView = viewMain.findViewById(cc.winboll.studio.libapputils.R.id.viewadsWebView1);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
view.loadUrl(url);
|
||||
ToastUtils.show(url);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// // 初始化日志子控件视图
|
||||
// //
|
||||
// mScrollView = findViewById(cc.winboll.studio.libapputils.R.id.viewlogScrollViewLog);
|
||||
// mTextView = findViewById(cc.winboll.studio.libapputils.R.id.viewlogTextViewLog);
|
||||
// // 获取Log Level spinner实例
|
||||
// mLogLevelSpinner = findViewById(cc.winboll.studio.libapputils.R.id.viewlogSpinner1);
|
||||
//
|
||||
// (findViewById(cc.winboll.studio.libapputils.R.id.viewlogButtonClean)).setOnClickListener(new View.OnClickListener(){
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// LogUtils.cleanLog();
|
||||
// LogUtils.d(TAG, "Log is cleaned.");
|
||||
// }
|
||||
// });
|
||||
// (findViewById(cc.winboll.studio.libapputils.R.id.viewlogButtonCopy)).setOnClickListener(new View.OnClickListener(){
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
//
|
||||
// ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
// cm.setPrimaryClip(ClipData.newPlainText(mContext.getPackageName(), LogUtils.loadLog()));
|
||||
// LogUtils.d(TAG, "Log is copied.");
|
||||
// }
|
||||
// });
|
||||
// mSelectableCheckBox = findViewById(cc.winboll.studio.libapputils.R.id.viewlogCheckBoxSelectable);
|
||||
// mSelectableCheckBox.setOnClickListener(new View.OnClickListener(){
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if (mSelectableCheckBox.isChecked()) {
|
||||
// setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
|
||||
// } else {
|
||||
// setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // 设置日志级别列表
|
||||
// ArrayList<String> adapterItems = new ArrayList<>();
|
||||
// for (LogUtils.LOG_LEVEL e : LogUtils.LOG_LEVEL.values()) {
|
||||
// adapterItems.add(e.name());
|
||||
// }
|
||||
// // 假设你有一个字符串数组作为选项列表
|
||||
// //String[] options = {"Option 1", "Option 2", "Option 3"};
|
||||
// // 创建一个ArrayAdapter来绑定数据到spinner
|
||||
// mLogLevelSpinnerAdapter = ArrayAdapter.createFromResource(
|
||||
// context, cc.winboll.studio.libapputils.R.array.enum_loglevel_array, android.R.layout.simple_spinner_item);
|
||||
// mLogLevelSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
//
|
||||
// // 设置适配器并将它应用到spinner上
|
||||
// mLogLevelSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // 设置下拉视图样式
|
||||
// mLogLevelSpinner.setAdapter(mLogLevelSpinnerAdapter);
|
||||
// // 为Spinner添加监听器
|
||||
// mLogLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
// @Override
|
||||
// public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
// //String selectedOption = mLogLevelSpinnerAdapter.getItem(position);
|
||||
// // 处理选中的选项...
|
||||
// LogUtils.setLogLevel(LogUtils.LOG_LEVEL.values()[position]);
|
||||
// }
|
||||
// @Override
|
||||
// public void onNothingSelected(AdapterView<?> parent) {
|
||||
// // 如果没有选择,则执行此操作...
|
||||
// }
|
||||
// });
|
||||
// // 获取默认值的索引
|
||||
// int defaultValueIndex = LogUtils.getLogLevel().ordinal();
|
||||
//
|
||||
// if (defaultValueIndex != -1) {
|
||||
// // 如果找到了默认值,设置默认选项
|
||||
// mLogLevelSpinner.setSelection(defaultValueIndex);
|
||||
// }
|
||||
//
|
||||
// // 设置滚动时不聚焦日志
|
||||
// setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||
}
|
||||
|
||||
public void loadUrl(String url) {
|
||||
mWebView.loadUrl(url);
|
||||
//webView.loadUrl("https://www.winboll.cc");
|
||||
//webView.loadUrl("https://ads.winboll.cc");
|
||||
}
|
||||
|
||||
// public void updateLogView() {
|
||||
// if (mLogViewHandler.isHandling() == true) {
|
||||
// // 正在处理日志显示,
|
||||
// // 就先设置一个新日志标志位
|
||||
// // 以便日志显示完后,再次显示新日志内容
|
||||
// mLogViewHandler.setIsAddNewLog(true);
|
||||
// } else {
|
||||
// //LogUtils.d(TAG, "LogListener showLog(String path)");
|
||||
// Message message = mLogViewHandler.obtainMessage(LogViewHandler.MSG_LOGVIEW_UPDATE);
|
||||
// mLogViewHandler.sendMessage(message);
|
||||
// mLogViewHandler.setIsAddNewLog(false);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void showAndScrollLogView() {
|
||||
// mTextView.setText(LogUtils.loadLog());
|
||||
// scrollLogUp();
|
||||
// }
|
||||
//
|
||||
// class LogViewHandler extends Handler {
|
||||
//
|
||||
// final static int MSG_LOGVIEW_UPDATE = 0;
|
||||
// volatile boolean isHandling;
|
||||
// volatile boolean isAddNewLog;
|
||||
//
|
||||
// public LogViewHandler() {
|
||||
// setIsHandling(false);
|
||||
// setIsAddNewLog(false);
|
||||
// }
|
||||
//
|
||||
// public void setIsHandling(boolean isHandling) {
|
||||
// this.isHandling = isHandling;
|
||||
// }
|
||||
//
|
||||
// public boolean isHandling() {
|
||||
// return isHandling;
|
||||
// }
|
||||
//
|
||||
// public void setIsAddNewLog(boolean isAddNewLog) {
|
||||
// this.isAddNewLog = isAddNewLog;
|
||||
// }
|
||||
//
|
||||
// public boolean isAddNewLog() {
|
||||
// return isAddNewLog;
|
||||
// }
|
||||
//
|
||||
// public void handleMessage(Message msg) {
|
||||
// switch (msg.what) {
|
||||
// case MSG_LOGVIEW_UPDATE:{
|
||||
// if (isHandling() == false) {
|
||||
// setIsHandling(true);
|
||||
// showAndScrollLogView();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// super.handleMessage(msg);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/02/06 08:45:23
|
||||
* @Describe 关于活动窗口的介绍窗口工厂
|
||||
*/
|
||||
public class AboutActivityFactory {
|
||||
|
||||
public static final String TAG = "AboutActivityFactory";
|
||||
|
||||
public static APPInfo buildDefaultAPPInfo() {
|
||||
String szBranchName = "";
|
||||
|
||||
APPInfo appInfo = new APPInfo();
|
||||
appInfo.setAppName("APP");
|
||||
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription("APP Description");
|
||||
appInfo.setAppGitName("APP");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(szBranchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");
|
||||
appInfo.setAppAPKName("APP");
|
||||
appInfo.setAppAPKFolderName("APP");
|
||||
return appInfo;
|
||||
}
|
||||
|
||||
public static void showAboutActivity(Context context, APPInfo appInfo) {
|
||||
/*String szPN = ((IWinBollActivity)context).getActivityPackageName();
|
||||
//String szPN = context.getPackageName();
|
||||
String szBranchName = "";
|
||||
if (szPN != null) {
|
||||
//String szPN = "cc.winboll.studio.apputils.beta";
|
||||
String regex = "cc\\.winboll\\.studio\\.([^.]+)\\.*";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(szPN);
|
||||
if (matcher.find()) {
|
||||
szBranchName = matcher.group(1);
|
||||
}
|
||||
}*/
|
||||
//ToastUtils.show(szPN);
|
||||
|
||||
Intent intent = new Intent(context, AboutActivity.class);
|
||||
intent.putExtra(AboutActivity.EXTRA_APPINFO, (appInfo == null) ? AboutActivityFactory.buildDefaultAPPInfo():appInfo);
|
||||
WinBollActivityManager.getInstance(context).startWinBollActivity(context, intent, AboutActivity.class);
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@ package cc.winboll.studio.libapputils.app;
|
||||
* @Date 2024/08/12 14:45:35
|
||||
* @Describe 应用版本工具集
|
||||
*/
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@@ -0,0 +1,25 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/02/04 10:20:16
|
||||
* @Describe WinBoll Activity 接口
|
||||
*/
|
||||
import android.view.View;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
|
||||
public interface IWinBollActivity {
|
||||
|
||||
public static final String TAG = "IWinBollActivity";
|
||||
|
||||
// 获取当前具有 IWinBoll 特征的 AppCompatActivity 活动窗口
|
||||
AppCompatActivity getActivity();
|
||||
|
||||
abstract public APPInfo getAppInfo();
|
||||
abstract public String getTag();
|
||||
abstract Toolbar initToolBar();
|
||||
abstract boolean isEnableDisplayHomeAsUp();
|
||||
abstract boolean isAddWinBollToolBar();
|
||||
}
|
@@ -8,21 +8,17 @@ import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.GlobalApplication;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
public class MyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
public static final String TAG = "MyActivityLifecycleCallbacks";
|
||||
|
||||
Application mApplication;
|
||||
|
||||
public String mInfo = "";
|
||||
|
||||
public MyActivityLifecycleCallbacks(Application application) {
|
||||
mApplication = application;
|
||||
public MyActivityLifecycleCallbacks() {
|
||||
}
|
||||
|
||||
void createActivityeInfo(Activity activity) {
|
||||
|
@@ -1,486 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/08/12 14:32:08
|
||||
* @Describe WinBoll 活动窗口基础类
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.view.AboutView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
abstract public class WinBollActivity extends AppCompatActivity {
|
||||
|
||||
public static final String TAG = "WinBollActivity";
|
||||
|
||||
public static final int REQUEST_LOG_ACTIVITY = 0;
|
||||
|
||||
Toolbar mToolBar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
checkResolveActivity();
|
||||
LogUtils.d(TAG, "onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
archiveInstance();
|
||||
|
||||
}
|
||||
|
||||
boolean checkResolveActivity() {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
//Intent intent = new Intent("your_action_here");
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
if (resolveInfoList.size() > 0) {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里有定义
|
||||
if (intent.getAction() != null) {
|
||||
if (intent.getAction().equals(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW)) {
|
||||
WinBollUtils.setIsDebug(true);
|
||||
//ToastUtils.show!("WinBollApplication.setIsDebug(true) by action : " + intent.getAction());
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里没有定义
|
||||
//ToastUtils.show("false : " + intent.getAction());
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
|
||||
if (resolveInfo != null) {
|
||||
// action在清单文件中有声明
|
||||
|
||||
} else {
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
// action在清单文件中没有声明
|
||||
ToastUtils.show("false");
|
||||
return false;
|
||||
}
|
||||
|
||||
void archiveInstance() {
|
||||
Intent intent = getIntent();
|
||||
StringBuilder sb = new StringBuilder("\n### Archive Instance ###\n");
|
||||
|
||||
if (intent != null) {
|
||||
ComponentName componentName = intent.getComponent();
|
||||
if (componentName != null) {
|
||||
String packageName = componentName.getPackageName();
|
||||
//Log.d("AppStarter", "启动本应用的应用包名: " + packageName);
|
||||
sb.append("启动本应用的应用包名: \n" + packageName);
|
||||
}
|
||||
|
||||
sb.append("\nImplicit Intent Tracker :\n接收到的 Intent 动作: \n" + intent.getAction());
|
||||
Set<String> categories = intent.getCategories();
|
||||
if (categories != null) {
|
||||
for (String category : categories) {
|
||||
sb.append("\n接收到的 Intent 类别 :\n" + category);
|
||||
}
|
||||
}
|
||||
Uri data = intent.getData();
|
||||
if (data != null) {
|
||||
sb.append("\n接收到的 Intent 数据 :\n" + data.toString());
|
||||
}
|
||||
} else {
|
||||
sb.append("Intent is null.");
|
||||
}
|
||||
sb.append("\n\n");
|
||||
LogUtils.d(TAG, sb.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
mToolBar = initToolBar();
|
||||
setSupportActionBar(mToolBar);
|
||||
if (isEnableDisplayHomeAsUp() && mToolBar != null) {
|
||||
// 显示后退按钮
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
// 缓存当前 activity
|
||||
LogUtils.d(TAG, "ActManager.getInstance().add(this);");
|
||||
//ToastUtils.show("getTag() " + getTag());
|
||||
WinBollActivityManager.getInstance(this).add(this);
|
||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||
//ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE());
|
||||
//boolean isDebuging = WinBollApplication.loadDebugStatusIsDebuging();
|
||||
//ToastUtils.show(String.valueOf(isDebuging));
|
||||
//WinBollApplication.setIsDebug(true);
|
||||
|
||||
setSubTitle(getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreate() {
|
||||
super.recreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
WinBollActivityManager.getInstance(this).registeRemove(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(int layoutResID) {
|
||||
super.setContentView(layoutResID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends View> T findViewById(int id) {
|
||||
return super.findViewById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MenuInflater getMenuInflater() {
|
||||
return super.getMenuInflater();
|
||||
}
|
||||
|
||||
public WinBollActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context getApplicationContext() {
|
||||
return super.getApplicationContext();
|
||||
}
|
||||
|
||||
public <T extends FragmentManager> T getWinBollActivitySupportFragmentManager() {
|
||||
return (T)super.getSupportFragmentManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionBar getSupportActionBar() {
|
||||
return super.getSupportActionBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSupportActionBar(Toolbar toolbar) {
|
||||
super.setSupportActionBar(toolbar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActionBar(android.widget.Toolbar toolbar) {
|
||||
super.setActionBar(toolbar);
|
||||
}
|
||||
|
||||
public void setSubTitle(CharSequence title) {
|
||||
LogUtils.d(TAG, "setSubTitle");
|
||||
if (super.getSupportActionBar() != null) {
|
||||
super.getSupportActionBar().setSubtitle(title);
|
||||
LogUtils.d(TAG, String.format("setSubtitle title : %s", title));
|
||||
}
|
||||
}
|
||||
|
||||
public CharSequence getSubTitle() {
|
||||
if (super.getSupportActionBar() != null) {
|
||||
return super.getSupportActionBar().getSubtitle();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
//super.setTitle(title);
|
||||
if (super.getSupportActionBar() != null) {
|
||||
super.getSupportActionBar().setTitle(title);
|
||||
LogUtils.d(TAG, String.format("setSubtitle title : %s", title));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(int titleId) {
|
||||
//super.setTitle(titleId);
|
||||
if (super.getSupportActionBar() != null) {
|
||||
super.getSupportActionBar().setTitle(titleId);
|
||||
//LogUtils.d(TAG, String.format("setSubtitle title : %s", title));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTheme(Resources.Theme theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTheme(int resid) {
|
||||
super.setTheme(resid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitleColor(int textColor) {
|
||||
super.setTitleColor(textColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
super.setContentView(view, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view) {
|
||||
super.setContentView(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||
return super.getSharedPreferences(name, mode);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean releaseInstance() {
|
||||
return super.releaseInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, int flags) {
|
||||
return super.registerReceiver(receiver, filter, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler) {
|
||||
return super.registerReceiver(receiver, filter, broadcastPermission, scheduler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler, int flags) {
|
||||
return super.registerReceiver(receiver, filter, broadcastPermission, scheduler, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivities(Intent[] intents) {
|
||||
super.startActivities(intents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode) {
|
||||
super.startActivityFromFragment(fragment, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(android.app.Fragment fragment, Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityFromFragment(fragment, intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromChild(Activity child, Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityFromChild(child, intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivities(Intent[] intents, Bundle options) {
|
||||
super.startActivities(intents, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startActivityIfNeeded(Intent intent, int requestCode) {
|
||||
return super.startActivityIfNeeded(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startActivityIfNeeded(Intent intent, int requestCode, Bundle options) {
|
||||
return super.startActivityIfNeeded(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromChild(Activity child, Intent intent, int requestCode) {
|
||||
super.startActivityFromChild(child, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComponentName startService(Intent service) {
|
||||
return super.startService(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(android.app.Fragment fragment, Intent intent, int requestCode) {
|
||||
super.startActivityFromFragment(fragment, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(Fragment requestIndex, Intent fragment, int intent, Bundle requestCode) {
|
||||
super.startActivityFromFragment(requestIndex, fragment, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent, Bundle options) {
|
||||
super.startActivity(intent, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
if (isAddWinBollToolBar()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
|
||||
}
|
||||
if (WinBollUtils.isDebug()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_studio_debug, menu);
|
||||
}
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
LogUtils.d(TAG, "onOptionsItemSelected");
|
||||
if (item.getItemId() == R.id.item_log) {
|
||||
// LogUtils.d(TAG, "item_log not yet.");
|
||||
// Intent intent = new Intent(this, LogActivity.class);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// startActivity(intent);
|
||||
|
||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
} else if (item.getItemId() == R.id.item_exit) {
|
||||
//ToastUtils.show("item_exit");
|
||||
WinBollActivityManager.getInstance(this).finishAll();
|
||||
} else if (item.getItemId() == R.id.item_info) {
|
||||
LogUtils.d(TAG, "item_info not yet.");
|
||||
//WinBollApplication application = (WinBollApplication) getApplication();
|
||||
//application.getMyActivityLifecycleCallbacks().showActivityeInfo();
|
||||
} else if (item.getItemId() == R.id.item_exitdebug) {
|
||||
AboutView.setApp2NormalMode(getApplicationContext());
|
||||
} else if (item.getItemId() == R.id.item_about) {
|
||||
startAboutActivity();
|
||||
} else if (item.getItemId() == android.R.id.home) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
// else if (item.getItemId() == android.R.id.home) {
|
||||
// 回到主窗口速度缓慢,方法备用。现在用 WinBollActivityManager resumeActivity 和 finish 方法管理。
|
||||
// _mMainWinBollActivity 是 WinBollActivity 的静态属性
|
||||
// onCreate 函数下 _mMainWinBollActivity 为空时就用 _mMainWinBollActivity = this 赋值。
|
||||
//startWinBollActivity(new Intent(_mMainWinBollActivity, _mMainWinBollActivity.getClass()), _mMainWinBollActivity.getTag(), _mMainWinBollActivity);
|
||||
//}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
//ToastUtils.show("onBackPressed");
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
|
||||
|
||||
/*public void getInstanse() {
|
||||
startWinBollActivity(new Intent(), getTag(), null);
|
||||
}*/
|
||||
|
||||
//
|
||||
// activity: 为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 tag
|
||||
// activity: 不为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
//
|
||||
// protected <T extends WinBollActivity> void startWinBollActivity(Intent intent, String tag, T activity) {
|
||||
// LogUtils.d(TAG, "startWinBollActivityForResult tag " + tag);
|
||||
// //ToastUtils.show("startWinBollActivityForResult tag " + tag);
|
||||
// //打开多任务窗口 flags
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// if (activity != null) {
|
||||
// intent.putExtra("tag", activity.getTag());
|
||||
// } else {
|
||||
// intent.putExtra("tag", tag);
|
||||
// }
|
||||
// //ToastUtils.show("super.startActivityForResult(intent, requestCode); tag " + tag);
|
||||
// LogUtils.d(TAG, "startActivityForResult(intent, requestCode);" + tag);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
|
||||
//
|
||||
// activity: 为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 tag
|
||||
// activity: 不为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
//
|
||||
protected <T extends AboutActivity> void startAboutActivity() {
|
||||
Intent intent = new Intent(this, AboutActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
intent.putExtra("tag", AboutActivity.TAG);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent) {
|
||||
//绑定唯一标识 tag,存在 则根据 taskId 移动到前台
|
||||
String tag = intent.getStringExtra("tag");
|
||||
//ToastUtils.show("startActivityForResult tag " + tag);
|
||||
//WinBollActivityManager.getInstance(this).printAvtivityListInfo();
|
||||
if (WinBollActivityManager.getInstance(this).isActive(tag)) {
|
||||
//ToastUtils.show("resumeActivity");
|
||||
LogUtils.d(TAG, "resumeActivity");
|
||||
WinBollActivityManager.getInstance(this).resumeActivity(this, tag);
|
||||
} else {
|
||||
//ToastUtils.show("super.startActivity(intent);");
|
||||
super.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int targetFragment, Intent data) {
|
||||
LogUtils.d(TAG, "onActivityResult");
|
||||
switch (requestCode) {
|
||||
case REQUEST_LOG_ACTIVITY : {
|
||||
LogUtils.d(TAG, "REQUEST_LOG_ACTIVITY");
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
super.onActivityResult(requestCode, targetFragment, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAddWinBollInfoMenu() {
|
||||
return true;
|
||||
}
|
||||
|
||||
abstract public String getTag();
|
||||
abstract protected Toolbar initToolBar();
|
||||
abstract protected boolean isEnableDisplayHomeAsUp();
|
||||
abstract protected boolean isAddWinBollToolBar();
|
||||
}
|
@@ -12,7 +12,7 @@ import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import androidx.core.app.TaskStackBuilder;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -22,14 +22,24 @@ public class WinBollActivityManager {
|
||||
public static final String TAG = "WinBollActivityManager";
|
||||
public static final String EXTRA_TAG = "EXTRA_TAG";
|
||||
|
||||
public static enum WinBollUI_TYPE {
|
||||
Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
|
||||
Service // 退出应用后,清理所有最近任务栏任务记录窗口
|
||||
};
|
||||
|
||||
// 应用类型标志
|
||||
volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||
|
||||
Context mContext;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
static WinBollActivityManager _mWinBollActivityManager;
|
||||
static Map<String, WinBollActivity> _mapActivityList;
|
||||
static Map<String, IWinBollActivity> _mapIWinBollList;
|
||||
IWinBollActivity firstIWinBollActivity;
|
||||
|
||||
public WinBollActivityManager(Context context) {
|
||||
mContext = context;
|
||||
LogUtils.d(TAG, "WinBollActivityManager()");
|
||||
_mapActivityList = new HashMap<String, WinBollActivity>();
|
||||
_mapIWinBollList = new HashMap<String, IWinBollActivity>();
|
||||
}
|
||||
|
||||
public static synchronized WinBollActivityManager getInstance(Context context) {
|
||||
@@ -41,15 +51,35 @@ public class WinBollActivityManager {
|
||||
return _mWinBollActivityManager;
|
||||
}
|
||||
|
||||
//
|
||||
// 设置 WinBoll 应用 UI 类型
|
||||
//
|
||||
public synchronized static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
|
||||
_mWinBollUI_TYPE = mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
//
|
||||
// 获取 WinBoll 应用 UI 类型
|
||||
//
|
||||
public synchronized static WinBollUI_TYPE getWinBollUI_TYPE() {
|
||||
return _mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
//
|
||||
// 把Activity添加到管理中
|
||||
//
|
||||
public <T extends WinBollActivity> void add(T activity) {
|
||||
if (isActive(activity.getTag())) {
|
||||
LogUtils.d(TAG, String.format("add(...) %s is active.", activity.getTag()));
|
||||
public <T extends IWinBollActivity> void add(T iWinBoll) {
|
||||
if (isActive(iWinBoll.getTag())) {
|
||||
LogUtils.d(TAG, String.format("add(...) %s is active.", iWinBoll.getTag()));
|
||||
} else {
|
||||
_mapActivityList.put(activity.getTag(), activity);
|
||||
LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", activity.getTag(), _mapActivityList.size()));
|
||||
// 设置起始活动窗口,以便最后退出时提问
|
||||
if (firstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
|
||||
firstIWinBollActivity = iWinBoll;
|
||||
}
|
||||
|
||||
// 添加到活动窗口列表
|
||||
_mapIWinBollList.put(iWinBoll.getTag(), iWinBoll);
|
||||
LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", iWinBoll.getTag(), _mapIWinBollList.size()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +90,7 @@ public class WinBollActivityManager {
|
||||
// activity: 不为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
//
|
||||
public <T extends WinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||
try {
|
||||
// 如果窗口已存在就重启窗口
|
||||
String tag = clazz.newInstance().getTag();
|
||||
@@ -74,6 +104,7 @@ public class WinBollActivityManager {
|
||||
//打开多任务窗口 flags
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(EXTRA_TAG, tag);
|
||||
mContext.startActivity(intent);
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
@@ -81,7 +112,7 @@ public class WinBollActivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
public <T extends WinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||
try {
|
||||
// 如果窗口已存在就重启窗口
|
||||
String tag = clazz.newInstance().getTag();
|
||||
@@ -95,6 +126,7 @@ public class WinBollActivityManager {
|
||||
//打开多任务窗口 flags
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(EXTRA_TAG, tag);
|
||||
mContext.startActivity(intent);
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
@@ -102,18 +134,22 @@ public class WinBollActivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
|
||||
return firstIWinBollActivity != null && firstIWinBollActivity == iWinBollActivity;
|
||||
}
|
||||
|
||||
//
|
||||
// 判断 tag绑定的 MyActivity是否存在
|
||||
//
|
||||
public boolean isActive(String tag) {
|
||||
//printAvtivityListInfo();
|
||||
WinBollActivity activity = getWinBollActivity(tag);
|
||||
if (activity != null) {
|
||||
IWinBollActivity iWinBoll = getIWinBoll(tag);
|
||||
if (iWinBoll != null) {
|
||||
LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
|
||||
//ToastUtils.show("activity != null tag " + tag);
|
||||
//判断是否为 BaseActivity,如果已经销毁,则移除
|
||||
if (activity.isFinishing() || activity.isDestroyed()) {
|
||||
_mapActivityList.remove(activity.getTag());
|
||||
if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
|
||||
_mapIWinBollList.remove(iWinBoll.getTag());
|
||||
//_mWinBollActivityList.remove(activity);
|
||||
LogUtils.d(TAG, String.format("isActive(...) remove activity.\ntag : %s", tag));
|
||||
return false;
|
||||
@@ -127,36 +163,36 @@ public class WinBollActivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
static WinBollActivity getWinBollActivity(String tag) {
|
||||
return _mapActivityList.get(tag);
|
||||
static IWinBollActivity getIWinBoll(String tag) {
|
||||
return _mapIWinBollList.get(tag);
|
||||
}
|
||||
|
||||
//
|
||||
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
//
|
||||
public <T extends WinBollActivity> void resumeActivity(Context context, String tag) {
|
||||
public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
|
||||
LogUtils.d(TAG, "resumeActivty");
|
||||
T activity = (T)getWinBollActivity(tag);
|
||||
T iWinBoll = (T)getIWinBoll(tag);
|
||||
//LogUtils.d(TAG, "activity " + activity.getTag());
|
||||
if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
|
||||
resumeActivity(context, activity);
|
||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
resumeActivity(context, iWinBoll);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
//
|
||||
public <T extends WinBollActivity> void resumeActivity(Context context, T activity) {
|
||||
ActivityManager am = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
|
||||
ActivityManager am = (ActivityManager) iWinBoll.getActivity().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
//返回启动它的根任务(home 或者 MainActivity)
|
||||
Intent intent = new Intent(context, activity.getClass());
|
||||
Intent intent = new Intent(context, iWinBoll.getClass());
|
||||
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
||||
stackBuilder.addNextIntentWithParentStack(intent);
|
||||
stackBuilder.startActivities();
|
||||
//moveTaskToFront(YourTaskId, 0);
|
||||
LogUtils.d(TAG, "am.moveTaskToFront");
|
||||
//ToastUtils.show("resumeActivity am.moveTaskToFront");
|
||||
am.moveTaskToFront(activity.getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||
am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,19 +201,19 @@ public class WinBollActivityManager {
|
||||
//
|
||||
public void finishAll() {
|
||||
try {
|
||||
for (String key : _mapActivityList.keySet()) {
|
||||
for (String key : _mapIWinBollList.keySet()) {
|
||||
//System.out.println("Key: " + key + ", Value: " + _mapActivityList.get(key));
|
||||
WinBollActivity activity = _mapActivityList.get(key);
|
||||
IWinBollActivity iWinBoll = _mapIWinBollList.get(key);
|
||||
//ToastUtils.show("finishAll() activity");
|
||||
if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
|
||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
//ToastUtils.show("activity != null ...");
|
||||
if (WinBollUtils.getInstance(mContext).getWinBollUI_TYPE() == WinBollUtils.WinBollUI_TYPE.Service) {
|
||||
if (getWinBollUI_TYPE() == WinBollUI_TYPE.Service) {
|
||||
// 结束窗口和最近任务栏, 建议前台服务类应用使用,可以方便用户再次调用 UI 操作。
|
||||
activity.finishAndRemoveTask();
|
||||
iWinBoll.getActivity().finishAndRemoveTask();
|
||||
//ToastUtils.show("finishAll() activity.finishAndRemoveTask();");
|
||||
} else if (WinBollUtils.getInstance(mContext).getWinBollUI_TYPE() == WinBollUtils.WinBollUI_TYPE.Aplication) {
|
||||
} else if (getWinBollUI_TYPE() == WinBollUI_TYPE.Aplication) {
|
||||
// 结束窗口保留最近任务栏,建议前台服务类应用使用,可以保持应用的系统自觉性。
|
||||
activity.finish();
|
||||
iWinBoll.getActivity().finish();
|
||||
//ToastUtils.show("finishAll() activity.finish();");
|
||||
} else {
|
||||
LogUtils.d(TAG, "WinBollApplication.WinBollUI_TYPE error.");
|
||||
@@ -193,9 +229,9 @@ public class WinBollActivityManager {
|
||||
//
|
||||
// 结束指定Activity
|
||||
//
|
||||
public <T extends WinBollActivity> void finish(T activity) {
|
||||
public <T extends IWinBollActivity> void finish(T iWinBoll) {
|
||||
try {
|
||||
if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
|
||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
//根据tag 移除 MyActivity
|
||||
//String tag= activity.getTag();
|
||||
//_mWinBollActivityList.remove(tag);
|
||||
@@ -210,10 +246,10 @@ public class WinBollActivityManager {
|
||||
// ★:0 1 2 3 [4] >> 3
|
||||
// ★:[0] >> 直接关闭当前窗口
|
||||
LogUtils.d(TAG, "finish no yet.");
|
||||
WinBollActivity preActivity = getPreActivity(activity);
|
||||
activity.finish();
|
||||
if (preActivity != null) {
|
||||
resumeActivity(mContext, preActivity);
|
||||
IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
|
||||
iWinBoll.getActivity().finish();
|
||||
if (preIWinBoll != null) {
|
||||
resumeActivity(mContext, preIWinBoll);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,21 +261,21 @@ public class WinBollActivityManager {
|
||||
//
|
||||
// 获取窗口队列中的前一个窗口
|
||||
//
|
||||
WinBollActivity getPreActivity(WinBollActivity activity) {
|
||||
IWinBollActivity getPreIWinBoll(IWinBollActivity iWinBoll) {
|
||||
try {
|
||||
boolean bingo = false;
|
||||
WinBollActivity preActivity = null;
|
||||
for (Map.Entry<String, WinBollActivity> entity : _mapActivityList.entrySet()) {
|
||||
if (entity.getKey().equals(activity.getTag())) {
|
||||
IWinBollActivity preIWinBoll = null;
|
||||
for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
|
||||
if (entity.getKey().equals(iWinBoll.getTag())) {
|
||||
bingo = true;
|
||||
LogUtils.d(TAG, "bingo");
|
||||
break;
|
||||
}
|
||||
preActivity = entity.getValue();
|
||||
preIWinBoll = entity.getValue();
|
||||
}
|
||||
|
||||
if (bingo) {
|
||||
return preActivity;
|
||||
return preIWinBoll;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
@@ -251,10 +287,10 @@ public class WinBollActivityManager {
|
||||
//
|
||||
// 从管理列表中移除管理项
|
||||
//
|
||||
public <T extends WinBollActivity> boolean registeRemove(T activity) {
|
||||
WinBollActivity activityTest = _mapActivityList.get(activity.getTag());
|
||||
if (activityTest != null) {
|
||||
_mapActivityList.remove(activity.getTag());
|
||||
public <T extends IWinBollActivity> boolean registeRemove(T activity) {
|
||||
IWinBollActivity iWinBollTest = _mapIWinBollList.get(activity.getTag());
|
||||
if (iWinBollTest != null) {
|
||||
_mapIWinBollList.remove(activity.getTag());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -263,13 +299,13 @@ public class WinBollActivityManager {
|
||||
//
|
||||
// 打印管理列表项列表里的信息
|
||||
//
|
||||
public static void printAvtivityListInfo() {
|
||||
public static void printIWinBollListInfo() {
|
||||
//LogUtils.d(TAG, "printAvtivityListInfo");
|
||||
if (!_mapActivityList.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapActivityList.size()));
|
||||
Iterator<Map.Entry<String, WinBollActivity>> iterator = _mapActivityList.entrySet().iterator();
|
||||
if (!_mapIWinBollList.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapIWinBollList.size()));
|
||||
Iterator<Map.Entry<String, IWinBollActivity>> iterator = _mapIWinBollList.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, WinBollActivity> entry = iterator.next();
|
||||
Map.Entry<String, IWinBollActivity> entry = iterator.next();
|
||||
sb.append("\nKey: " + entry.getKey() + ", \nValue: " + entry.getValue().getTag());
|
||||
//ToastUtils.show("\nKey: " + entry.getKey() + ", Value: " + entry.getValue().getTag());
|
||||
}
|
||||
|
@@ -0,0 +1,18 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/02/04 10:19:34
|
||||
* @Describe WinBoll 工厂
|
||||
*/
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class WinBollFactory {
|
||||
|
||||
public static final String TAG = "WinBollFactory";
|
||||
|
||||
public static AppCompatActivity buildAppCompatActivity(IWinBollActivity iWinBoll) {
|
||||
return iWinBoll.getActivity();
|
||||
}
|
||||
}
|
@@ -1,98 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.view.Gravity;
|
||||
import cc.winboll.studio.libapputils.bean.DebugBean;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.hjq.toast.style.WhiteToastStyle;
|
||||
|
||||
public class WinBollUtils {
|
||||
|
||||
public static final String TAG = "WinBollUtils";
|
||||
|
||||
//
|
||||
// 单件结构模块
|
||||
//
|
||||
static volatile WinBollUtils _WinBollUtils;
|
||||
Context mContext;
|
||||
WinBollUtils(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
public static synchronized WinBollUtils getInstance(Context context) {
|
||||
if (_WinBollUtils == null) {
|
||||
_WinBollUtils = new WinBollUtils(context);
|
||||
}
|
||||
return _WinBollUtils;
|
||||
}
|
||||
|
||||
public static enum WinBollUI_TYPE {
|
||||
Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
|
||||
Service // 退出应用后,清理所有最近任务栏任务记录窗口
|
||||
};
|
||||
|
||||
// 应用类型标志
|
||||
volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||
|
||||
//static volatile WinBollApplication _WinBollApplication = null;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
|
||||
// 标记当前应用是否处于调试状态
|
||||
static volatile boolean isDebug = false;
|
||||
|
||||
public static void setIsDebug(boolean isDebug) {
|
||||
WinBollUtils.isDebug = isDebug;
|
||||
}
|
||||
|
||||
public static boolean isDebug() {
|
||||
return isDebug;
|
||||
}
|
||||
|
||||
//
|
||||
// 设置 WinBoll 应用 UI 类型
|
||||
//
|
||||
public static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
|
||||
_mWinBollUI_TYPE = mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
//
|
||||
// 获取 WinBoll 应用 UI 类型
|
||||
//
|
||||
public static WinBollUI_TYPE getWinBollUI_TYPE() {
|
||||
return _mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
MyActivityLifecycleCallbacks getMyActivityLifecycleCallbacks() {
|
||||
return mMyActivityLifecycleCallbacks;
|
||||
}
|
||||
|
||||
public void init(Application application) {
|
||||
// 应用环境初始化, 基本调试环境
|
||||
//
|
||||
// 初始化日志模块
|
||||
LogUtils.init(mContext);
|
||||
// 初始化 Toast 框架
|
||||
ToastUtils.init(application);
|
||||
// 设置 Toast 布局样式
|
||||
//ToastUtils.setView(R.layout.view_toast);
|
||||
ToastUtils.setStyle(new WhiteToastStyle());
|
||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
// 设置应用调试标志
|
||||
DebugBean debugBean = DebugBean.loadBean(mContext, DebugBean.class);
|
||||
if (debugBean == null) {
|
||||
//ToastUtils.show("debugBean == null");
|
||||
setIsDebug(false);
|
||||
} else {
|
||||
//ToastUtils.show("saveDebugStatus(" + String.valueOf(debugBean.isDebuging()) + ")");
|
||||
setIsDebug(debugBean.isDebuging());
|
||||
}
|
||||
// 应用窗口管理模块参数设置
|
||||
//
|
||||
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(application);
|
||||
application.registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
// 设置默认 WinBoll 应用 UI 类型
|
||||
setWinBollUI_TYPE(WinBollUI_TYPE.Service);
|
||||
//ToastUtils.show("WinBollUI_TYPE " + getWinBollUI_TYPE());
|
||||
}
|
||||
}
|
@@ -20,6 +20,12 @@ public class APPInfo implements Serializable {
|
||||
String appDescription;
|
||||
// 应用Git仓库地址
|
||||
String appGitName;
|
||||
// 应用Git仓库拥有者
|
||||
String appGitOwner;
|
||||
// 应用Git仓库分支
|
||||
String appGitAPPBranch;
|
||||
// 应用Git仓库子项目文件夹
|
||||
String appGitAPPSubProjectFolder;
|
||||
// 应用主页
|
||||
String appHomePage;
|
||||
// 应用包名称
|
||||
@@ -27,27 +33,56 @@ public class APPInfo implements Serializable {
|
||||
// 应用包存储文件夹名称
|
||||
String appAPKFolderName;
|
||||
|
||||
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appHomePage, String appAPKName, String appAPKFolderName) {
|
||||
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitOwner, String appGitAPPBranch, String appGitAPPSubProjectFolder, String appHomePage, String appAPKName, String appAPKFolderName) {
|
||||
this.appName = appName;
|
||||
this.appIcon = appIcon;
|
||||
this.appDescription = appDescription;
|
||||
this.appGitName = appGitName;
|
||||
this.appGitOwner = appGitOwner;
|
||||
this.appGitAPPBranch = appGitAPPBranch;
|
||||
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
||||
this.appHomePage = appHomePage;
|
||||
this.appAPKName = appAPKName;
|
||||
this.appAPKFolderName = appAPKFolderName;
|
||||
}
|
||||
|
||||
|
||||
public APPInfo() {
|
||||
this.appName = "WinBoll-APP";
|
||||
this.appIcon = R.drawable.ic_launcher;
|
||||
this.appDescription = "WinBoll APP";
|
||||
this.appGitName = "APP";
|
||||
this.appGitOwner = "Studio";
|
||||
this.appGitAPPBranch = "app";
|
||||
this.appGitAPPSubProjectFolder = "app";
|
||||
this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP";
|
||||
this.appAPKName = "APP";
|
||||
this.appAPKFolderName = "APP";
|
||||
}
|
||||
|
||||
public void setAppGitOwner(String appGitOwner) {
|
||||
this.appGitOwner = appGitOwner;
|
||||
}
|
||||
|
||||
public String getAppGitOwner() {
|
||||
return appGitOwner;
|
||||
}
|
||||
|
||||
public void setAppGitAPPBranch(String appGitAPPBranch) {
|
||||
this.appGitAPPBranch = appGitAPPBranch;
|
||||
}
|
||||
|
||||
public String getAppGitAPPBranch() {
|
||||
return appGitAPPBranch;
|
||||
}
|
||||
|
||||
public void setAppGitAPPSubProjectFolder(String appGitAPPSubProjectFolder) {
|
||||
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
||||
}
|
||||
|
||||
public String getAppGitAPPSubProjectFolder() {
|
||||
return appGitAPPSubProjectFolder;
|
||||
}
|
||||
|
||||
public void setAppIcon(int appIcon) {
|
||||
this.appIcon = appIcon;
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ package cc.winboll.studio.libapputils.bean;
|
||||
import android.content.Context;
|
||||
import android.util.JsonReader;
|
||||
import android.util.JsonWriter;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.util.FileUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cc.winboll.studio.libapputils.git;
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
@@ -6,34 +6,47 @@ package cc.winboll.studio.libapputils.log;
|
||||
* @Describe WinBoll 应用日志窗口
|
||||
*/
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollUtils;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
|
||||
public class LogActivity extends WinBollActivity {
|
||||
public class LogActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "LogActivity";
|
||||
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
public AppCompatActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
public Toolbar initToolBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -44,7 +57,7 @@ public class LogActivity extends WinBollActivity {
|
||||
setContentView(R.layout.activity_log);
|
||||
mLogView = findViewById(R.id.logview);
|
||||
|
||||
if (WinBollUtils.isDebug()) { mLogView.start(); }
|
||||
if (GlobalApplication.isDebuging()) { mLogView.start(); }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,370 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.log;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/08/12 13:44:06
|
||||
* @Describe LogUtils
|
||||
* @Describe 应用日志类
|
||||
*/
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.libapputils.app.WinBollUtils;
|
||||
import cc.winboll.studio.libapputils.util.FileUtils;
|
||||
import dalvik.system.DexFile;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class LogUtils {
|
||||
|
||||
public static final String TAG = "LogUtils";
|
||||
|
||||
public static enum LOG_LEVEL { Off, Error, Warn, Info, Debug, Verbose }
|
||||
|
||||
static volatile boolean _IsInited = false;
|
||||
static Context _mContext;
|
||||
// 日志显示时间格式
|
||||
static SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("[yyyyMMdd_HHmmSS]", Locale.getDefault());
|
||||
// 应用日志文件夹
|
||||
static File _mfLogCacheDir;
|
||||
static File _mfLogDataDir;
|
||||
// 应用日志文件
|
||||
static File _mfLogCatchFile;
|
||||
static File _mfLogUtilsBeanFile;
|
||||
static LogUtilsBean _mLogUtilsBean;
|
||||
public static Map<String, Boolean> mapTAGList = new HashMap<String, Boolean>();
|
||||
|
||||
//
|
||||
// 初始化函数
|
||||
//
|
||||
public static void init(Context context) {
|
||||
_mContext = context;
|
||||
init(context, LOG_LEVEL.Off);
|
||||
}
|
||||
|
||||
//
|
||||
// 初始化函数
|
||||
//
|
||||
public static void init(Context context, LOG_LEVEL logLevel) {
|
||||
if (WinBollUtils.isDebug()) {
|
||||
// 初始化日志缓存文件路径
|
||||
_mfLogCacheDir = new File(context.getApplicationContext().getExternalCacheDir(), TAG);
|
||||
if (!_mfLogCacheDir.exists()) {
|
||||
_mfLogCacheDir.mkdirs();
|
||||
}
|
||||
_mfLogCatchFile = new File(_mfLogCacheDir, "log.txt");
|
||||
|
||||
// 初始化日志配置文件路径
|
||||
_mfLogDataDir = context.getApplicationContext().getExternalFilesDir(TAG);
|
||||
if (!_mfLogDataDir.exists()) {
|
||||
_mfLogDataDir.mkdirs();
|
||||
}
|
||||
_mfLogUtilsBeanFile = new File(_mfLogDataDir, TAG + ".json");
|
||||
} else {
|
||||
// 初始化日志缓存文件路径
|
||||
_mfLogCacheDir = new File(context.getApplicationContext().getCacheDir(), TAG);
|
||||
if (!_mfLogCacheDir.exists()) {
|
||||
_mfLogCacheDir.mkdirs();
|
||||
}
|
||||
_mfLogCatchFile = new File(_mfLogCacheDir, "log.txt");
|
||||
|
||||
// 初始化日志配置文件路径
|
||||
_mfLogDataDir = new File(context.getApplicationContext().getFilesDir(), TAG);
|
||||
if (!_mfLogDataDir.exists()) {
|
||||
_mfLogDataDir.mkdirs();
|
||||
}
|
||||
_mfLogUtilsBeanFile = new File(_mfLogDataDir, TAG + ".json");
|
||||
}
|
||||
|
||||
// Toast.makeText(context,
|
||||
// "_mfLogUtilsBeanFile : " + _mfLogUtilsBeanFile
|
||||
// + "\n_mfLogCatchFile : " + _mfLogCatchFile,
|
||||
// Toast.LENGTH_SHORT).show();
|
||||
//
|
||||
_mLogUtilsBean = LogUtilsBean.loadBeanFromFile(_mfLogUtilsBeanFile.getPath(), LogUtilsBean.class);
|
||||
if (_mLogUtilsBean == null) {
|
||||
_mLogUtilsBean = new LogUtilsBean();
|
||||
_mLogUtilsBean.saveBeanToFile(_mfLogUtilsBeanFile.getPath(), _mLogUtilsBean);
|
||||
}
|
||||
|
||||
// 加载当前应用下的所有类的 TAG
|
||||
addClassTAGList();
|
||||
loadTAGBeanSettings();
|
||||
_IsInited = true;
|
||||
LogUtils.d(TAG, String.format("mapTAGList : %s", mapTAGList.toString()));
|
||||
}
|
||||
|
||||
public static Map<String, Boolean> getMapTAGList() {
|
||||
return mapTAGList;
|
||||
}
|
||||
|
||||
static void loadTAGBeanSettings() {
|
||||
ArrayList<LogUtilsClassTAGBean> list = new ArrayList<LogUtilsClassTAGBean>();
|
||||
LogUtilsClassTAGBean.loadBeanList(_mContext, list, LogUtilsClassTAGBean.class);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
LogUtilsClassTAGBean beanSetting = list.get(i);
|
||||
for (Map.Entry<String, Boolean> entry : mapTAGList.entrySet()) {
|
||||
if (entry.getKey().equals(beanSetting.getTag())) {
|
||||
entry.setValue(beanSetting.getEnable());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void saveTAGBeanSettings() {
|
||||
ArrayList<LogUtilsClassTAGBean> list = new ArrayList<LogUtilsClassTAGBean>();
|
||||
for (Map.Entry<String, Boolean> entry : mapTAGList.entrySet()) {
|
||||
list.add(new LogUtilsClassTAGBean(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
LogUtilsClassTAGBean.saveBeanList(_mContext, list, LogUtilsClassTAGBean.class);
|
||||
}
|
||||
|
||||
static void addClassTAGList() {
|
||||
//ClassLoader classLoader = getClass().getClassLoader();
|
||||
try {
|
||||
//String packageName = context.getPackageName();
|
||||
String packageNamePrefix = "cc.winboll.studio";
|
||||
List<String> classNames = new ArrayList<>();
|
||||
String apkPath = _mContext.getPackageCodePath();
|
||||
//Log.d("APK_PATH", "The APK path is: " + apkPath);
|
||||
LogUtils.d(TAG, String.format("apkPath : %s", apkPath));
|
||||
//String apkPath = "/data/app/" + packageName + "-";
|
||||
|
||||
//DexFile dexfile = new DexFile(apkPath + "1/base.apk");
|
||||
DexFile dexfile = new DexFile(apkPath);
|
||||
|
||||
int countTemp = 0;
|
||||
Enumeration<String> entries = dexfile.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
countTemp++;
|
||||
String className = entries.nextElement();
|
||||
if (className.startsWith(packageNamePrefix)) {
|
||||
classNames.add(className);
|
||||
}
|
||||
}
|
||||
|
||||
LogUtils.d(TAG, String.format("countTemp : %d\nClassNames size : %d", countTemp, classNames.size()));
|
||||
|
||||
for (String className : classNames) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(className);
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (Modifier.isStatic(field.getModifiers()) && Modifier.isPublic(field.getModifiers()) && field.getType() == String.class && "TAG".equals(field.getName())) {
|
||||
String tagValue = (String) field.get(null);
|
||||
//Log.d("TAG_INFO", "Class: " + className + ", TAG value: " + tagValue);
|
||||
//LogUtils.d(TAG, String.format("Tag Value : %s", tagValue));
|
||||
//mapTAGList.put(tagValue, true);
|
||||
mapTAGList.put(tagValue, false);
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException | IllegalAccessException e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
//Toast.makeText(context, TAG + " : " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
//Toast.makeText(context, TAG + " : " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setTAGListEnable(String tag, boolean isEnable) {
|
||||
Iterator<Map.Entry<String, Boolean>> iterator = mapTAGList.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, Boolean> entry = iterator.next();
|
||||
if (tag.equals(entry.getKey())) {
|
||||
entry.setValue(isEnable);
|
||||
//System.out.println("Key: " + entry.getKey() + ", Value: " + entry.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
saveTAGBeanSettings();
|
||||
LogUtils.d(TAG, String.format("mapTAGList : %s", mapTAGList.toString()));
|
||||
}
|
||||
|
||||
public static void setALlTAGListEnable(boolean isEnable) {
|
||||
Iterator<Map.Entry<String, Boolean>> iterator = mapTAGList.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, Boolean> entry = iterator.next();
|
||||
entry.setValue(isEnable);
|
||||
//System.out.println("Key: " + entry.getKey() + ", Value: " + entry.getValue());
|
||||
}
|
||||
saveTAGBeanSettings();
|
||||
LogUtils.d(TAG, String.format("mapTAGList : %s", mapTAGList.toString()));
|
||||
}
|
||||
|
||||
public static void setLogLevel(LOG_LEVEL logLevel) {
|
||||
LogUtils._mLogUtilsBean.setLogLevel(logLevel);
|
||||
_mLogUtilsBean.saveBeanToFile(_mfLogUtilsBeanFile.getPath(), _mLogUtilsBean);
|
||||
}
|
||||
|
||||
public static LOG_LEVEL getLogLevel() {
|
||||
return LogUtils._mLogUtilsBean.getLogLevel();
|
||||
}
|
||||
|
||||
static boolean isLoggable(String tag, LOG_LEVEL logLevel) {
|
||||
return _IsInited && mapTAGList.get(tag) && isInTheLevel(logLevel);
|
||||
}
|
||||
|
||||
static boolean isInTheLevel(LOG_LEVEL logLevel) {
|
||||
return (LogUtils._mLogUtilsBean.getLogLevel().ordinal() == logLevel.ordinal()
|
||||
|| LogUtils._mLogUtilsBean.getLogLevel().ordinal() > logLevel.ordinal());
|
||||
}
|
||||
|
||||
//
|
||||
// 获取应用日志文件夹
|
||||
//
|
||||
public static File getLogCacheDir() {
|
||||
return _mfLogCacheDir;
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
//
|
||||
public static void e(String szTAG, String szMessage) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Error)) {
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Error, szMessage);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
//
|
||||
public static void w(String szTAG, String szMessage) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Warn)) {
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Warn, szMessage);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
//
|
||||
public static void i(String szTAG, String szMessage) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Info)) {
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Info, szMessage);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
//
|
||||
public static void d(String szTAG, String szMessage) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Debug)) {
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Debug, szMessage);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
// 包含线程调试堆栈信息
|
||||
//
|
||||
public static void d(String szTAG, String szMessage, StackTraceElement[] listStackTrace) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Debug)) {
|
||||
StringBuilder sbMessage = new StringBuilder(szMessage);
|
||||
sbMessage.append(" \nAt ");
|
||||
sbMessage.append(listStackTrace[2].getMethodName());
|
||||
sbMessage.append(" (");
|
||||
sbMessage.append(listStackTrace[2].getFileName());
|
||||
sbMessage.append(":");
|
||||
sbMessage.append(listStackTrace[2].getLineNumber());
|
||||
sbMessage.append(")");
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Debug, sbMessage.toString());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
// 包含异常信息和线程调试堆栈信息
|
||||
//
|
||||
public static void d(String szTAG, Exception e, StackTraceElement[] listStackTrace) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Debug)) {
|
||||
StringBuilder sbMessage = new StringBuilder(e.getClass().toGenericString());
|
||||
sbMessage.append(" : ");
|
||||
sbMessage.append(e.getMessage());
|
||||
sbMessage.append(" \nAt ");
|
||||
sbMessage.append(listStackTrace[2].getMethodName());
|
||||
sbMessage.append(" (");
|
||||
sbMessage.append(listStackTrace[2].getFileName());
|
||||
sbMessage.append(":");
|
||||
sbMessage.append(listStackTrace[2].getLineNumber());
|
||||
sbMessage.append(")");
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Debug, sbMessage.toString());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 调试日志写入函数
|
||||
//
|
||||
public static void v(String szTAG, String szMessage) {
|
||||
if (isLoggable(szTAG, LogUtils.LOG_LEVEL.Verbose)) {
|
||||
saveLog(szTAG, LogUtils.LOG_LEVEL.Verbose, szMessage);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 日志文件保存函数
|
||||
//
|
||||
static void saveLog(String szTAG, LogUtils.LOG_LEVEL logLevel, String szMessage) {
|
||||
try {
|
||||
BufferedWriter out = null;
|
||||
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(_mfLogCatchFile, true), "UTF-8"));
|
||||
out.write("[" + logLevel + "] " + mSimpleDateFormat.format(System.currentTimeMillis()) + " [" + szTAG + "]\n" + szMessage + "\n");
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
LogUtils.d(TAG, "IOException : " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 历史日志加载函数
|
||||
//
|
||||
public static String loadLog() {
|
||||
if (_mfLogCatchFile.exists()) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try {
|
||||
BufferedReader in = null;
|
||||
in = new BufferedReader(new InputStreamReader(new FileInputStream(_mfLogCatchFile), "UTF-8"));
|
||||
String line = "";
|
||||
while ((line = in.readLine()) != null) {
|
||||
sb.append(line);
|
||||
sb.append("\n");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LogUtils.d(TAG, "IOException : " + e.getMessage());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//
|
||||
// 清理日志函数
|
||||
//
|
||||
public static void cleanLog() {
|
||||
if (_mfLogCatchFile.exists()) {
|
||||
try {
|
||||
FileUtils.writeStringToFile(_mfLogCatchFile.getPath(), "");
|
||||
//LogUtils.d(TAG, "cleanLog");
|
||||
} catch (IOException e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.log;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/08/23 15:39:07
|
||||
* @Describe LogUtils 数据配置类。
|
||||
*/
|
||||
import android.util.JsonReader;
|
||||
import android.util.JsonWriter;
|
||||
import cc.winboll.studio.libapputils.bean.BaseBean;
|
||||
import java.io.IOException;
|
||||
public class LogUtilsBean extends BaseBean {
|
||||
|
||||
public static final String TAG = "LogUtilsBean";
|
||||
|
||||
LogUtils.LOG_LEVEL logLevel;
|
||||
|
||||
public LogUtilsBean() {
|
||||
this.logLevel = LogUtils.LOG_LEVEL.Off;
|
||||
}
|
||||
|
||||
public LogUtilsBean(LogUtils.LOG_LEVEL logLevel) {
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
|
||||
public void setLogLevel(LogUtils.LOG_LEVEL logLevel) {
|
||||
this.logLevel = logLevel;
|
||||
}
|
||||
|
||||
public LogUtils.LOG_LEVEL getLogLevel() {
|
||||
return logLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return LogUtilsBean.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
|
||||
super.writeThisToJsonWriter(jsonWriter);
|
||||
LogUtilsBean bean = this;
|
||||
jsonWriter.name("logLevel").value(bean.getLogLevel().ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
||||
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
||||
if (name.equals("logLevel")) {
|
||||
setLogLevel(LogUtils.LOG_LEVEL.values()[jsonReader.nextInt()]);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
|
||||
jsonReader.beginObject();
|
||||
while (jsonReader.hasNext()) {
|
||||
String name = jsonReader.nextName();
|
||||
if (!initObjectsFromJsonReader(jsonReader, name)) {
|
||||
jsonReader.skipValue();
|
||||
}
|
||||
}
|
||||
// 结束 JSON 对象
|
||||
jsonReader.endObject();
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -1,88 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.log;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/04 14:17:02
|
||||
* @Describe 日志类class TAG 标签数据类
|
||||
*/
|
||||
import android.util.JsonReader;
|
||||
import android.util.JsonWriter;
|
||||
import cc.winboll.studio.libapputils.bean.BaseBean;
|
||||
import java.io.IOException;
|
||||
|
||||
public class LogUtilsClassTAGBean extends BaseBean {
|
||||
|
||||
public static final String TAG = "LogUtilsClassTAGBean";
|
||||
|
||||
// 标签名
|
||||
String tag;
|
||||
// 是否启用
|
||||
Boolean enable;
|
||||
|
||||
public LogUtilsClassTAGBean() {
|
||||
this.tag = TAG;
|
||||
this.enable = true;
|
||||
}
|
||||
|
||||
public LogUtilsClassTAGBean(String tag, Boolean enable) {
|
||||
this.tag = tag;
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setEnable(Boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public Boolean getEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return LogUtilsClassTAGBean.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
|
||||
super.writeThisToJsonWriter(jsonWriter);
|
||||
LogUtilsClassTAGBean bean = this;
|
||||
jsonWriter.name("tag").value(bean.getTag());
|
||||
jsonWriter.name("enable").value(bean.getEnable());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
||||
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
||||
if (name.equals("tag")) {
|
||||
setTag(jsonReader.nextString());
|
||||
} else if (name.equals("enable")) {
|
||||
setEnable(jsonReader.nextBoolean());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
|
||||
jsonReader.beginObject();
|
||||
while (jsonReader.hasNext()) {
|
||||
String name = jsonReader.nextName();
|
||||
if (!initObjectsFromJsonReader(jsonReader, name)) {
|
||||
jsonReader.skipValue();
|
||||
}
|
||||
}
|
||||
// 结束 JSON 对象
|
||||
jsonReader.endObject();
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -24,6 +24,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
|
@@ -6,6 +6,7 @@ package cc.winboll.studio.libapputils.log;
|
||||
* @Describe 日志视图线程类
|
||||
*/
|
||||
import android.os.FileObserver;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class LogViewThread extends Thread {
|
||||
|
@@ -5,15 +5,11 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.util.ServiceUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.io.FileDescriptor;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
|
@@ -10,7 +10,7 @@ import android.content.Intent;
|
||||
import android.content.res.AssetManager;
|
||||
import android.net.Uri;
|
||||
import androidx.core.content.FileProvider;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
@@ -6,18 +6,12 @@ package cc.winboll.studio.libapputils.util;
|
||||
* @Describe 二维码工具
|
||||
*/
|
||||
import android.graphics.Bitmap;
|
||||
import android.widget.TextView;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.Result;
|
||||
import com.google.zxing.WriterException;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import com.journeyapps.barcodescanner.BarcodeEncoder;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class QRCodeGenerator {
|
||||
|
||||
|
@@ -0,0 +1,34 @@
|
||||
package cc.winboll.studio.libapputils.view;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/02/06 09:02:28
|
||||
* @Describe 应用分支介绍按钮
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class AboutBranchButton extends Button {
|
||||
|
||||
public static final String TAG = "AboutBranchButton";
|
||||
|
||||
public AboutBranchButton(final Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AboutActivityFactory.showAboutActivity(context, ((IWinBollActivity)context).getAppInfo());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@@ -16,13 +16,13 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.AppVersionUtils;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.app.WinBollUtils;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.bean.DebugBean;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.util.PrefUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.io.IOException;
|
||||
@@ -88,6 +88,9 @@ public class AboutView extends LinearLayout {
|
||||
appInfo.setAppAPKFolderName(typedArray.getString(R.styleable.AboutView_app_apkfoldername));
|
||||
appInfo.setAppAPKName(typedArray.getString(R.styleable.AboutView_app_apkname));
|
||||
appInfo.setAppGitName(typedArray.getString(R.styleable.AboutView_app_gitname));
|
||||
appInfo.setAppGitOwner(typedArray.getString(R.styleable.AboutView_app_gitowner));
|
||||
appInfo.setAppGitAPPBranch(typedArray.getString(R.styleable.AboutView_app_gitappbranch));
|
||||
appInfo.setAppGitAPPSubProjectFolder(typedArray.getString(R.styleable.AboutView_app_gitappsubprojectfolder));
|
||||
appInfo.setAppDescription(typedArray.getString(R.styleable.AboutView_appdescription));
|
||||
appInfo.setAppIcon(typedArray.getResourceId(R.styleable.AboutView_appicon, R.drawable.ic_winboll));
|
||||
// 返回一个绑定资源结束的信号给资源
|
||||
@@ -103,7 +106,7 @@ public class AboutView extends LinearLayout {
|
||||
mszAppDescription = mAPPInfo.getAppDescription();
|
||||
mnAppIcon = mAPPInfo.getAppIcon();
|
||||
|
||||
mszWinBollServerHost = WinBollUtils.isDebug() ? "https://dev.winboll.cc": "https://www.winboll.cc";
|
||||
mszWinBollServerHost = GlobalApplication.isDebuging() ? "https://dev.winboll.cc": "https://www.winboll.cc";
|
||||
|
||||
try {
|
||||
mszAppVersionName = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;
|
||||
@@ -112,9 +115,13 @@ public class AboutView extends LinearLayout {
|
||||
}
|
||||
mszCurrentAppPackageName = mszAppAPKName + "_" + mszAppVersionName + ".apk";
|
||||
mszHomePage = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
|
||||
mszGitea = "https://gitea.winboll.cc/Studio/" + mszAppGitName + ".git";
|
||||
if(mAPPInfo.getAppGitAPPBranch().equals("")) {
|
||||
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName;
|
||||
} else {
|
||||
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName + "/src/branch/" + mAPPInfo.getAppGitAPPBranch() + "/" + mAPPInfo.getAppGitAPPSubProjectFolder();
|
||||
}
|
||||
|
||||
if (WinBollUtils.isDebug()) {
|
||||
if (GlobalApplication.isDebuging()) {
|
||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||
View addedView = inflater.inflate(R.layout.view_about_dev, this, false);
|
||||
LinearLayout llMain = addedView.findViewById(R.id.viewaboutdevLinearLayout1);
|
||||
@@ -205,7 +212,7 @@ public class AboutView extends LinearLayout {
|
||||
// 定义应用调试按钮
|
||||
//
|
||||
Element elementAppMode;
|
||||
if (WinBollUtils.isDebug()) {
|
||||
if (GlobalApplication.isDebuging()) {
|
||||
elementAppMode = new Element(mContext.getString(R.string.app_normal), R.drawable.ic_winboll);
|
||||
elementAppMode.setOnClickListener(mAppNormalOnClickListener);
|
||||
} else {
|
||||
@@ -237,7 +244,7 @@ public class AboutView extends LinearLayout {
|
||||
//.addItem(versionElement)
|
||||
//.addItem(adsElement)
|
||||
//.addGroup("Connect with us")
|
||||
.addEmail("ZhanGSKen@QQ.COM")
|
||||
.addEmail("ZhanGSKen@AliYun.Com")
|
||||
.addWebsite(mszHomePage)
|
||||
.addItem(elementAppMode)
|
||||
.addItem(elementGitWeb)
|
||||
@@ -271,7 +278,7 @@ public class AboutView extends LinearLayout {
|
||||
if (intent != null) {
|
||||
intent.setAction(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
WinBollUtils.setIsDebug(true);
|
||||
GlobalApplication.setIsDebuging(context, true);
|
||||
DebugBean.saveBean(context, new DebugBean(true));
|
||||
|
||||
WinBollActivityManager.getInstance(context).finishAll();
|
||||
@@ -283,7 +290,7 @@ public class AboutView extends LinearLayout {
|
||||
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
|
||||
if (intent != null) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
WinBollUtils.setIsDebug(false);
|
||||
GlobalApplication.setIsDebuging(context, false);
|
||||
DebugBean.saveBean(context, new DebugBean(false));
|
||||
|
||||
WinBollActivityManager.getInstance(context).finishAll();
|
||||
@@ -309,7 +316,7 @@ public class AboutView extends LinearLayout {
|
||||
String szUrl = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
|
||||
// 构建包含认证信息的请求
|
||||
String credential = "";
|
||||
if (WinBollUtils.isDebug()) {
|
||||
if (GlobalApplication.isDebuging()) {
|
||||
credential = Credentials.basic(metDevUserName.getText().toString(), metDevUserPassword.getText().toString());
|
||||
PrefUtils.saveString(mContext, "metDevUserName", metDevUserName.getText().toString());
|
||||
PrefUtils.saveString(mContext, "metDevUserPassword", metDevUserPassword.getText().toString());
|
||||
|
@@ -19,8 +19,8 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.service.IWinBollClientServiceBinder;
|
||||
import cc.winboll.studio.libapputils.service.WinBollClientService;
|
||||
import cc.winboll.studio.libapputils.service.WinBollClientServiceBean;
|
||||
|
@@ -15,6 +15,9 @@
|
||||
|
||||
<item android:title="DebugTools">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/item_testcrashreport"
|
||||
android:title="Test Application Crash Report"/>
|
||||
<item
|
||||
android:id="@+id/item_unittest"
|
||||
android:title="UnitTest"/>
|
||||
|
@@ -5,6 +5,9 @@
|
||||
<attr name="app_apkfoldername" format="string" />
|
||||
<attr name="app_apkname" format="string" />
|
||||
<attr name="app_gitname" format="string" />
|
||||
<attr name="app_gitowner" format="string" />
|
||||
<attr name="app_gitappbranch" format="string" />
|
||||
<attr name="app_gitappsubprojectfolder" format="string" />
|
||||
<attr name="appdescription" format="string" />
|
||||
<attr name="appicon" format="reference" />
|
||||
</declare-styleable>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="lib_name">library</string>
|
||||
<string name="lib_name">libapputils</string>
|
||||
<string name="app_normal">Click here is switch to Normal APP</string>
|
||||
<string name="app_debug">Click here is switch to APP DEBUG</string>
|
||||
<string name="gitea_home">GITEA HOME</string>
|
||||
|
Reference in New Issue
Block a user