Compare commits
93 Commits
app-v15.0.
...
apputils-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e339c0f51 | ||
|
|
c20975cfca | ||
|
|
ed5f91f299 | ||
|
|
0031100219 | ||
|
|
f9e7d362b7 | ||
|
|
8d9d308c68 | ||
|
|
d3b12207e0 | ||
|
|
a2e963b53e | ||
|
|
41c0394c4a | ||
|
|
d2a84f554b | ||
|
|
d1e3e27f20 | ||
|
|
f9242bfc9a | ||
|
|
bf37eb61bb | ||
|
|
6fd1513d6b | ||
|
|
394d75e5a2 | ||
|
|
378e9168b6 | ||
|
|
a3fa570b50 | ||
|
|
7662d1c153 | ||
|
|
ac7b5bb1a2 | ||
|
|
eeae184e7e | ||
|
|
d5f34ad618 | ||
|
|
3ad1863a5f | ||
|
|
291080aa15 | ||
|
|
973a0ff94f | ||
|
|
e04ea7f035 | ||
|
|
ecbaf639a0 | ||
|
|
050fd46d81 | ||
|
|
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 | ||
|
|
4968bbaeae | ||
|
|
8e6b06e366 | ||
|
|
ae7fb2984a | ||
|
|
a4d009f8fb | ||
|
|
5a549e9652 | ||
|
|
e2d71ae088 | ||
|
|
506d2619f2 | ||
|
|
17fa805a7f | ||
|
|
1dcf8cd007 | ||
|
|
d86d50212e | ||
|
|
af2e09c02a | ||
|
|
de6361b19b |
20
README.md
20
README.md
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
## WinBoll 项目组研发计划
|
## WinBoll 项目组研发计划
|
||||||
致力于把 WinBoll-APP 应用在手机端 Android 项目开发。
|
致力于把 WinBoll-APP 应用在手机端 Android 项目开发。
|
||||||
也在探索 https://gitea.winboll.cc/<WinBoll 项目组>/APP.git 应用于 WinBoll-APP APK 分发。
|
也在探索 https://gitea.winboll.cc/<WinBoll 项目组>/WinBoll-APP.git 应用于 WinBoll-APP APK 分发。
|
||||||
更想进阶 https://github.com/<WinBoll 项目组>/APP.git 应用于 WinBoll-APP Beta APK 分发。
|
更想进阶 https://github.com/<WinBoll 项目组>/WinBoll-APP.git 应用于 WinBoll-APP Beta APK 分发。
|
||||||
|
|
||||||
## WinBoll-APP 汗下...
|
## WinBoll-APP 汗下...
|
||||||
#### ☁应用何置如此呢。且观用户云云。
|
#### ☁应用何置如此呢。且观用户云云。
|
||||||
@@ -55,10 +55,10 @@
|
|||||||
☁ WinBoll 主机建立 1Panel Gitea 应用。
|
☁ WinBoll 主机建立 1Panel Gitea 应用。
|
||||||
☁ WinBoll 主机设置 WinBoll 应用为非登录状态。
|
☁ WinBoll 主机设置 WinBoll 应用为非登录状态。
|
||||||
☁ WinBoll 主机建立 WinBoll 账户与 WinBoll 用户组。
|
☁ WinBoll 主机建立 WinBoll 账户与 WinBoll 用户组。
|
||||||
☁ WinBoll 账户 User ID 为: J。
|
☁ WinBoll 账户 User ID 为: winboll。
|
||||||
☁ WinBoll 用户组 Group ID 为: Studio。
|
☁ WinBoll 用户组 Group ID 为: winboll。
|
||||||
☁ WinBoll 主机 WinBoll 1Panel Gitea 建立 WinBoll 工作组。
|
☁ WinBoll 主机 WinBoll 1Panel Gitea 建立 WinBoll 工作组。
|
||||||
☁ WinBoll 主机 WinBoll 1Panel Gitea 用户项目 APK 编译输出目录为 /sdcard/WinBollStudio/<用户名>/APKs/
|
☁ WinBoll 主机 WinBoll 1Panel Gitea 用户项目 APK 编译输出目录为 /sdcard/<用户名>/WinBoll/app/
|
||||||
☁ WinBoll 项目配置文件示例为 "<WinBoll 项目根目录>/.winboll/winboll.properties-demo"(WinBoll 项目已设置)
|
☁ WinBoll 项目配置文件示例为 "<WinBoll 项目根目录>/.winboll/winboll.properties-demo"(WinBoll 项目已设置)
|
||||||
☁ WinBoll 项目配置文件为 "<WinBoll 项目根目录>/.winboll/winboll.properties"
|
☁ WinBoll 项目配置文件为 "<WinBoll 项目根目录>/.winboll/winboll.properties"
|
||||||
☁ WinBoll 项目配置文件设定为源码提交时忽略。(WinBoll 项目已设置)
|
☁ WinBoll 项目配置文件设定为源码提交时忽略。(WinBoll 项目已设置)
|
||||||
@@ -72,17 +72,17 @@
|
|||||||
☁ MySQL winbollclient 数据库中
|
☁ MySQL winbollclient 数据库中
|
||||||
WinBoll 客户端用户信息设定为:
|
WinBoll 客户端用户信息设定为:
|
||||||
<用户名, 验证密码, 验证邮箱, 验证手机, 唯一存储令牌Token, 备用验证邮箱>。
|
<用户名, 验证密码, 验证邮箱, 验证手机, 唯一存储令牌Token, 备用验证邮箱>。
|
||||||
☁ WinBoll 项目源码仓库托管在 WinBoll 1Panel Gitea 目录 /opt/1panel/apps/gitea/gitea/data/git/repositories/studio/app.git中。
|
☁ WinBoll 项目源码仓库托管在 WinBoll 1Panel Gitea 目录 /opt/1panel/apps/gitea/gitea/data/git/repositories/winboll/winboll.git中。
|
||||||
☁ WinBoll 主机提供 WinBoll 1Panel Gitea 应用的 WinBoll 项目源码仓库存取功能。(Gitea 应用已提供)
|
☁ WinBoll 主机提供 WinBoll 1Panel Gitea 应用的 WinBoll 项目源码仓库存取功能。(Gitea 应用已提供)
|
||||||
☁ WinBoll 主机提供 WinBoll Gitea 项目仓库存档功能。(Gitea 应用已提供)
|
☁ WinBoll 主机提供 WinBoll Gitea 项目仓库存档功能。(Gitea 应用已提供)
|
||||||
☁ 提供 WinBoll 客户端用户登录功能。(Gitea 应用已提供)
|
☁ 提供 WinBoll 客户端用户登录功能。(Gitea 应用已提供)
|
||||||
|
|
||||||
### ☁ 看远方 ☁ ###
|
### ☁ 看远方 ☁ ###
|
||||||
### ☁ 心忧虑 ☁ WinBoll-APP 应用前置需求
|
### ☁ 心忧虑 ☁ WinBoll-APP 应用前置需求
|
||||||
☁ WinBoll-APP WinBoll 项目根目录设定为手机的 /sdcard/WinBollStudio/Sources 目录。(需要用户手动建立文件夹)
|
☁ WinBoll-APP WinBoll 项目根目录设定为手机的 /sdcard/WinBoll 目录。(需要用户手动建立文件夹)
|
||||||
☁ WinBoll-APP 具有手机 /sdcard/WinBoll 目录的存储权限。(需要手机操作系统授权)
|
☁ WinBoll-APP 具有手机 /sdcard/WinBoll 目录的存储权限。(需要手机操作系统授权)
|
||||||
☁ WinBoll-APP WinBoll 项目仓库源码存储路径为 /sdcard/WinBollStudio/Sources/APP.git(需要用户手动建立文件夹)
|
☁ WinBoll-APP WinBoll 项目仓库源码存储路径为 /sdcard/WinBoll/repositories/winboll.git(需要用户手动建立文件夹)
|
||||||
☁ WinBoll-APP 项目 APK 编译输出目录为 /sdcard/WinBollStudio/APKs/
|
☁ WinBoll-APP 项目 APK 编译输出目录为 /sdcard/WinBoll/app/
|
||||||
☁ WinBoll-APP 应用签名验证可定制化。(WinBoll 项目已提供)
|
☁ WinBoll-APP 应用签名验证可定制化。(WinBoll 项目已提供)
|
||||||
☁ WinBoll-APP 与系列衍生 APP 应用共享 cc.winboll.studio 命名空间资源。(WinBoll 项目已提供)
|
☁ WinBoll-APP 与系列衍生 APP 应用共享 cc.winboll.studio 命名空间资源。(WinBoll 项目已提供)
|
||||||
☁ WinBoll-APP 用户客户端信息存储在命名空间为 WinBoll APP MySQLLite 应用的 winbollappclient 数据库中。
|
☁ WinBoll-APP 用户客户端信息存储在命名空间为 WinBoll APP MySQLLite 应用的 winbollappclient 数据库中。
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
### ☁ 云游四方 ☁ ###
|
### ☁ 云游四方 ☁ ###
|
||||||
### ☁ 呔! ☁ WinBoll-APP 应用需求规划
|
### ☁ 呔! ☁ WinBoll-APP 应用需求规划
|
||||||
☁ WinBoll-APP 提供手机目录 /sdcard/WinBollStudio/Sources 的 WinBoll 项目源码管理功能。
|
☁ WinBoll-APP 提供手机目录 /sdcard/WinBoll 的 WinBoll 项目源码管理功能。
|
||||||
|
|
||||||
### ☁ 吁! ☁ WinBoll-APP 共享计划前景
|
### ☁ 吁! ☁ WinBoll-APP 共享计划前景
|
||||||
☁ WinBoll-APP 将会实现 https://winboll.cc/api 访问功能。
|
☁ WinBoll-APP 将会实现 https://winboll.cc/api 访问功能。
|
||||||
|
|||||||
@@ -19,17 +19,17 @@ def genVersionName(def versionName){
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.aes"
|
applicationId "cc.winboll.studio.aes"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.2"
|
versionName "7.6"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -41,9 +41,29 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':libaes')
|
api project(':libaes')
|
||||||
|
|
||||||
|
//api 'cc.winboll.studio:winboll-shared:1.6.5'
|
||||||
|
api 'io.github.medyo:android-about-page:2.0.0'
|
||||||
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
api 'com.jcraft:jsch:0.1.55'
|
||||||
|
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 'cc.winboll.studio:libapputils:9.2.1'
|
||||||
|
api 'cc.winboll.studio:libappbase:1.0.3'
|
||||||
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 31 19:41:19 HKT 2025
|
#Sun Jan 19 04:58:59 GMT 2025
|
||||||
stageCount=5
|
stageCount=3
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=7.6
|
||||||
publishVersion=15.2.4
|
publishVersion=7.6.2
|
||||||
buildCount=0
|
buildCount=4
|
||||||
baseBetaVersion=15.2.5
|
baseBetaVersion=7.6.3
|
||||||
|
|||||||
@@ -8,10 +8,9 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/MyAESTheme"
|
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true">
|
||||||
android:networkSecurityConfig="@xml/network_security_config">
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
@@ -31,8 +30,6 @@
|
|||||||
android:name="android.max_aspect"
|
android:name="android.max_aspect"
|
||||||
android:value="4.0"/>
|
android:value="4.0"/>
|
||||||
|
|
||||||
<activity android:name=".AboutActivity"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
package cc.winboll.studio.aes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/24 23:52:29
|
|
||||||
* @Describe AES应用介绍窗口
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.libaes.winboll.APPInfo;
|
|
||||||
import cc.winboll.studio.libaes.winboll.AboutView;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class AboutActivity extends WinBollActivity implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "AboutActivity";
|
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
Toolbar mToolbar;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
mContext = this;
|
|
||||||
setContentView(R.layout.activity_about);
|
|
||||||
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
mToolbar.setSubtitle(TAG);
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
|
|
||||||
AboutView aboutView = CreateAboutView();
|
|
||||||
// 在 Activity 的 onCreate 或其他生命周期方法中调用
|
|
||||||
// LinearLayout layout = new LinearLayout(this);
|
|
||||||
// layout.setOrientation(LinearLayout.VERTICAL);
|
|
||||||
// // 创建布局参数(宽度和高度)
|
|
||||||
// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
|
||||||
// ViewGroup.LayoutParams.MATCH_PARENT,
|
|
||||||
// ViewGroup.LayoutParams.MATCH_PARENT
|
|
||||||
// );
|
|
||||||
// addContentView(aboutView, params);
|
|
||||||
|
|
||||||
LinearLayout layout = findViewById(R.id.aboutviewroot_ll);
|
|
||||||
// 创建布局参数(宽度和高度)
|
|
||||||
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT
|
|
||||||
);
|
|
||||||
layout.addView(aboutView, params);
|
|
||||||
|
|
||||||
GlobalApplication.getWinBollActivityManager().add(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
GlobalApplication.getWinBollActivityManager().registeRemove(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AboutView CreateAboutView() {
|
|
||||||
String szBranchName = "aes";
|
|
||||||
APPInfo appInfo = new APPInfo();
|
|
||||||
appInfo.setAppName("AES");
|
|
||||||
appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll);
|
|
||||||
appInfo.setAppDescription("AES Description");
|
|
||||||
appInfo.setAppGitName("APP");
|
|
||||||
appInfo.setAppGitOwner("Studio");
|
|
||||||
appInfo.setAppGitAPPBranch(szBranchName);
|
|
||||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
|
||||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES");
|
|
||||||
appInfo.setAppAPKName("AES");
|
|
||||||
appInfo.setAppAPKFolderName("AES");
|
|
||||||
return new AboutView(mContext, appInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,8 +6,6 @@ package cc.winboll.studio.aes;
|
|||||||
* @Describe AES应用类
|
* @Describe AES应用类
|
||||||
*/
|
*/
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
|
|
||||||
|
|
||||||
public class App extends GlobalApplication {
|
public class App extends GlobalApplication {
|
||||||
|
|
||||||
@@ -16,8 +14,7 @@ public class App extends GlobalApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
ToastUtils.init(this);
|
//setIsDebug(BuildConfig.DEBUG);
|
||||||
//ToastUtils.show("App onCreate");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,193 +5,12 @@ package cc.winboll.studio.aes;
|
|||||||
* @Date 2024/06/13 19:05:52
|
* @Date 2024/06/13 19:05:52
|
||||||
* @Describe 应用主窗口
|
* @Describe 应用主窗口
|
||||||
*/
|
*/
|
||||||
import android.app.Activity;
|
import cc.winboll.studio.libaes.unittests.LibraryActivity;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import cc.winboll.studio.aes.R;
|
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
|
||||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
|
||||||
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
|
|
||||||
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
|
|
||||||
import cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity;
|
|
||||||
import cc.winboll.studio.libaes.unittests.TestAButtonFragment;
|
|
||||||
import cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity;
|
|
||||||
import cc.winboll.studio.libaes.unittests.TestAToolbarActivity;
|
|
||||||
import cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity;
|
|
||||||
import cc.winboll.studio.libaes.unittests.TestViewPageFragment;
|
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class MainActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
public class MainActivity extends LibraryActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "MainActivity";
|
||||||
public static final String TAG = "MainActivity";
|
|
||||||
|
|
||||||
TestAButtonFragment mTestAButtonFragment;
|
|
||||||
TestViewPageFragment mTestViewPageFragment;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
if (mTestAButtonFragment == null) {
|
|
||||||
mTestAButtonFragment = new TestAButtonFragment();
|
|
||||||
addFragment(mTestAButtonFragment);
|
|
||||||
}
|
|
||||||
showFragment(mTestAButtonFragment);
|
|
||||||
//setSubtitle(TAG);
|
|
||||||
//ToastUtils.show("onCreate");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
|
||||||
super.initDrawerMenuItemList(listDrawerMenu);
|
|
||||||
LogUtils.d(TAG, "initDrawerMenuItemList");
|
|
||||||
//listDrawerMenu.clear();
|
|
||||||
// 添加抽屉菜单项
|
|
||||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
|
||||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
|
||||||
notifyDrawerMenuDataChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
|
||||||
super.reinitDrawerMenuItemList(listDrawerMenu);
|
|
||||||
LogUtils.d(TAG, "reinitDrawerMenuItemList");
|
|
||||||
//listDrawerMenu.clear();
|
|
||||||
// 添加抽屉菜单项
|
|
||||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
|
||||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
|
||||||
notifyDrawerMenuDataChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DrawerFragmentActivity.ActivityType initActivityType() {
|
|
||||||
return DrawerFragmentActivity.ActivityType.Main;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_library, menu);
|
|
||||||
if(App.isDebuging()) {
|
|
||||||
getMenuInflater().inflate(cc.winboll.studio.libapputils.R.menu.toolbar_studio_debug, menu);
|
|
||||||
}
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
super.onItemClick(parent, view, position, id);
|
|
||||||
switch (position) {
|
|
||||||
case 0 : {
|
|
||||||
if (mTestAButtonFragment == null) {
|
|
||||||
mTestAButtonFragment = new TestAButtonFragment();
|
|
||||||
addFragment(mTestAButtonFragment);
|
|
||||||
}
|
|
||||||
showFragment(mTestAButtonFragment);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1 : {
|
|
||||||
if (mTestViewPageFragment == null) {
|
|
||||||
mTestViewPageFragment = new TestViewPageFragment();
|
|
||||||
addFragment(mTestViewPageFragment);
|
|
||||||
}
|
|
||||||
showFragment(mTestViewPageFragment);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int nItemId = item.getItemId();
|
|
||||||
// if (item.getItemId() == R.id.item_log) {
|
|
||||||
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
|
|
||||||
// } else
|
|
||||||
if (nItemId == R.id.item_atoast) {
|
|
||||||
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
|
|
||||||
} else if (nItemId == R.id.item_atoolbar) {
|
|
||||||
Intent intent = new Intent(this, TestAToolbarActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
} else if (nItemId == R.id.item_asupporttoolbar) {
|
|
||||||
Intent intent = new Intent(this, TestASupportToolbarActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
} else if (nItemId == R.id.item_colordialog) {
|
|
||||||
ColorPickerDialog dlg = new ColorPickerDialog(this, getResources().getColor(R.color.colorPrimary));
|
|
||||||
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeColorChanged() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onColorChanged(int color) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterColorChanged() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
dlg.show();
|
|
||||||
|
|
||||||
} else if (nItemId == R.id.item_dialogstoragepath) {
|
|
||||||
final StoragePathDialog dialog = new StoragePathDialog(this, 0);
|
|
||||||
dialog.setOnOKClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dialog.show();
|
|
||||||
|
|
||||||
} else if (nItemId == R.id.item_localfileselectdialog) {
|
|
||||||
final LocalFileSelectDialog dialog = new LocalFileSelectDialog(this);
|
|
||||||
dialog.setOnOKClickListener(new LocalFileSelectDialog.OKClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onOKClick(String sz) {
|
|
||||||
Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
|
|
||||||
//dialog.dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dialog.open();
|
|
||||||
|
|
||||||
} else if (nItemId == R.id.item_secondarylibraryactivity) {
|
|
||||||
Intent intent = new Intent(this, SecondaryLibraryActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
} else if (nItemId == R.id.item_drawerfragmentactivity) {
|
|
||||||
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
else if (nItemId == R.id.item_about) {
|
|
||||||
Intent intent = new Intent(this, AboutActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
package cc.winboll.studio.aes;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/30 00:34:02
|
|
||||||
* @Describe WinBoll 活动窗口通用基类
|
|
||||||
*/
|
|
||||||
public class WinBollActivity extends AppCompatActivity implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "WinBollActivity";
|
|
||||||
|
|
||||||
protected volatile AESThemeBean.ThemeType mThemeType;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
mThemeType = getThemeType();
|
|
||||||
setThemeStyle();
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
AESThemeBean.ThemeType getThemeType() {
|
|
||||||
/*SharedPreferences sharedPreferences = getSharedPreferences(
|
|
||||||
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
|
||||||
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
|
||||||
*/
|
|
||||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void setThemeStyle() {
|
|
||||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
|
||||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if(item.getItemId() == android.R.id.home) {
|
|
||||||
finish();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/toolbar"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/aboutviewroot_ll"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="colorPrimary">#FF00B322</color>
|
|
||||||
<color name="colorPrimaryDark">#FF005C12</color>
|
|
||||||
<color name="colorAccent">#FF8DFFA2</color>
|
|
||||||
<color name="colorText">#FFFFFB8D</color>
|
|
||||||
</resources>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="MyAESTheme" parent="AESTheme">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<network-security-config>
|
|
||||||
<domain-config cleartextTrafficPermitted="true">
|
|
||||||
<domain includeSubdomains="true">winboll.cc</domain>
|
|
||||||
</domain-config>
|
|
||||||
</network-security-config>
|
|
||||||
@@ -18,18 +18,25 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
productFlavors {
|
||||||
buildToolsVersion "32.0.0"
|
beta {
|
||||||
|
}
|
||||||
|
stage {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileSdkVersion 30
|
||||||
|
buildToolsVersion "30.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.androiddemo"
|
applicationId "cc.winboll.studio.androiddemo"
|
||||||
minSdkVersion 24
|
minSdkVersion 26
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.0"
|
versionName "1.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -46,26 +53,22 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
|
// 吐司类库
|
||||||
|
implementation 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
|
||||||
// Android 类库
|
// Android 类库
|
||||||
//api 'com.android.support:appcompat-v7:28.0.0'
|
|
||||||
api('com.android.support:appcompat-v7:28.0.0'){
|
|
||||||
exclude group: "com.android.support", module: "support-vector-drawable"
|
|
||||||
}
|
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
|
||||||
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||||
api 'com.android.support:support-v4:28.0.0'
|
implementation 'com.android.support:support-v4:28.0.0'
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||||
|
implementation 'com.android.support:support-compat:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
||||||
api 'com.android.support:support-media-compat:28.0.0'
|
implementation 'com.android.support:support-media-compat:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
||||||
api 'com.android.support:support-core-utils:28.0.0'
|
implementation 'com.android.support:support-core-utils:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
||||||
api 'com.android.support:support-core-ui:28.0.0'
|
implementation 'com.android.support:support-core-ui:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
||||||
api 'com.android.support:support-fragment:28.0.0'
|
implementation 'com.android.support:support-fragment:28.0.0'
|
||||||
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
||||||
api 'com.android.support:recyclerview-v7:28.0.0'
|
implementation 'com.android.support:recyclerview-v7:28.0.0'
|
||||||
|
|
||||||
api 'cc.winboll.studio:libapputils:15.2.1'
|
|
||||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 04:34:14 GMT 2025
|
#Tue Mar 11 18:02:14 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=1.0
|
||||||
publishVersion=15.0.0
|
publishVersion=1.0.0
|
||||||
buildCount=15
|
buildCount=1
|
||||||
baseBetaVersion=15.0.1
|
baseBetaVersion=1.0.1
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:name=".App">
|
android:name=".GlobalApplication">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package cc.winboll.studio.androiddemo;
|
package cc.winboll.studio.androiddemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.Application;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -21,7 +22,6 @@ import android.widget.HorizontalScrollView;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
@@ -39,15 +39,15 @@ import java.util.Date;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class App extends GlobalApplication {
|
public class GlobalApplication extends Application {
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
//CrashHandler.getInstance().registerGlobal(this);
|
CrashHandler.getInstance().registerGlobal(this);
|
||||||
//CrashHandler.getInstance().registerPart(this);
|
CrashHandler.getInstance().registerPart(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(InputStream input, OutputStream output) throws IOException {
|
public static void write(InputStream input, OutputStream output) throws IOException {
|
||||||
@@ -252,7 +252,7 @@ public class App extends GlobalApplication {
|
|||||||
|
|
||||||
private static String getKernel() {
|
private static String getKernel() {
|
||||||
try {
|
try {
|
||||||
return App.toString(new FileInputStream("/proc/version")).trim();
|
return GlobalApplication.toString(new FileInputStream("/proc/version")).trim();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
return e.getMessage();
|
return e.getMessage();
|
||||||
}
|
}
|
||||||
@@ -331,4 +331,4 @@ public class App extends GlobalApplication {
|
|||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,15 @@
|
|||||||
package cc.winboll.studio.androiddemo;
|
package cc.winboll.studio.androiddemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
|
||||||
|
public class MainActivity extends Activity {
|
||||||
public class MainActivity extends Activity {
|
|
||||||
|
@Override
|
||||||
LogView mLogView;
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
@Override
|
setContentView(R.layout.activity_main);
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
}
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
}
|
||||||
mLogView = findViewById(R.id.logview);
|
|
||||||
mLogView.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
mLogView.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,34 +4,13 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:gravity="center_vertical|center_horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:text="Android Demo"
|
||||||
android:layout_weight="1.0">
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Android Demo"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1.0">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Text"
|
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -18,18 +18,25 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
productFlavors {
|
||||||
buildToolsVersion "32.0.0"
|
beta {
|
||||||
|
}
|
||||||
|
stage {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileSdkVersion 30
|
||||||
|
buildToolsVersion "30.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.androidxdemo"
|
applicationId "cc.winboll.studio.androidxdemo"
|
||||||
minSdkVersion 24
|
minSdkVersion 26
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.0"
|
versionName "1.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -47,27 +54,23 @@ dependencies {
|
|||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
// SSH
|
// SSH
|
||||||
api 'com.jcraft:jsch:0.1.55'
|
implementation 'com.jcraft:jsch:0.1.55'
|
||||||
// Html 解析
|
// Html 解析
|
||||||
api 'org.jsoup:jsoup:1.13.1'
|
implementation 'org.jsoup:jsoup:1.13.1'
|
||||||
// 二维码类库
|
// 二维码类库
|
||||||
api 'com.google.zxing:core:3.4.1'
|
implementation 'com.google.zxing:core:3.4.1'
|
||||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||||
// 应用介绍页类库
|
// 应用介绍页类库
|
||||||
api 'io.github.medyo:android-about-page:2.0.0'
|
implementation 'io.github.medyo:android-about-page:2.0.0'
|
||||||
// 吐司类库
|
// 吐司类库
|
||||||
api 'com.github.getActivity:ToastUtils:10.5'
|
implementation 'com.github.getActivity:ToastUtils:10.5'
|
||||||
// 网络连接类库
|
// 网络连接类库
|
||||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
// AndroidX 类库
|
// Android 类库
|
||||||
api 'androidx.appcompat:appcompat:1.1.0'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
api 'com.google.android.material:material:1.4.0'
|
implementation 'androidx.viewpager:viewpager:1.0.0'
|
||||||
//api 'androidx.viewpager:viewpager:1.0.0'
|
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||||
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
implementation 'androidx.fragment:fragment:1.1.0'
|
||||||
//api 'androidx.fragment:fragment:1.1.0'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
|
|
||||||
api 'cc.winboll.studio:libaes:15.2.4'
|
|
||||||
api 'cc.winboll.studio:libapputils:15.2.1'
|
|
||||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 31 11:42:18 GMT 2025
|
#Tue Mar 11 18:25:43 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=1.0
|
||||||
publishVersion=15.0.0
|
publishVersion=1.0.0
|
||||||
buildCount=13
|
buildCount=4
|
||||||
baseBetaVersion=15.0.1
|
baseBetaVersion=1.0.1
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/MyAppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:name=".App">
|
android:name=".GlobalApplication">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
@@ -34,4 +34,4 @@
|
|||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package cc.winboll.studio.androidxdemo;
|
package cc.winboll.studio.androidxdemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.Application;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -21,7 +22,6 @@ import android.widget.HorizontalScrollView;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
@@ -39,15 +39,15 @@ import java.util.Date;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class App extends GlobalApplication {
|
public class GlobalApplication extends Application {
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
//CrashHandler.getInstance().registerGlobal(this);
|
CrashHandler.getInstance().registerGlobal(this);
|
||||||
//CrashHandler.getInstance().registerPart(this);
|
CrashHandler.getInstance().registerPart(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(InputStream input, OutputStream output) throws IOException {
|
public static void write(InputStream input, OutputStream output) throws IOException {
|
||||||
@@ -252,7 +252,7 @@ public class App extends GlobalApplication {
|
|||||||
|
|
||||||
private static String getKernel() {
|
private static String getKernel() {
|
||||||
try {
|
try {
|
||||||
return App.toString(new FileInputStream("/proc/version")).trim();
|
return GlobalApplication.toString(new FileInputStream("/proc/version")).trim();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
return e.getMessage();
|
return e.getMessage();
|
||||||
}
|
}
|
||||||
@@ -331,4 +331,4 @@ public class App extends GlobalApplication {
|
|||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,26 +3,17 @@ package cc.winboll.studio.androidxdemo;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
LogView mLogView;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
mLogView = findViewById(R.id.logview);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
}
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
mLogView.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -34,18 +34,5 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1.0">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
|
|||||||
0
app/app.md
Normal file
0
app/app.md
Normal file
0
app/app.perl
Normal file
0
app/app.perl
Normal file
0
app/app.php
Normal file
0
app/app.php
Normal file
0
app/app.py
Normal file
0
app/app.py
Normal file
0
app/app.sh
Normal file
0
app/app.sh
Normal file
0
app/app.txt
Normal file
0
app/app.txt
Normal file
@@ -19,17 +19,17 @@ def genVersionName(def versionName){
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.app"
|
applicationId "cc.winboll.studio.app"
|
||||||
minSdkVersion 24
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.0"
|
versionName "1.8"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -41,32 +41,14 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api project(':winboll-shared')
|
||||||
// SSH
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
api 'com.jcraft:jsch:0.1.55'
|
|
||||||
// Html 解析
|
|
||||||
api 'org.jsoup:jsoup:1.13.1'
|
|
||||||
// 二维码类库
|
|
||||||
api 'com.google.zxing:core:3.4.1'
|
|
||||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
|
||||||
// 应用介绍页类库
|
|
||||||
api 'io.github.medyo:android-about-page:2.0.0'
|
|
||||||
// 吐司类库
|
|
||||||
api 'com.github.getActivity:ToastUtils:10.5'
|
|
||||||
// 网络连接类库
|
|
||||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
|
||||||
// AndroidX 类库
|
|
||||||
api 'androidx.appcompat:appcompat:1.1.0'
|
|
||||||
api 'com.google.android.material:material:1.4.0'
|
|
||||||
//api 'androidx.viewpager:viewpager:1.0.0'
|
|
||||||
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
|
||||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
|
||||||
//api 'androidx.fragment:fragment:1.1.0'
|
|
||||||
|
|
||||||
api 'cc.winboll.studio:libaes:15.2.4'
|
|
||||||
api 'cc.winboll.studio:libapputils:15.2.1'
|
|
||||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Apr 01 13:50:28 HKT 2025
|
#Sun Jan 05 07:55:24 HKT 2025
|
||||||
stageCount=2
|
stageCount=17
|
||||||
libraryProject=
|
libraryProject=winboll-shared
|
||||||
baseVersion=15.0
|
baseVersion=1.8
|
||||||
publishVersion=15.0.1
|
publishVersion=1.8.16
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.0.2
|
baseBetaVersion=1.8.17
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<string name="app_name">APP+</string>
|
<string name="app_name">WinBoll-APP+</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_winboll"
|
android:icon="@drawable/ic_winboll"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AESTheme"
|
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||||
android:supportsRtl="true">
|
android:supportsRtl="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
@@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<activity android:name=".AboutActivity"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
package cc.winboll.studio.app;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/24 23:52:29
|
|
||||||
* @Describe 应用介绍窗口
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.app.R;
|
|
||||||
import cc.winboll.studio.libaes.winboll.APPInfo;
|
|
||||||
import cc.winboll.studio.libaes.winboll.AboutView;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class AboutActivity extends WinBollActivity implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "AboutActivity";
|
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
Toolbar mToolbar;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
mContext = this;
|
|
||||||
setContentView(R.layout.activity_about);
|
|
||||||
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
mToolbar.setSubtitle(TAG);
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
|
|
||||||
AboutView aboutView = CreateAboutView();
|
|
||||||
// 在 Activity 的 onCreate 或其他生命周期方法中调用
|
|
||||||
// LinearLayout layout = new LinearLayout(this);
|
|
||||||
// layout.setOrientation(LinearLayout.VERTICAL);
|
|
||||||
// // 创建布局参数(宽度和高度)
|
|
||||||
// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
|
||||||
// ViewGroup.LayoutParams.MATCH_PARENT,
|
|
||||||
// ViewGroup.LayoutParams.MATCH_PARENT
|
|
||||||
// );
|
|
||||||
// addContentView(aboutView, params);
|
|
||||||
|
|
||||||
LinearLayout layout = findViewById(R.id.aboutviewroot_ll);
|
|
||||||
// 创建布局参数(宽度和高度)
|
|
||||||
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT
|
|
||||||
);
|
|
||||||
layout.addView(aboutView, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public AboutView CreateAboutView() {
|
|
||||||
String szBranchName = "app";
|
|
||||||
APPInfo appInfo = new APPInfo();
|
|
||||||
appInfo.setAppName("APP");
|
|
||||||
appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll);
|
|
||||||
appInfo.setAppDescription("WinBoll APP");
|
|
||||||
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 new AboutView(mContext, appInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,26 +5,20 @@ package cc.winboll.studio.app;
|
|||||||
* @Date 2024/12/08 15:10:51
|
* @Date 2024/12/08 15:10:51
|
||||||
* @Describe 全局应用类
|
* @Describe 全局应用类
|
||||||
*/
|
*/
|
||||||
import android.view.Gravity;
|
import cc.winboll.studio.shared.app.WinBollApplication;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.shared.log.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
|
|
||||||
public class App extends GlobalApplication {
|
public class App extends WinBollApplication {
|
||||||
|
|
||||||
public static final String TAG = "App";
|
public static final String TAG = "App";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
|
// 必须在调用基类前设置应用调试标志,
|
||||||
|
// 这样可以预先设置日志与数据的存储根目录。
|
||||||
|
//setIsDebug(BuildConfig.DEBUG);
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
LogUtils.d(TAG, "onCreate");
|
||||||
// 初始化 Toast 框架
|
|
||||||
ToastUtils.init(this);
|
|
||||||
// 设置 Toast 布局样式
|
|
||||||
//ToastUtils.setView(R.layout.toast_custom_view);
|
|
||||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
|
||||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
|
||||||
|
|
||||||
getWinBollActivityManager().setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,98 @@
|
|||||||
package cc.winboll.studio.app;
|
package cc.winboll.studio.app;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import cc.winboll.studio.app.R;
|
import cc.winboll.studio.shared.app.WinBollActivity;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.shared.app.WinBollActivityManager;
|
||||||
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
import cc.winboll.studio.shared.app.WinBollApplication;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
import cc.winboll.studio.shared.log.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
import cc.winboll.studio.shared.util.UriUtils;
|
||||||
|
import cc.winboll.studio.shared.view.StringToQrCodeView;
|
||||||
|
import cc.winboll.studio.shared.view.YesNoAlertDialog;
|
||||||
|
import cc.winboll.studio.unittest.UnitTestActivity;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
final public class MainActivity extends WinBollActivity implements IWinBollActivity {
|
final public class MainActivity extends WinBollActivity {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
Toolbar mToolbar;
|
public static final int REQUEST_HOME_ACTIVITY = 0;
|
||||||
|
public static final int REQUEST_ABOUT_ACTIVITY = 1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Activity getActivity() {
|
protected boolean isEnableDisplayHomeAsUp() {
|
||||||
return this;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
||||||
|
if (prosessIntents(getIntent())) return;
|
||||||
|
// 以下正常创建主窗口
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
// 设置 WinBoll 应用 UI 类型
|
||||||
|
WinBollApplication.setWinBollUI_TYPE(WinBollApplication.WinBollUI_TYPE.Aplication);
|
||||||
|
//ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE());
|
||||||
|
LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
|
super.onPostCreate(savedInstanceState);
|
||||||
|
setSubTitle("");
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 处理传入的 Intent 数据
|
||||||
|
//
|
||||||
|
boolean prosessIntents(Intent intent) {
|
||||||
|
if (intent == null
|
||||||
|
|| intent.getAction() == null
|
||||||
|
|| intent.getAction().equals(""))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (intent.getAction().equals(StringToQrCodeView.ACTION_UNITTEST_QRCODE)) {
|
||||||
|
try {
|
||||||
|
WinBollActivity clazzActivity = UnitTestActivity.class.newInstance();
|
||||||
|
String tag = clazzActivity.getTag();
|
||||||
|
LogUtils.d(TAG, "String tag = clazzActivity.getTag(); tag " + tag);
|
||||||
|
Intent subIntent = new Intent(this, UnitTestActivity.class);
|
||||||
|
subIntent.setAction(intent.getAction());
|
||||||
|
File file = new File(getCacheDir(), UUID.randomUUID().toString());
|
||||||
|
//取出文件uri
|
||||||
|
Uri uri = intent.getData();
|
||||||
|
if (uri == null) {
|
||||||
|
uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
|
||||||
|
}
|
||||||
|
//获取文件真实地址
|
||||||
|
String szSrcPath = UriUtils.getFileFromUri(getApplication(), uri);
|
||||||
|
if (TextUtils.isEmpty(szSrcPath)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Files.copy(Paths.get(szSrcPath), Paths.get(file.getPath()));
|
||||||
|
//startWinBollActivity(subIntent, tag);
|
||||||
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, subIntent, UnitTestActivity.class);
|
||||||
|
} catch (IllegalAccessException | InstantiationException | IOException e) {
|
||||||
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
|
// 函数处理异常返回失败
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "prosessIntents|" + intent.getAction() + "|yet");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -28,25 +100,10 @@ final public class MainActivity extends WinBollActivity implements IWinBollActiv
|
|||||||
return TAG;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
LogUtils.d(TAG, "onCreate(Bundle savedInstanceState)");
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
mToolbar.setSubtitle(TAG);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected boolean isAddWinBollToolBar() {
|
||||||
super.onPostCreate(savedInstanceState);
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -59,7 +116,7 @@ final public class MainActivity extends WinBollActivity implements IWinBollActiv
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onYes() {
|
public void onYes() {
|
||||||
App.getWinBollActivityManager().finishAll();
|
WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,23 +126,43 @@ final public class MainActivity extends WinBollActivity implements IWinBollActiv
|
|||||||
YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Toolbar initToolBar() {
|
||||||
|
return findViewById(R.id.activitymainToolbar1);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
getMenuInflater().inflate(R.menu.toolbar_winboll_app_main, menu);
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getItemId() == R.id.item_log) {
|
if (item.getItemId() == R.id.item_unittest) {
|
||||||
App.getWinBollActivityManager().startLogActivity(this);
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, UnitTestActivity.class);
|
||||||
} else if (item.getItemId() == R.id.item_about) {
|
|
||||||
App.getWinBollActivityManager().startWinBollActivity(this, AboutActivity.class);
|
|
||||||
} else if (item.getItemId() == R.id.item_exit) {
|
} else if (item.getItemId() == R.id.item_exit) {
|
||||||
exit();
|
exit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
switch (resultCode) {
|
||||||
|
case REQUEST_HOME_ACTIVITY : {
|
||||||
|
LogUtils.d(TAG, "REQUEST_HOME_ACTIVITY");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case REQUEST_ABOUT_ACTIVITY : {
|
||||||
|
LogUtils.d(TAG, "REQUEST_ABOUT_ACTIVITY");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default : {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
package cc.winboll.studio.app;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/04/01 12:55:32
|
|
||||||
* @Describe 应用窗口基类
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class WinBollActivity extends AppCompatActivity implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "WinBollActivity";
|
|
||||||
|
|
||||||
protected volatile AESThemeBean.ThemeType mThemeType;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
mThemeType = getThemeType();
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
App.getWinBollActivityManager().add(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
App.getWinBollActivityManager().registeRemove(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
AESThemeBean.ThemeType getThemeType() {
|
|
||||||
/*SharedPreferences sharedPreferences = getSharedPreferences(
|
|
||||||
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
|
||||||
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
|
||||||
*/
|
|
||||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void setThemeStyle() {
|
|
||||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
|
||||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
finish();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/toolbar"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/aboutviewroot_ll"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -5,10 +5,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/toolbar"/>
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
<item
|
|
||||||
android:id="@+id/item_log"
|
|
||||||
android:title="Log"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/item_about"
|
|
||||||
android:title="About"/>
|
|
||||||
</menu>
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<string name="app_name">APP</string>
|
<string name="app_name">WinBoll-APP</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -18,19 +18,18 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
compileSdkVersion 30
|
||||||
compileSdkVersion 32
|
buildToolsVersion "30.0.3"
|
||||||
buildToolsVersion "32.0.0"
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.appbase"
|
applicationId "cc.winboll.studio.appbase"
|
||||||
minSdkVersion 24
|
minSdkVersion 26
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.2"
|
versionName "15.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 11:28:02 HKT 2025
|
#Sat Mar 15 15:30:02 HKT 2025
|
||||||
stageCount=3
|
stageCount=3
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.2
|
baseVersion=15.0
|
||||||
publishVersion=15.2.2
|
publishVersion=15.0.2
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.2.3
|
baseBetaVersion=15.0.3
|
||||||
|
|||||||
@@ -7,16 +7,13 @@
|
|||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/MyAPPBaseTheme"
|
android:theme="@style/MyAppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true">
|
||||||
android:process=":App">
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:exported="true"
|
android:exported="true">
|
||||||
android:resizeableActivity="true"
|
|
||||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation">
|
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -32,22 +29,10 @@
|
|||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity android:name=".GlobalApplication$CrashActivity"/>
|
||||||
android:name=".activities.NewActivity"
|
|
||||||
android:label="NewActivity"
|
|
||||||
android:exported="true"
|
|
||||||
android:resizeableActivity="true"
|
|
||||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
|
|
||||||
|
|
||||||
<activity android:name=".activities.New2Activity"
|
|
||||||
android:label="New2Activity"
|
|
||||||
android:exported="true"
|
|
||||||
android:resizeableActivity="true"
|
|
||||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
|
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".MyTileService"
|
android:name=".MyTileService"
|
||||||
android:exported="true"
|
|
||||||
android:label="@string/tileservice_name"
|
android:label="@string/tileservice_name"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||||
@@ -64,18 +49,9 @@
|
|||||||
android:name=".services.MainService"
|
android:name=".services.MainService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<service
|
|
||||||
android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<service
|
|
||||||
android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<service android:name=".services.AssistantService"/>
|
<service android:name=".services.AssistantService"/>
|
||||||
|
|
||||||
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver"
|
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver">
|
||||||
android:exported="true">
|
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -105,14 +81,13 @@
|
|||||||
|
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".receivers.APPNewsWidgetClickListener"
|
<receiver android:name=".widgets.APPNewsWidgetClickListener">
|
||||||
android:exported="true">
|
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_PRE"/>
|
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidgetClickListener.ACTION_PRE"/>
|
||||||
|
|
||||||
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_NEXT"/>
|
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidgetClickListener.ACTION_NEXT"/>
|
||||||
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
@@ -122,6 +97,11 @@
|
|||||||
android:name="android.max_aspect"
|
android:name="android.max_aspect"
|
||||||
android:value="4.0"/>
|
android:value="4.0"/>
|
||||||
|
|
||||||
|
<service android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||||
|
android:exported="true"/>
|
||||||
|
|
||||||
|
<service android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
||||||
|
android:exported="true"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public class App extends GlobalApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
|
||||||
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
||||||
IntentFilter intentFilter = new IntentFilter();
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
intentFilter.addAction(SOS.ACTION_SOS);
|
intentFilter.addAction(SOS.ACTION_SOS);
|
||||||
|
|||||||
@@ -4,42 +4,25 @@ import android.app.Activity;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.Toolbar;
|
||||||
import cc.winboll.studio.appbase.R;
|
import cc.winboll.studio.appbase.R;
|
||||||
import cc.winboll.studio.appbase.activities.NewActivity;
|
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
||||||
import cc.winboll.studio.appbase.services.TestDemoService;
|
import cc.winboll.studio.appbase.services.TestDemoService;
|
||||||
import cc.winboll.studio.libappbase.CrashHandler;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.GlobalCrashActivity;
|
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
import cc.winboll.studio.libappbase.sos.SOS;
|
import cc.winboll.studio.libappbase.sos.SOS;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
|
||||||
|
|
||||||
public class MainActivity extends WinBollActivityBase implements IWinBollActivity {
|
public class MainActivity extends Activity {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
@Override
|
LogView mLogView;
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
Toolbar mToolbar;
|
|
||||||
//LogView mLogView;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -47,34 +30,19 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
ToastUtils.show("onCreate");
|
ToastUtils.show("onCreate");
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||||
setSupportActionBar(mToolbar);
|
setActionBar(toolbar);
|
||||||
|
|
||||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||||
//mLogView = findViewById(R.id.activitymainLogView1);
|
mLogView = findViewById(R.id.activitymainLogView1);
|
||||||
|
|
||||||
// if (GlobalApplication.isDebuging()) {
|
if (GlobalApplication.isDebuging()) {
|
||||||
// mLogView.start();
|
mLogView.start();
|
||||||
// ToastUtils.show("LogView start.");
|
ToastUtils.show("LogView start.");
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@@ -83,16 +51,15 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
sendBroadcast(intentAPPWidget);
|
sendBroadcast(intentAPPWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSwitchDebugMode(View view) {
|
@Override
|
||||||
boolean isDebuging = ((CheckBox)view).isChecked();
|
protected void onResume() {
|
||||||
GlobalApplication.setIsDebuging(isDebuging);
|
LogUtils.d(TAG, "onResume");
|
||||||
GlobalApplication.saveDebugStatus();
|
super.onResume();
|
||||||
|
mLogView.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPreviewGlobalCrashActivity(View view) {
|
public void onSwitchDebugMode(View view) {
|
||||||
Intent intent = new Intent(this, GlobalCrashActivity.class);
|
GlobalApplication.setIsDebuging(this, ((CheckBox)view).isChecked());
|
||||||
intent.putExtra(CrashHandler.EXTRA_CRASH_INFO, "Demo log...");
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartCenter(View view) {
|
public void onStartCenter(View view) {
|
||||||
@@ -122,7 +89,7 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
startService(intentService);
|
startService(intentService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTestDemoServiceSOS(View view) {
|
public void onTestSOS(View view) {
|
||||||
Intent intent = new Intent(this, TestDemoService.class);
|
Intent intent = new Intent(this, TestDemoService.class);
|
||||||
stopService(intent);
|
stopService(intent);
|
||||||
if (App.isDebuging()) {
|
if (App.isDebuging()) {
|
||||||
@@ -138,8 +105,6 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
startService(intent);
|
startService(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onStopTestDemoService(View view) {
|
public void onStopTestDemoService(View view) {
|
||||||
Intent intent = new Intent(this, TestDemoService.class);
|
Intent intent = new Intent(this, TestDemoService.class);
|
||||||
@@ -175,10 +140,4 @@ public class MainActivity extends WinBollActivityBase implements IWinBollActivit
|
|||||||
Intent intent = new Intent(this, TestDemoBindService.class);
|
Intent intent = new Intent(this, TestDemoBindService.class);
|
||||||
stopService(intent);
|
stopService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTestOpenNewActivity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, NewActivity.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package cc.winboll.studio.appbase;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.service.quicksettings.Tile;
|
import android.service.quicksettings.Tile;
|
||||||
import android.service.quicksettings.TileService;
|
import android.service.quicksettings.TileService;
|
||||||
import cc.winboll.studio.appbase.models.MainServiceBean;
|
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
|
|
||||||
public class MyTileService extends TileService {
|
public class MyTileService extends TileService {
|
||||||
|
|||||||
@@ -1,82 +0,0 @@
|
|||||||
package cc.winboll.studio.appbase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/28 15:34:16
|
|
||||||
* @Describe 应用活动窗口基类
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.PersistableBundle;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import cc.winboll.studio.appbase.App;
|
|
||||||
import cc.winboll.studio.appbase.R;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
|
||||||
|
|
||||||
public class WinBollActivityBase extends AppCompatActivity implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "WinBollActivityBase";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
WinBollActivityManager getWinBollActivityManager() {
|
|
||||||
return WinBollActivityManager.getInstance(GlobalApplication.getInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
getWinBollActivityManager().add(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
|
|
||||||
super.onPostCreate(savedInstanceState, persistentState);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
|
||||||
return true;
|
|
||||||
} else if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
|
|
||||||
//moveTaskToBack(true);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
void exit() {
|
|
||||||
YesNoAlertDialog.show(this, "Exit " + getString(R.string.app_name), "Close all activity and exit?", new YesNoAlertDialog.OnDialogResultListener(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onYes() {
|
|
||||||
App.getWinBollActivityManager().finishAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNo() {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
getWinBollActivityManager().registeRemove(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
package cc.winboll.studio.appbase.activities;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/25 11:46:40
|
|
||||||
* @Describe 测试窗口2
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import cc.winboll.studio.appbase.R;
|
|
||||||
import cc.winboll.studio.appbase.WinBollActivityBase;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class New2Activity extends WinBollActivityBase implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "New2Activity";
|
|
||||||
|
|
||||||
Toolbar mToolbar;
|
|
||||||
//LogView mLogView;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_new2);
|
|
||||||
|
|
||||||
// mLogView = findViewById(R.id.logview);
|
|
||||||
// mLogView.start();
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
//mLogView.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCloseThisActivity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().finish(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCloseAllActivity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().finishAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onNewActivity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, NewActivity.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
package cc.winboll.studio.appbase.activities;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/25 05:04:22
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import cc.winboll.studio.appbase.R;
|
|
||||||
import cc.winboll.studio.appbase.WinBollActivityBase;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class NewActivity extends WinBollActivityBase implements IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "NewActivity";
|
|
||||||
|
|
||||||
Toolbar mToolbar;
|
|
||||||
//LogView mLogView;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_new);
|
|
||||||
// mLogView = findViewById(R.id.logview);
|
|
||||||
// mLogView.start();
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
//mLogView.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCloseThisActivity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().finish(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCloseAllActivity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().finishAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onNew2Activity(View view) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, New2Activity.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.models;
|
package cc.winboll.studio.appbase.beans;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.models;
|
package cc.winboll.studio.appbase.beans;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.models;
|
package cc.winboll.studio.appbase.beans;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.appbase.models;
|
package cc.winboll.studio.appbase.beans;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -10,7 +10,7 @@ import android.content.ComponentName;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import cc.winboll.studio.appbase.models.WinBollNewsBean;
|
import cc.winboll.studio.appbase.beans.WinBollNewsBean;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
||||||
import cc.winboll.studio.libappbase.AppUtils;
|
import cc.winboll.studio.libappbase.AppUtils;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.models.MainServiceBean;
|
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
||||||
import cc.winboll.studio.appbase.services.AssistantService;
|
import cc.winboll.studio.appbase.services.AssistantService;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import android.content.ServiceConnection;
|
|||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.MyTileService;
|
import cc.winboll.studio.appbase.MyTileService;
|
||||||
import cc.winboll.studio.appbase.models.MainServiceBean;
|
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
||||||
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
|
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
|
||||||
import cc.winboll.studio.appbase.receivers.MainReceiver;
|
import cc.winboll.studio.appbase.receivers.MainReceiver;
|
||||||
import cc.winboll.studio.appbase.services.AssistantService;
|
import cc.winboll.studio.appbase.services.AssistantService;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.models.TestDemoBindServiceBean;
|
import cc.winboll.studio.appbase.beans.TestDemoBindServiceBean;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||||
import cc.winboll.studio.appbase.App;
|
import cc.winboll.studio.appbase.App;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import cc.winboll.studio.appbase.models.TestDemoServiceBean;
|
import cc.winboll.studio.appbase.beans.TestDemoServiceBean;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||||
|
|
||||||
|
|||||||
@@ -12,16 +12,15 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
import cc.winboll.studio.appbase.R;
|
import cc.winboll.studio.appbase.R;
|
||||||
import cc.winboll.studio.appbase.models.WinBollNewsBean;
|
import cc.winboll.studio.appbase.beans.WinBollNewsBean;
|
||||||
import cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener;
|
|
||||||
import cc.winboll.studio.libappbase.AppUtils;
|
import cc.winboll.studio.libappbase.AppUtils;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.sos.APPModel;
|
|
||||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import cc.winboll.studio.libappbase.sos.APPModel;
|
||||||
|
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||||
|
|
||||||
public class APPNewsWidget extends AppWidgetProvider {
|
public class APPNewsWidget extends AppWidgetProvider {
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package cc.winboll.studio.appbase.receivers;
|
package cc.winboll.studio.appbase.widgets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
* @Date 2025/03/24 07:11:44
|
* @Date 2025/02/15 17:20:46
|
||||||
|
* @Describe WidgetButtonClickListener
|
||||||
*/
|
*/
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|
||||||
public class APPNewsWidgetClickListener extends BroadcastReceiver {
|
public class APPNewsWidgetClickListener extends BroadcastReceiver {
|
||||||
@@ -5,10 +5,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/toolbar"/>
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -39,41 +39,28 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Android版本10的代号是“Q”,API级别是29。 Android 10开始谷歌不再公开使用甜品作为版本代号,但内部仍保留了大量与“Q”相关的元素。Android 10本身并没有严格对应某个特定的Java版本,但在开发Android 10应用时,通常可以使用Java 8或更高版本。 Java 8为Android开发带来了诸如Lambda表达式、方法引用等新特性,能提高开发效率和代码可读性,与Android 10开发适配良好。Java 9及更高版本也可用于Android 10开发,能使用一些新的语言特性和API,但可能需要注意兼容性和配置问题。"/>
|
android:text="Android版本10的代号是“Q”,API级别是29。 Android 10开始谷歌不再公开使用甜品作为版本代号,但内部仍保留了大量与“Q”相关的元素。Android 10本身并没有严格对应某个特定的Java版本,但在开发Android 10应用时,通常可以使用Java 8或更高版本。 Java 8为Android开发带来了诸如Lambda表达式、方法引用等新特性,能提高开发效率和代码可读性,与Android 10开发适配良好。Java 9及更高版本也可用于Android 10开发,能使用一些新的语言特性和API,但可能需要注意兼容性和配置问题。"/>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right|center_vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<CheckBox
|
||||||
android:orientation="horizontal"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right|center_vertical"
|
android:text="Debug Mode"
|
||||||
android:layout_width="wrap_content">
|
android:layout_weight="1.0"
|
||||||
|
android:onClick="onSwitchDebugMode"
|
||||||
|
android:id="@+id/activitymainCheckBox1"/>
|
||||||
|
|
||||||
<CheckBox
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Debug Mode"
|
android:text="Test Application CrashReport"
|
||||||
android:layout_weight="1.0"
|
android:textAllCaps="false"
|
||||||
android:onClick="onSwitchDebugMode"
|
android:onClick="onTestApplicationCrashReport"/>
|
||||||
android:id="@+id/activitymainCheckBox1"/>
|
|
||||||
|
|
||||||
<Button
|
</LinearLayout>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Test Application CrashReport"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onTestApplicationCrashReport"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="PreviewGlobalCrashActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onPreviewGlobalCrashActivity"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -85,27 +72,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right">
|
android:gravity="right">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="StartCenter"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onStartCenter"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="StopCenter"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onStopCenter"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
@@ -139,40 +105,54 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<HorizontalScrollView
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:orientation="horizontal"
|
||||||
android:layout_height="wrap_content">
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<Button
|
||||||
android:orientation="horizontal"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:text="SartTestDemoBindService"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onSartTestDemoBindService"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="SartTestDemoBindService"
|
android:text="StopTestDemoBindService"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onSartTestDemoBindService"/>
|
android:onClick="onStopTestDemoBindService"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="StopTestDemoBindService"
|
android:text="StopTestDemoBindServiceNoSettings"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onStopTestDemoBindService"/>
|
android:onClick="onStopTestDemoBindServiceNoSettings"/>
|
||||||
|
|
||||||
<Button
|
</LinearLayout>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="StopTestDemoBindServiceNoSettings"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onStopTestDemoBindServiceNoSettings"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="StartCenter"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onStartCenter"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="StopCenter"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onStopCenter"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -191,21 +171,19 @@
|
|||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="TestDemoServiceSOS"
|
android:text="TestSOS"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onTestDemoServiceSOS"/>
|
android:onClick="onTestSOS"/>
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="TestOpenNewActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onTestOpenNewActivity"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_height="500dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:id="@+id/activitymainLogView1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/toolbar"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="NewActivity"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CloseThisActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onCloseThisActivity"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CloseAllActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onCloseAllActivity"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="New2Activity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onNew2Activity"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/toolbar"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="New2Activity"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CloseThisActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onCloseThisActivity"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CloseAllActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onCloseAllActivity"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="NewActivity"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onNewActivity"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#FF00B322</color>
|
<color name="colorPrimary">#005800FF</color>
|
||||||
<color name="colorPrimaryDark">#FF005C12</color>
|
<color name="colorPrimaryDark">#005800FF</color>
|
||||||
<color name="colorAccent">#FF8DFFA2</color>
|
<color name="colorAccent">#005800FF</color>
|
||||||
<color name="colorText">#FFFFFB8D</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="MyAPPBaseTheme" parent="APPBaseTheme">
|
<style name="MyAppTheme" parent="APPBaseTheme">
|
||||||
<item name="attrColorPrimary">@color/colorPrimary</item>
|
<item name="attrColorPrimary">@color/colorPrimary</item>
|
||||||
<item name="themeGlobalCrashActivity">@style/MyGlobalCrashActivityTheme</item>
|
<item name="themeGlobalCrashActivity">@style/MyGlobalCrashActivityTheme</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -18,18 +18,18 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
compileSdkVersion 30
|
||||||
buildToolsVersion "33.0.3"
|
buildToolsVersion "30.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.apputils"
|
applicationId "cc.winboll.studio.apputils"
|
||||||
minSdkVersion 21
|
minSdkVersion 26
|
||||||
targetSdkVersion 30
|
targetSdkVersion 29
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "9.2"
|
versionName "15.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -41,15 +41,26 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_17
|
|
||||||
targetCompatibility JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':libapputils')
|
api project(':libapputils')
|
||||||
api 'cc.winboll.studio:libappbase:1.0.3'
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
implementation 'cc.winboll.studio:libappbase:15.0.3'
|
||||||
|
|
||||||
|
// 二维码类库
|
||||||
|
implementation 'com.google.zxing:core:3.4.1'
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||||
|
|
||||||
|
// 网络连接类库
|
||||||
|
//implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
|
|
||||||
|
// Html 解析
|
||||||
|
//implementation 'org.jsoup:jsoup:1.13.1'
|
||||||
|
|
||||||
|
// SSH
|
||||||
|
//implementation 'com.jcraft:jsch:0.1.55'
|
||||||
|
|
||||||
|
// 应用介绍页类库
|
||||||
|
//implementation 'io.github.medyo:android-about-page:2.0.0'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Jan 18 13:03:10 HKT 2025
|
#Tue Mar 18 09:52:37 HKT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libapputils
|
libraryProject=libapputils
|
||||||
baseVersion=9.2
|
baseVersion=15.0
|
||||||
publishVersion=9.2.1
|
publishVersion=15.0.1
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=9.2.2
|
baseBetaVersion=15.0.2
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_winboll"
|
android:icon="@drawable/ic_winboll"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
android:theme="@style/UtilsTheme"
|
||||||
android:supportsRtl="true">
|
android:supportsRtl="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
@@ -27,10 +27,8 @@
|
|||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".TestWinBollActivity"/>
|
|
||||||
|
|
||||||
<activity android:name=".TestStringToQrCodeViewActivity"/>
|
<activity android:name=".TestStringToQrCodeViewActivity"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -5,27 +5,83 @@ package cc.winboll.studio.apputils;
|
|||||||
* @Date 2024/12/08 15:10:51
|
* @Date 2024/12/08 15:10:51
|
||||||
* @Describe 全局应用类
|
* @Describe 全局应用类
|
||||||
*/
|
*/
|
||||||
import android.view.Gravity;
|
import android.app.Application;
|
||||||
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
import android.content.Context;
|
||||||
import com.hjq.toast.ToastUtils;
|
import android.widget.Toast;
|
||||||
import com.hjq.toast.style.WhiteToastStyle;
|
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 WinBollApplication {
|
public class App extends GlobalApplication {
|
||||||
|
|
||||||
public static final String TAG = "App";
|
public static final String TAG = "App";
|
||||||
|
|
||||||
public static final String _ACTION_DEBUGVIEW = WinBollApplication.class.getName() + "_ACTION_DEBUGVIEW";
|
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
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
// 初始化 Toast 框架
|
// 应用环境初始化, 基本调试环境
|
||||||
//
|
//
|
||||||
ToastUtils.init(this);
|
// 初始化日志模块
|
||||||
// 设置 Toast 布局样式
|
//LogUtils.init(this);
|
||||||
//ToastUtils.setView(R.layout.view_toast);
|
|
||||||
ToastUtils.setStyle(new WhiteToastStyle());
|
|
||||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
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,28 +1,83 @@
|
|||||||
package cc.winboll.studio.apputils;
|
package cc.winboll.studio.apputils;
|
||||||
|
|
||||||
|
import cc.winboll.studio.apputils.R;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||||
|
import cc.winboll.studio.libapputils.activities.LogActivity;
|
||||||
import cc.winboll.studio.libapputils.activities.QRCodeDecodeActivity;
|
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.app.WinBollActivityManager;
|
||||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
import cc.winboll.studio.libapputils.view.AboutView;
|
||||||
import com.hjq.toast.ToastUtils;
|
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
final public class MainActivity extends WinBollActivity {
|
final public class MainActivity extends Activity implements IWinBollActivity {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
public static final int REQUEST_QRCODEDECODE_ACTIVITY = 0;
|
public static final int REQUEST_QRCODEDECODE_ACTIVITY = 0;
|
||||||
|
|
||||||
|
Toolbar mToolbar;
|
||||||
|
LogView mLogView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isEnableDisplayHomeAsUp() {
|
public Activity 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,8 +86,22 @@ final public class MainActivity extends WinBollActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
//Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
mLogView = findViewById(R.id.logview);
|
||||||
//setActionBar(toolbar);
|
mLogView.start();
|
||||||
|
|
||||||
|
// 初始化工具栏
|
||||||
|
mToolbar = findViewById(R.id.activitymainToolbar1);
|
||||||
|
setActionBar(mToolbar);
|
||||||
|
if (isEnableDisplayHomeAsUp()) {
|
||||||
|
// 显示后退按钮
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
getActionBar().setSubtitle(getTag());
|
||||||
|
|
||||||
|
checkResolveActivity();
|
||||||
|
archiveInstance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
||||||
//if (prosessIntents(getIntent())) return;
|
//if (prosessIntents(getIntent())) return;
|
||||||
@@ -44,44 +113,94 @@ final public class MainActivity extends WinBollActivity {
|
|||||||
// LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG));
|
// 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) {
|
public void onTestLogClick(View view) {
|
||||||
LogUtils.d(TAG, "onTestLogClick");
|
LogUtils.d(TAG, "onTestLogClick");
|
||||||
Toast.makeText(getApplication(), "onTestLogClick", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplication(), "onTestLogClick", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLogUtilsClick(View view) {
|
public void onLogUtilsClick(View view) {
|
||||||
Intent intent = new Intent(this, LogActivity.class);
|
// Intent intent = new Intent(this, LogActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
startActivity(intent);
|
// startActivity(intent);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||||
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 数据
|
// 处理传入的 Intent 数据
|
||||||
//
|
//
|
||||||
@@ -125,40 +244,88 @@ final public class MainActivity extends WinBollActivity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean isAddWinBollToolBar() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Toolbar initToolBar() {
|
|
||||||
return findViewById(R.id.activitymainToolbar1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
//ToastUtils.show("onCreateOptionsMenu");
|
||||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
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);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getItemId() == R.id.item_testwinboll) {
|
if (item.getItemId() == R.id.item_exit) {
|
||||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestWinBollActivity.class);
|
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) {
|
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
|
||||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
||||||
} else if (item.getItemId() == R.id.item_testqrcodedecodeactivity) {
|
} else if (item.getItemId() == R.id.item_testqrcodedecodeactivity) {
|
||||||
Intent intent = new Intent(this, QRCodeDecodeActivity.class);
|
Intent intent = new Intent(this, QRCodeDecodeActivity.class);
|
||||||
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
||||||
|
} 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);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
about();
|
||||||
|
}
|
||||||
|
|
||||||
public void onTestJavascriptHtmlActivity(View view) {
|
public void onTestJavascriptHtmlActivity(View view) {
|
||||||
Intent intent = new Intent(this, AssetsHtmlActivity.class);
|
Intent intent = new Intent(this, AssetsHtmlActivity.class);
|
||||||
intent.putExtra(AssetsHtmlActivity.EXTRA_HTMLFILENAME, "javascript_test.html");
|
intent.putExtra(AssetsHtmlActivity.EXTRA_HTMLFILENAME, "javascript_test.html");
|
||||||
@@ -166,17 +333,25 @@ final public class MainActivity extends WinBollActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onResume() {
|
||||||
switch (requestCode) {
|
super.onResume();
|
||||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
mLogView.start();
|
||||||
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,37 +1,50 @@
|
|||||||
package cc.winboll.studio.apputils;
|
package cc.winboll.studio.apputils;
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
|
||||||
import cc.winboll.studio.libapputils.view.StringToQrCodeView;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@QQ.COM
|
* @Author ZhanGSKen@QQ.COM
|
||||||
* @Date 2025/01/17 19:50:46
|
* @Date 2025/01/17 19:50:46
|
||||||
*/
|
*/
|
||||||
public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
import cc.winboll.studio.apputils.R;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||||
|
import cc.winboll.studio.libapputils.view.StringToQrCodeView;
|
||||||
|
|
||||||
|
public class TestStringToQrCodeViewActivity extends Activity implements IWinBollActivity {
|
||||||
|
|
||||||
public static final String TAG = "TestStringToQrCodeViewActivity";
|
public static final String TAG = "TestStringToQrCodeViewActivity";
|
||||||
|
|
||||||
StringToQrCodeView mStringToQrCodeView;
|
StringToQrCodeView mStringToQrCodeView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public APPInfo getAppInfo() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTag() {
|
public String getTag() {
|
||||||
return TAG;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Toolbar initToolBar() {
|
public Toolbar initToolBar() {
|
||||||
return findViewById(R.id.activityteststringtoqrcodeviewToolbar1);
|
return findViewById(R.id.activityteststringtoqrcodeviewToolbar1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isEnableDisplayHomeAsUp() {
|
public boolean isEnableDisplayHomeAsUp() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAddWinBollToolBar() {
|
public boolean isAddWinBollToolBar() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,10 +54,4 @@ public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
|||||||
setContentView(R.layout.activity_teststringtoqrcodeview);
|
setContentView(R.layout.activity_teststringtoqrcodeview);
|
||||||
mStringToQrCodeView = findViewById(R.id.activityteststringtoqrcodeviewStringToQrCodeView1);
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<android.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/activitymainToolbar1"/>
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="TestLog"
|
android:text="TestLog"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onTestLogClick"/>
|
android:onClick="onTestLogClick"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -39,20 +39,27 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right">
|
android:gravity="right">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:text="Test Javascript Html Activity"
|
android:text="Test Javascript Html Activity"
|
||||||
android:onClick="onTestJavascriptHtmlActivity"/>
|
android:onClick="onTestJavascriptHtmlActivity"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:text="Button"
|
||||||
|
android:id="@+id/logview"
|
||||||
|
android:layout_weight="1.0"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<android.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/activityteststringtoqrcodeviewToolbar1"/>
|
android:id="@+id/activityteststringtoqrcodeviewToolbar1"/>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FF36B5B3">
|
android:background="#FF36B5B3">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<android.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/activitytestwinbollToolbar1"/>
|
android:id="@+id/activitytestwinbollToolbar1"/>
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/shape_gradient"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="10dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:src="@drawable/ic_launcher"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@android:id/message"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
android:textColor="#FF000000"
|
|
||||||
android:textSize="16sp"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -3,14 +3,14 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/item_testwinboll"
|
android:id="@+id/item_testwinboll"
|
||||||
android:title="TestWinBollActivity"
|
android:title="TestWinBollActivity"/>
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/item_teststringtoqrcodeview"
|
android:id="@+id/item_teststringtoqrcodeview"
|
||||||
android:title="TestStringToQrCodeViewActivity"
|
android:title="TestStringToQrCodeViewActivity"/>
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/item_testqrcodedecodeactivity"
|
android:id="@+id/item_testqrcodedecodeactivity"
|
||||||
android:title="TestQRCodeDecodeActivity"
|
android:title="TestQRCodeDecodeActivity"/>
|
||||||
app:showAsAction="ifRoom"/>
|
<item
|
||||||
|
android:id="@+id/item_testcrashreport"
|
||||||
|
android:title="TestCrashReportActivity"/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -4,7 +4,4 @@
|
|||||||
<color name="colorPrimary">#FF196ABC</color>
|
<color name="colorPrimary">#FF196ABC</color>
|
||||||
<color name="colorPrimaryDark">#FF002B57</color>
|
<color name="colorPrimaryDark">#FF002B57</color>
|
||||||
<color name="colorAccent">#FF80BFFF</color>
|
<color name="colorAccent">#FF80BFFF</color>
|
||||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
|
||||||
<color name="colorToastShadow">#FF000000</color>
|
|
||||||
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<style name="UtilsTheme" parent="APPBaseTheme">
|
||||||
|
<item name="attrColorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="themeGlobalCrashActivity">@style/UtilsGlobalCrashActivityTheme</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="UtilsGlobalCrashActivityTheme" parent="GlobalCrashActivityTheme">
|
||||||
|
<item name="colorTittle">#FFFFFFFF</item>
|
||||||
|
<item name="colorTittleBackgound">#FF00A4B3</item>
|
||||||
|
<item name="colorText">#FFFFFFFF</item>
|
||||||
|
<item name="colorTextBackgound">#FF000000</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
28
build.gradle
28
build.gradle
@@ -1,12 +1,6 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
// Nexus Maven 库地址
|
|
||||||
// "WinBoll Release"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
|
||||||
// "WinBoll Snapshot"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
|
||||||
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/google/' }
|
maven { url 'https://maven.aliyun.com/repository/google/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
||||||
@@ -15,10 +9,17 @@ buildscript {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
|
||||||
|
// Nexus Maven 库地址
|
||||||
|
// "WinBoll Release"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||||
|
// "WinBoll Snapshot"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||||
|
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
|
classpath 'com.android.tools.build:gradle:7.2.1'
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
@@ -26,12 +27,6 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
// Nexus Maven 库地址
|
|
||||||
// "WinBoll Release"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
|
||||||
// "WinBoll Snapshot"
|
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
|
||||||
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/google/' }
|
maven { url 'https://maven.aliyun.com/repository/google/' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
||||||
@@ -40,6 +35,13 @@ allprojects {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
|
||||||
|
// Nexus Maven 库地址
|
||||||
|
// "WinBoll Release"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||||
|
// "WinBoll Snapshot"
|
||||||
|
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||||
|
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
ext {
|
ext {
|
||||||
|
|||||||
@@ -17,5 +17,3 @@ org.gradle.jvmargs=-Xmx2048m
|
|||||||
android.useAndroidX=false
|
android.useAndroidX=false
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=false
|
android.enableJetifier=false
|
||||||
# 保持与旧版Gradle插件的兼容
|
|
||||||
android.disableAutomaticComponentCreation=true
|
|
||||||
|
|||||||
@@ -17,5 +17,3 @@ org.gradle.jvmargs=-Xmx2048m
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
# 保持与旧版Gradle插件的兼容
|
|
||||||
android.disableAutomaticComponentCreation=true
|
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
|||||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
namespace 'cc.winboll.studio.libaes'
|
||||||
|
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
@@ -17,40 +19,30 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
//api 'cc.winboll.studio:winboll-shared:1.6.5'
|
||||||
|
|
||||||
// 吐司类库
|
|
||||||
api 'com.github.getActivity:ToastUtils:10.5'
|
|
||||||
|
|
||||||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
|
||||||
api 'com.github.getActivity:XXPermissions:18.63'
|
|
||||||
// 下拉控件
|
|
||||||
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
|
||||||
// 拼音搜索
|
|
||||||
// https://mvnrepository.com/artifact/com.github.open-android/pinyin4j
|
|
||||||
api 'com.github.open-android:pinyin4j:2.5.0'
|
|
||||||
// SSH
|
|
||||||
api 'com.jcraft:jsch:0.1.55'
|
|
||||||
// Html 解析
|
|
||||||
api 'org.jsoup:jsoup:1.13.1'
|
|
||||||
// 二维码类库
|
|
||||||
api 'com.google.zxing:core:3.4.1'
|
|
||||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
|
||||||
// 应用介绍页类库
|
|
||||||
api 'io.github.medyo:android-about-page:2.0.0'
|
api 'io.github.medyo:android-about-page:2.0.0'
|
||||||
// 网络连接类库
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
api 'com.jcraft:jsch:0.1.55'
|
||||||
|
api 'org.jsoup:jsoup:1.13.1'
|
||||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
// AndroidX 类库
|
|
||||||
api 'androidx.appcompat:appcompat:1.1.0'
|
|
||||||
api 'com.google.android.material:material:1.4.0'
|
|
||||||
//api 'androidx.viewpager:viewpager:1.0.0'
|
|
||||||
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
|
||||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
|
||||||
//api 'androidx.fragment:fragment:1.1.0'
|
|
||||||
|
|
||||||
api 'cc.winboll.studio:libapputils:15.2.1'
|
api 'androidx.appcompat:appcompat:1.0.0'
|
||||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
api 'androidx.fragment:fragment:1.0.0'
|
||||||
|
api 'com.google.android.material:material:1.0.0'
|
||||||
|
|
||||||
|
// https://github.com/baoyongzhang/android-PullRefreshLayout
|
||||||
|
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
||||||
|
|
||||||
|
api 'cc.winboll.studio:libapputils:9.2.1'
|
||||||
|
api 'cc.winboll.studio:libappbase:1.0.3'
|
||||||
|
|
||||||
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 31 19:41:08 HKT 2025
|
#Sun Jan 19 04:58:59 GMT 2025
|
||||||
stageCount=5
|
stageCount=3
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=7.6
|
||||||
publishVersion=15.2.4
|
publishVersion=7.6.2
|
||||||
buildCount=0
|
buildCount=4
|
||||||
baseBetaVersion=15.2.5
|
baseBetaVersion=7.6.3
|
||||||
|
|||||||
@@ -5,27 +5,16 @@
|
|||||||
|
|
||||||
<application>
|
<application>
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity"
|
<activity android:name="cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity"/>
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"
|
<activity android:name="cc.winboll.studio.libaes.activitys.AboutActivity"/>
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"
|
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"/>
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.libaes.winboll.WinBollClientService"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.libaes.winboll.AssistantService"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.libaes.winboll.WinBollMail"
|
|
||||||
android:exported="true"/>
|
|
||||||
|
|
||||||
|
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"/>
|
||||||
|
|
||||||
|
<activity android:name="cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -27,20 +27,18 @@ import cc.winboll.studio.libaes.beans.AESThemeBean;
|
|||||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||||
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
import com.baoyz.widget.PullRefreshLayout;
|
import com.baoyz.widget.PullRefreshLayout;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public abstract class DrawerFragmentActivity extends AppCompatActivity implements IWinBollActivity,AdapterView.OnItemClickListener {
|
public abstract class DrawerFragmentActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
|
||||||
|
|
||||||
public static final String TAG = "DrawerFragmentActivity";
|
public static final String TAG = "DrawerFragmentActivity";
|
||||||
|
|
||||||
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
|
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
|
||||||
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
|
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
|
||||||
|
|
||||||
//protected Context mContext;
|
protected Context mContext;
|
||||||
ActivityType mActivityType;
|
ActivityType mActivityType;
|
||||||
ActionBarDrawerToggle mActionBarDrawerToggle;
|
ActionBarDrawerToggle mActionBarDrawerToggle;
|
||||||
DrawerLayout mDrawerLayout;
|
DrawerLayout mDrawerLayout;
|
||||||
@@ -60,7 +58,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
//mContext = this;
|
mContext = this;
|
||||||
mThemeType = getThemeType();
|
mThemeType = getThemeType();
|
||||||
setThemeStyle();
|
setThemeStyle();
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -74,7 +72,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public Intent getIntent() {
|
public Intent getIntent() {
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
return super.getIntent();
|
return super.getIntent();
|
||||||
@@ -82,7 +80,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
|
|
||||||
public Context getContext() {
|
public Context getContext() {
|
||||||
return this.mContext;
|
return this.mContext;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MenuInflater getMenuInflater() {
|
public MenuInflater getMenuInflater() {
|
||||||
@@ -90,20 +88,20 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
return super.getMenuInflater();
|
return super.getMenuInflater();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public void setSubtitle(CharSequence context) {
|
public void setSubtitle(CharSequence context) {
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
getSupportActionBar().setSubtitle(context);
|
getSupportActionBar().setSubtitle(context);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void recreate() {
|
public void recreate() {
|
||||||
super.recreate();
|
super.recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public boolean moveTaskToBack(boolean nonRoot) {
|
public boolean moveTaskToBack(boolean nonRoot) {
|
||||||
return super.moveTaskToBack(nonRoot);
|
return super.moveTaskToBack(nonRoot);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startActivity(Intent intent) {
|
public void startActivity(Intent intent) {
|
||||||
@@ -115,7 +113,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
super.startActivityForResult(intent, requestCode, options);
|
super.startActivityForResult(intent, requestCode, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public FragmentManager getSupportFragmentManager() {
|
public FragmentManager getSupportFragmentManager() {
|
||||||
return super.getSupportFragmentManager();
|
return super.getSupportFragmentManager();
|
||||||
}
|
}
|
||||||
@@ -133,7 +131,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
public void setTitle(int resId) {
|
public void setTitle(int resId) {
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
getSupportActionBar().setTitle(resId);
|
getSupportActionBar().setTitle(resId);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||||
@@ -153,7 +151,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
|
|
||||||
void setThemeStyle() {
|
void setThemeStyle() {
|
||||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
||||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
setTheme(AESThemeUtil.getThemeTypeID(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean checkThemeStyleChange() {
|
boolean checkThemeStyleChange() {
|
||||||
@@ -165,7 +163,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
||||||
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
||||||
*/
|
*/
|
||||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -176,8 +174,6 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
|
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
|
||||||
getString(i);
|
getString(i);
|
||||||
}
|
}
|
||||||
} else if (R.id.item_log == item.getItemId()) {
|
|
||||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
|
||||||
} else if (R.id.item_about == item.getItemId()) {
|
} else if (R.id.item_about == item.getItemId()) {
|
||||||
LogUtils.d(TAG, "onAbout");
|
LogUtils.d(TAG, "onAbout");
|
||||||
} else if (android.R.id.home == item.getItemId()) {
|
} else if (android.R.id.home == item.getItemId()) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ package cc.winboll.studio.libaes.beans;
|
|||||||
import android.util.JsonReader;
|
import android.util.JsonReader;
|
||||||
import android.util.JsonWriter;
|
import android.util.JsonWriter;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libappbase.BaseBean;
|
import cc.winboll.studio.libapputils.bean.BaseBean;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class AESThemeBean extends BaseBean {
|
public class AESThemeBean extends BaseBean {
|
||||||
@@ -16,7 +16,7 @@ public class AESThemeBean extends BaseBean {
|
|||||||
public static final String TAG = "AESThemeBean";
|
public static final String TAG = "AESThemeBean";
|
||||||
|
|
||||||
public enum ThemeType {
|
public enum ThemeType {
|
||||||
AES("默认主题"),
|
DEFAULT("默认主题"),
|
||||||
DEPTH("深奥主题"),
|
DEPTH("深奥主题"),
|
||||||
SKY("天空主题"),
|
SKY("天空主题"),
|
||||||
GOLDEN("辉煌主题"),
|
GOLDEN("辉煌主题"),
|
||||||
@@ -42,7 +42,7 @@ public class AESThemeBean extends BaseBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 保存当前主题
|
// 保存当前主题
|
||||||
int currentThemeStyleID = getThemeStyleID(ThemeType.AES);
|
int currentThemeStyleID = getThemeStyleID(ThemeType.DEFAULT);
|
||||||
|
|
||||||
public AESThemeBean() {
|
public AESThemeBean() {
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ public class AESThemeBean extends BaseBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getThemeStyleID(ThemeType themeType) {
|
public static int getThemeStyleID(ThemeType themeType) {
|
||||||
int themeStyleID = R.style.AESTheme;
|
int themeStyleID = R.style.DefaultAESTheme;
|
||||||
if (AESThemeBean.ThemeType.DEPTH == themeType) {
|
if (AESThemeBean.ThemeType.DEPTH == themeType) {
|
||||||
themeStyleID = R.style.DepthAESTheme;
|
themeStyleID = R.style.DepthAESTheme;
|
||||||
} else if (AESThemeBean.ThemeType.SKY == themeType) {
|
} else if (AESThemeBean.ThemeType.SKY == themeType) {
|
||||||
@@ -110,15 +110,15 @@ public class AESThemeBean extends BaseBean {
|
|||||||
themeStyleID = R.style.MemorAESTheme;
|
themeStyleID = R.style.MemorAESTheme;
|
||||||
} else if (AESThemeBean.ThemeType.TAO == themeType) {
|
} else if (AESThemeBean.ThemeType.TAO == themeType) {
|
||||||
themeStyleID = R.style.TaoAESTheme;
|
themeStyleID = R.style.TaoAESTheme;
|
||||||
} else if (AESThemeBean.ThemeType.AES == themeType) {
|
} else if (AESThemeBean.ThemeType.DEFAULT == themeType) {
|
||||||
themeStyleID = R.style.AESTheme;
|
themeStyleID = R.style.DefaultAESTheme;
|
||||||
}
|
}
|
||||||
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
|
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
|
||||||
return themeStyleID;
|
return themeStyleID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
|
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
|
||||||
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.AES;
|
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||||
if (R.style.DepthAESTheme == nThemeStyleID) {
|
if (R.style.DepthAESTheme == nThemeStyleID) {
|
||||||
themeStyle = AESThemeBean.ThemeType.DEPTH ;
|
themeStyle = AESThemeBean.ThemeType.DEPTH ;
|
||||||
} else if (R.style.SkyAESTheme == nThemeStyleID) {
|
} else if (R.style.SkyAESTheme == nThemeStyleID) {
|
||||||
@@ -129,8 +129,8 @@ public class AESThemeBean extends BaseBean {
|
|||||||
themeStyle = AESThemeBean.ThemeType.MEMOR ;
|
themeStyle = AESThemeBean.ThemeType.MEMOR ;
|
||||||
} else if (R.style.TaoAESTheme == nThemeStyleID) {
|
} else if (R.style.TaoAESTheme == nThemeStyleID) {
|
||||||
themeStyle = AESThemeBean.ThemeType.TAO ;
|
themeStyle = AESThemeBean.ThemeType.TAO ;
|
||||||
} else if (R.style.AESTheme == nThemeStyleID) {
|
} else if (R.style.DefaultAESTheme == nThemeStyleID) {
|
||||||
themeStyle = AESThemeBean.ThemeType.AES;
|
themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||||
}
|
}
|
||||||
//LogUtils.d(TAG, "themeStyle " + Integer.toString(themeStyle.ordinal()));
|
//LogUtils.d(TAG, "themeStyle " + Integer.toString(themeStyle.ordinal()));
|
||||||
return themeStyle;
|
return themeStyle;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import android.content.DialogInterface;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
|
|||||||
@@ -0,0 +1,170 @@
|
|||||||
|
package cc.winboll.studio.libaes.unittests;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/06/14 03:43:23
|
||||||
|
* @Describe AES类库主窗口
|
||||||
|
*/
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libaes.R;
|
||||||
|
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||||
|
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||||
|
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
|
||||||
|
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
|
||||||
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
|
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class LibraryActivity extends DrawerFragmentActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "LibraryActivity";
|
||||||
|
|
||||||
|
TestAButtonFragment mTestAButtonFragment;
|
||||||
|
TestViewPageFragment mTestViewPageFragment;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (mTestAButtonFragment == null) {
|
||||||
|
mTestAButtonFragment = new TestAButtonFragment();
|
||||||
|
addFragment(mTestAButtonFragment);
|
||||||
|
}
|
||||||
|
showFragment(mTestAButtonFragment);
|
||||||
|
setSubtitle(TAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||||
|
super.initDrawerMenuItemList(listDrawerMenu);
|
||||||
|
LogUtils.d(TAG, "initDrawerMenuItemList");
|
||||||
|
//listDrawerMenu.clear();
|
||||||
|
// 添加抽屉菜单项
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||||
|
notifyDrawerMenuDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||||
|
super.reinitDrawerMenuItemList(listDrawerMenu);
|
||||||
|
LogUtils.d(TAG, "reinitDrawerMenuItemList");
|
||||||
|
//listDrawerMenu.clear();
|
||||||
|
// 添加抽屉菜单项
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||||
|
notifyDrawerMenuDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DrawerFragmentActivity.ActivityType initActivityType() {
|
||||||
|
return DrawerFragmentActivity.ActivityType.Main;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_library, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
super.onItemClick(parent, view, position, id);
|
||||||
|
switch (position) {
|
||||||
|
case 0 : {
|
||||||
|
if (mTestAButtonFragment == null) {
|
||||||
|
mTestAButtonFragment = new TestAButtonFragment();
|
||||||
|
addFragment(mTestAButtonFragment);
|
||||||
|
}
|
||||||
|
showFragment(mTestAButtonFragment);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1 : {
|
||||||
|
if (mTestViewPageFragment == null) {
|
||||||
|
mTestViewPageFragment = new TestViewPageFragment();
|
||||||
|
addFragment(mTestViewPageFragment);
|
||||||
|
}
|
||||||
|
showFragment(mTestViewPageFragment);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int nItemId = item.getItemId();
|
||||||
|
// if (item.getItemId() == R.id.item_log) {
|
||||||
|
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
|
||||||
|
// } else
|
||||||
|
if (nItemId == R.id.item_atoast) {
|
||||||
|
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (nItemId == R.id.item_atoolbar) {
|
||||||
|
Intent intent = new Intent(this, TestAToolbarActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_asupporttoolbar) {
|
||||||
|
Intent intent = new Intent(this, TestASupportToolbarActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_colordialog) {
|
||||||
|
ColorPickerDialog dlg = new ColorPickerDialog(this, getResources().getColor(R.color.colorPrimary));
|
||||||
|
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeColorChanged() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onColorChanged(int color) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterColorChanged() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
dlg.show();
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_dialogstoragepath) {
|
||||||
|
final StoragePathDialog dialog = new StoragePathDialog(this, 0);
|
||||||
|
dialog.setOnOKClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_localfileselectdialog) {
|
||||||
|
final LocalFileSelectDialog dialog = new LocalFileSelectDialog(this);
|
||||||
|
dialog.setOnOKClickListener(new LocalFileSelectDialog.OKClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onOKClick(String sz) {
|
||||||
|
Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
|
||||||
|
//dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_secondarylibraryactivity) {
|
||||||
|
Intent intent = new Intent(this, SecondaryLibraryActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
} else if (nItemId == R.id.item_drawerfragmentactivity) {
|
||||||
|
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
// else if (nItemId == R.id.item_about) {
|
||||||
|
// Intent intent = new Intent(this, AboutActivity.class);
|
||||||
|
// startActivity(intent);
|
||||||
|
// }
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +1,23 @@
|
|||||||
package cc.winboll.studio.libaes.unittests;
|
package cc.winboll.studio.libaes.unittests;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@QQ.COM
|
* @Author ZhanGSKen@QQ.COM
|
||||||
* @Date 2024/06/15 00:58:10
|
* @Date 2024/06/15 00:58:10
|
||||||
* @Describe 第二级窗口
|
* @Describe 第二级窗口
|
||||||
*/
|
*/
|
||||||
public class SecondaryLibraryActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
public class SecondaryLibraryActivity extends DrawerFragmentActivity {
|
||||||
|
|
||||||
public static final String TAG = "SecondaryLibraryActivity";
|
public static final String TAG = "SecondaryLibraryActivity";
|
||||||
|
|
||||||
SecondaryLibraryFragment mSecondaryLibraryFragment;
|
SecondaryLibraryFragment mSecondaryLibraryFragment;
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -55,7 +43,7 @@ public class SecondaryLibraryActivity extends DrawerFragmentActivity implements
|
|||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int nItemId = item.getItemId();
|
int nItemId = item.getItemId();
|
||||||
if (nItemId == R.id.item_test) {
|
if (nItemId == R.id.item_test) {
|
||||||
Toast.makeText(getApplicationContext(), "item_test", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplication(), "item_test", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import android.os.Bundle;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.views.AButton;
|
import cc.winboll.studio.libaes.views.AButton;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
|
|
||||||
public class TestAButtonFragment extends Fragment {
|
public class TestAButtonFragment extends Fragment {
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ public class TestAButtonFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
LogUtils.d(TAG, "onClick");
|
LogUtils.d(TAG, "onClick");
|
||||||
ToastUtils.show("AButton");
|
Toast.makeText(getActivity(), "AButton", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,27 +5,19 @@ package cc.winboll.studio.libaes.unittests;
|
|||||||
* @Date 2024/07/16 01:14:00
|
* @Date 2024/07/16 01:14:00
|
||||||
* @Describe TestASupportToolbarActivity
|
* @Describe TestASupportToolbarActivity
|
||||||
*/
|
*/
|
||||||
import android.app.Activity;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
|
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class TestASupportToolbarActivity extends AppCompatActivity implements IWinBollActivity {
|
public class TestASupportToolbarActivity extends AppCompatActivity {
|
||||||
|
|
||||||
public static final String TAG = "TestASupportToolbarActivity";
|
public static final String TAG = "TestASupportToolbarActivity";
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|||||||
@@ -10,22 +10,11 @@ import android.os.Bundle;
|
|||||||
import android.widget.Toolbar;
|
import android.widget.Toolbar;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
public class TestAToolbarActivity extends Activity implements IWinBollActivity {
|
public class TestAToolbarActivity extends Activity {
|
||||||
|
|
||||||
public static final String TAG = "TestAToolbarActivity";
|
public static final String TAG = "TestAToolbarActivity";
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return TAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
AESThemeUtil.applyAppTheme(this);
|
AESThemeUtil.applyAppTheme(this);
|
||||||
|
|||||||
@@ -4,40 +4,26 @@ package cc.winboll.studio.libaes.unittests;
|
|||||||
* @Author ZhanGSKen@QQ.COM
|
* @Author ZhanGSKen@QQ.COM
|
||||||
* @Date 2024/06/30 15:00:51
|
* @Date 2024/06/30 15:00:51
|
||||||
*/
|
*/
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class TestDrawerFragmentActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
public class TestDrawerFragmentActivity extends DrawerFragmentActivity {
|
||||||
|
|
||||||
@Override
|
|
||||||
public Activity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final String TAG = "TestDrawerFragmentActivity";
|
public static final String TAG = "TestDrawerFragmentActivity";
|
||||||
|
|
||||||
TestFragment1 mTestFragment1;
|
TestFragment1 mTestFragment1;
|
||||||
TestFragment2 mTestFragment2;
|
TestFragment2 mTestFragment2;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -80,7 +66,7 @@ public class TestDrawerFragmentActivity extends DrawerFragmentActivity implement
|
|||||||
super.onItemClick(parent, view, position, id);
|
super.onItemClick(parent, view, position, id);
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0 : {
|
case 0 : {
|
||||||
Toast.makeText(getApplicationContext(), "0", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "0", Toast.LENGTH_SHORT).show();
|
||||||
//LogUtils.d(TAG, "MenuItem 1");
|
//LogUtils.d(TAG, "MenuItem 1");
|
||||||
showFragment(mTestFragment1);
|
showFragment(mTestFragment1);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ package cc.winboll.studio.libaes.unittests;
|
|||||||
* @Date 2024/07/16 01:35:56
|
* @Date 2024/07/16 01:35:56
|
||||||
* @Describe TestViewPageFragment
|
* @Describe TestViewPageFragment
|
||||||
*/
|
*/
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -18,17 +17,12 @@ import androidx.viewpager.widget.ViewPager;
|
|||||||
import cc.winboll.studio.libaes.ImagePagerAdapter;
|
import cc.winboll.studio.libaes.ImagePagerAdapter;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TestViewPageFragment extends Fragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
|
public class TestViewPageFragment extends Fragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
|
||||||
|
|
||||||
public static final String TAG = "TestViewPageFragment";
|
public static final String TAG = "TestViewPageFragment";
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
LogView mLogView;
|
|
||||||
|
|
||||||
private ViewPager viewPager;
|
private ViewPager viewPager;
|
||||||
private List<View> views; //用来存放放进ViewPager里面的布局
|
private List<View> views; //用来存放放进ViewPager里面的布局
|
||||||
@@ -42,10 +36,6 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
mView = inflater.inflate(R.layout.fragment_viewpage, container, false);
|
mView = inflater.inflate(R.layout.fragment_viewpage, container, false);
|
||||||
mContext = getActivity();
|
|
||||||
|
|
||||||
mLogView = mView.findViewById(R.id.logview);
|
|
||||||
mLogView.start();
|
|
||||||
|
|
||||||
//viewPager = findViewById(R.id.activitymainViewPager1);
|
//viewPager = findViewById(R.id.activitymainViewPager1);
|
||||||
initData();
|
initData();
|
||||||
@@ -70,13 +60,12 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
|||||||
initPoint();//初始化页面下方的点
|
initPoint();//初始化页面下方的点
|
||||||
viewPager.setOnPageChangeListener(this);
|
viewPager.setOnPageChangeListener(this);
|
||||||
initAOHPCTCSeekBar();
|
initAOHPCTCSeekBar();
|
||||||
initAOHPCTCSeekBar2();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化所要显示的布局
|
//初始化所要显示的布局
|
||||||
void initData() {
|
void initData() {
|
||||||
ViewPager viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
|
ViewPager viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
View view1 = inflater.inflate(R.layout.viewpage_atickprogressbar, viewPager, false);
|
View view1 = inflater.inflate(R.layout.viewpage_atickprogressbar, viewPager, false);
|
||||||
View view2 = inflater.inflate(R.layout.viewpage_acard, viewPager, false);
|
View view2 = inflater.inflate(R.layout.viewpage_acard, viewPager, false);
|
||||||
View view3 = inflater.inflate(R.layout.viewpage_aohpctccard, viewPager, false);
|
View view3 = inflater.inflate(R.layout.viewpage_aohpctccard, viewPager, false);
|
||||||
@@ -196,31 +185,14 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initAOHPCTCSeekBar() {
|
void initAOHPCTCSeekBar() {
|
||||||
AOHPCTCSeekBar seekbar = views.get(3).findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
AOHPCTCSeekBar seekbar = mView.findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
||||||
seekbar.setThumb(mContext.getDrawable(R.drawable.ic_launcher));
|
seekbar.setThumb(getActivity().getDrawable(R.drawable.ic_launcher));
|
||||||
//seekbar.setThumbOffset(200);
|
seekbar.setThumbOffset(10);
|
||||||
//seekbar.setThumbOffset(1);
|
|
||||||
seekbar.setBlurRightDP(50);
|
|
||||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOHPCommit() {
|
public void onOHPCommit() {
|
||||||
ToastUtils.show("onOHPCommit");
|
Toast.makeText(getActivity(), "onOHPCommit ", Toast.LENGTH_SHORT).show();
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void initAOHPCTCSeekBar2() {
|
|
||||||
AOHPCTCSeekBar seekbar = views.get(3).findViewById(R.id.fragmentviewpageAOHPCTCSeekBar2);
|
|
||||||
seekbar.setThumb(mContext.getDrawable(R.drawable.ic_call));
|
|
||||||
//seekbar.setThumbOffset(200);
|
|
||||||
//seekbar.setThumbOffset(1);
|
|
||||||
seekbar.setBlurRightDP(50);
|
|
||||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOHPCommit() {
|
|
||||||
ToastUtils.show("onOHPCommit 2");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
|
||||||
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||||
|
|
||||||
public class AESThemeUtil {
|
public class AESThemeUtil {
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public class AESThemeUtil {
|
|||||||
|
|
||||||
public static <T extends Context> int getThemeTypeID(T context) {
|
public static <T extends Context> int getThemeTypeID(T context) {
|
||||||
AESThemeBean bean = AESThemeBean.loadBean(context, AESThemeBean.class);
|
AESThemeBean bean = AESThemeBean.loadBean(context, AESThemeBean.class);
|
||||||
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES): bean.getCurrentThemeTypeID();
|
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT): bean.getCurrentThemeTypeID();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends Context> void saveThemeStyleID(T context, int nThemeTypeID) {
|
public static <T extends Context> void saveThemeStyleID(T context, int nThemeTypeID) {
|
||||||
@@ -41,9 +41,9 @@ public class AESThemeUtil {
|
|||||||
activity.setTheme(getThemeTypeID(activity));
|
activity.setTheme(getThemeTypeID(activity));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
|
public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
|
||||||
activity.setTheme(getThemeTypeID(activity.getApplicationContext()));
|
activity.setTheme(getThemeTypeID(activity.getApplicationContext()));
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static <T extends Activity> void applyAppTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
public static <T extends Activity> void applyAppTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||||
@@ -53,9 +53,9 @@ public class AESThemeUtil {
|
|||||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static <T extends Activity> void inflateMenu(T activity, Menu menu) {
|
public static <T extends Activity> void inflateMenu(T activity, Menu menu) {
|
||||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||||
@@ -65,9 +65,9 @@ public class AESThemeUtil {
|
|||||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
|
public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
|
||||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static <T extends Activity> boolean onAppThemeItemSelected(T activity, MenuItem item) {
|
public static <T extends Activity> boolean onAppThemeItemSelected(T activity, MenuItem item) {
|
||||||
int nThemeStyleID;
|
int nThemeStyleID;
|
||||||
@@ -92,7 +92,7 @@ public class AESThemeUtil {
|
|||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class AESThemeUtil {
|
|||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public class AESThemeUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends AppCompatActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
public static <T extends WinBollActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||||
int nThemeStyleID;
|
int nThemeStyleID;
|
||||||
if (R.id.item_depththeme == item.getItemId()) {
|
if (R.id.item_depththeme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
||||||
@@ -154,38 +154,7 @@ public class AESThemeUtil {
|
|||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T extends DrawerFragmentActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
|
||||||
int nThemeStyleID;
|
|
||||||
if (R.id.item_depththeme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_skytheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_goldentheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_memortheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.MEMOR);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_taotheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user