Compare commits

...

27 Commits

Author SHA1 Message Date
ZhanGSKen
548dcf74ed <apputils>APK 9.3.0 release Publish. 2025-02-04 08:54:03 +08:00
ZhanGSKen
547bf894c6 更新类库 2025-02-04 08:53:03 +08:00
ZhanGSKen
09e6429726 <libapputils>Library Release 9.2.17 2025-01-23 14:51:10 +08:00
ZhanGSKen
3ad9bb262e <apputils>APK 9.2.17 release Publish. 2025-01-23 14:50:49 +08:00
ZhanGSKen
15992da22f 添加Application返回函数 2025-01-23 14:49:56 +08:00
ZhanGSKen
7fb4e665f9 <libapputils>Library Release 9.2.16 2025-01-23 14:30:38 +08:00
ZhanGSKen
6a82889926 <apputils>APK 9.2.16 release Publish. 2025-01-23 14:30:15 +08:00
ZhanGSKen
7272cc4e5b 更新类库,添加应用上下文函数 2025-01-23 14:28:54 +08:00
ZhanGSKen
1f7d112a8a <libapputils>Library Release 9.2.15 2025-01-23 14:03:05 +08:00
ZhanGSKen
936e214015 <apputils>APK 9.2.15 release Publish. 2025-01-23 14:02:45 +08:00
ZhanGSKen
46e95d1b1f 增加容错调试能力 2025-01-23 14:01:42 +08:00
ZhanGSKen
15173f7af3 <libapputils>Library Release 9.2.14 2025-01-23 04:27:34 +08:00
ZhanGSKen
6f3b6c40af <apputils>APK 9.2.14 release Publish. 2025-01-23 04:27:21 +08:00
ZhanGSKen
42ffba69e5 更新联系邮件 2025-01-23 04:26:52 +08:00
ZhanGSKen
f021e8a1a3 <libapputils>Library Release 9.2.13 2025-01-23 04:05:47 +08:00
ZhanGSKen
02ce7dedb0 <apputils>APK 9.2.13 release Publish. 2025-01-23 04:05:32 +08:00
ZhanGSKen
8e290cd5e6 应用介绍添加 Gitea 拥有者属性 2025-01-23 04:04:45 +08:00
ZhanGSKen
37f2aa5f1b <libapputils>Library Release 9.2.12 2025-01-23 03:47:38 +08:00
ZhanGSKen
10cc69940b <apputils>APK 9.2.12 release Publish. 2025-01-23 03:47:26 +08:00
ZhanGSKen
bfdff9ff2f 日志类BugFix 2025-01-23 03:46:57 +08:00
ZhanGSKen
12c6129a61 <libapputils>Library Release 9.2.11 2025-01-23 03:34:10 +08:00
ZhanGSKen
ea10d1b540 <apputils>APK 9.2.11 release Publish. 2025-01-23 03:33:58 +08:00
ZhanGSKen
81f6ff592e 应用类调整 2025-01-23 03:33:26 +08:00
ZhanGSKen
e6f22e9212 <libapputils>Library Release 9.2.10 2025-01-23 03:05:52 +08:00
ZhanGSKen
8ce8f383fa <apputils>APK 9.2.10 release Publish. 2025-01-23 03:05:41 +08:00
ZhanGSKen
35d32b384f 应用类重构 2025-01-23 03:05:08 +08:00
ZhanGSKen
85e86ddf05 <libapputils>Library Release 9.2.9 2025-01-23 02:44:03 +08:00
14 changed files with 85 additions and 51 deletions

View File

@@ -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'])
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Thu Jan 23 02:43:51 HKT 2025
stageCount=10
#Tue Feb 04 08:54:03 HKT 2025
stageCount=1
libraryProject=libapputils
baseVersion=9.2
publishVersion=9.2.9
baseVersion=9.3
publishVersion=9.3.0
buildCount=0
baseBetaVersion=9.2.10
baseBetaVersion=9.3.1

View File

@@ -5,10 +5,8 @@ package cc.winboll.studio.apputils;
* @Date 2024/12/08 15:10:51
* @Describe 全局应用类
*/
import android.view.Gravity;
import android.widget.Toast;
import cc.winboll.studio.libapputils.app.WinBollGlobalApplication;
import com.hjq.toast.ToastUtils;
import com.hjq.toast.style.WhiteToastStyle;
public class App extends WinBollGlobalApplication {
@@ -19,12 +17,7 @@ public class App extends WinBollGlobalApplication {
@Override
public void onCreate() {
super.onCreate();
// 初始化 Toast 框架
ToastUtils.init(this);
// 设置 Toast 布局样式
//ToastUtils.setView(R.layout.view_toast);
ToastUtils.setStyle(new WhiteToastStyle());
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
Toast.makeText(getApplication(), "Toast Test", Toast.LENGTH_SHORT).show();
}
}

View File

@@ -174,6 +174,7 @@ final public class MainActivity extends WinBollActivity {
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
appInfo.setAppDescription("APPUtils Description");
appInfo.setAppGitName("APP");
appInfo.setAppGitOwner("Studio");
appInfo.setAppGitAPPBranch("apputils");
appInfo.setAppGitAPPSubProjectFolder("apputils");
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");

View File

@@ -38,7 +38,7 @@ dependencies {
api 'androidx.fragment:fragment:1.0.0'
api 'com.google.android.material:material:1.0.0'
api 'cc.winboll.studio:libappbase:1.1.0'
api 'cc.winboll.studio:libappbase:1.1.3'
api fileTree(dir: 'libs', include: ['*.jar'])
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Thu Jan 23 02:43:51 HKT 2025
stageCount=10
#Tue Feb 04 08:54:03 HKT 2025
stageCount=1
libraryProject=libapputils
baseVersion=9.2
publishVersion=9.2.9
baseVersion=9.3
publishVersion=9.3.0
buildCount=0
baseBetaVersion=9.2.10
baseBetaVersion=9.3.1

View File

@@ -8,7 +8,6 @@ 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;
@@ -17,12 +16,10 @@ public class MyActivityLifecycleCallbacks implements Application.ActivityLifecyc
public static final String TAG = "MyActivityLifecycleCallbacks";
Application mApplication;
public String mInfo = "";
public MyActivityLifecycleCallbacks(Application application) {
mApplication = application;
public MyActivityLifecycleCallbacks() {
}
void createActivityeInfo(Activity activity) {

View File

@@ -365,7 +365,11 @@ abstract public class WinBollActivity extends AppCompatActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
LogUtils.d(TAG, "onOptionsItemSelected");
if (item.getItemId() == R.id.item_log) {
if (item.getItemId() == R.id.item_testcrashreport) {
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
getString(i);
}
} else 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);

View File

@@ -3,11 +3,12 @@ package cc.winboll.studio.libapputils.app;
import android.app.Application;
import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;
import cc.winboll.studio.libappbase.GlobalApplication;
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;
import cc.winboll.studio.GlobalApplication;
public class WinBollGlobalApplication extends GlobalApplication {
@@ -27,7 +28,7 @@ public class WinBollGlobalApplication extends GlobalApplication {
// 标记当前应用是否处于调试状态
static volatile boolean isDebug = false;
public static void setIsDebug(boolean isDebug) {
public synchronized static void setIsDebug(boolean isDebug) {
WinBollGlobalApplication.isDebug = isDebug;
}
@@ -38,7 +39,7 @@ public class WinBollGlobalApplication extends GlobalApplication {
//
// 设置 WinBoll 应用 UI 类型
//
public static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
public synchronized static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
_mWinBollUI_TYPE = mWinBollUI_TYPE;
}
@@ -53,6 +54,16 @@ public class WinBollGlobalApplication extends GlobalApplication {
return mMyActivityLifecycleCallbacks;
}
@Override
public Context getApplicationContext() {
return super.getApplicationContext();
}
@Override
public Application getApplication() {
return this;
}
@Override
public void onCreate() {
super.onCreate();
@@ -60,21 +71,33 @@ public class WinBollGlobalApplication extends GlobalApplication {
//
// 初始化日志模块
LogUtils.init(this);
// 设置应用调试标志
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());
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 类型
setWinBollUI_TYPE(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();
}
// 应用窗口管理模块参数设置
//
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(this);
registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
// 设置默认 WinBoll 应用 UI 类型
setWinBollUI_TYPE(WinBollUI_TYPE.Service);
//ToastUtils.show("WinBollUI_TYPE " + getWinBollUI_TYPE());
}
}

View File

@@ -20,6 +20,8 @@ public class APPInfo implements Serializable {
String appDescription;
// 应用Git仓库地址
String appGitName;
// 应用Git仓库拥有者
String appGitOwner;
// 应用Git仓库分支
String appGitAPPBranch;
// 应用Git仓库子项目文件夹
@@ -31,11 +33,12 @@ public class APPInfo implements Serializable {
// 应用包存储文件夹名称
String appAPKFolderName;
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitAPPBranch, String appGitAPPSubProjectFolder, 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;
@@ -48,6 +51,7 @@ public class APPInfo implements Serializable {
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";
@@ -55,6 +59,14 @@ public class APPInfo implements Serializable {
this.appAPKFolderName = "APP";
}
public void setAppGitOwner(String appGitOwner) {
this.appGitOwner = appGitOwner;
}
public String getAppGitOwner() {
return appGitOwner;
}
public void setAppGitAPPBranch(String appGitAPPBranch) {
this.appGitAPPBranch = appGitAPPBranch;
}

View File

@@ -174,8 +174,9 @@ public class LogUtils {
mapTAGList.put(tagValue, false);
}
}
} catch (ClassNotFoundException | IllegalAccessException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
} catch (NoClassDefFoundError | ClassNotFoundException | IllegalAccessException e) {
LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace());
//LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
//Toast.makeText(context, TAG + " : " + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}

View File

@@ -88,6 +88,7 @@ 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));
@@ -114,7 +115,7 @@ public class AboutView extends LinearLayout {
}
mszCurrentAppPackageName = mszAppAPKName + "_" + mszAppVersionName + ".apk";
mszHomePage = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
mszGitea = "https://gitea.winboll.cc/Studio/" + mszAppGitName + "/src/branch/" + mAPPInfo.getAppGitAPPBranch() + "/" + mAPPInfo.getAppGitAPPSubProjectFolder();
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName + "/src/branch/" + mAPPInfo.getAppGitAPPBranch() + "/" + mAPPInfo.getAppGitAPPSubProjectFolder();
if (WinBollGlobalApplication.isDebug()) {
LayoutInflater inflater = LayoutInflater.from(mContext);
@@ -239,7 +240,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)

View File

@@ -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"/>

View File

@@ -5,6 +5,7 @@
<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" />