Compare commits
31 Commits
appbase-v1
...
mymessagem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a1d557683 | ||
|
|
39116f0912 | ||
|
|
a6b711b38b | ||
|
|
d1703551f5 | ||
|
|
d63f7d3d83 | ||
|
|
06b399846d | ||
|
|
e06efea08e | ||
|
|
890ff6eda9 | ||
|
|
e5a5eda9b6 | ||
|
|
174a052088 | ||
|
|
fbd8441264 | ||
|
|
fb92e9f673 | ||
|
|
d34d1e2796 | ||
|
|
36fb8b41a4 | ||
|
|
fe70a18547 | ||
|
|
46e4ee7fb7 | ||
|
|
b2b959232c | ||
|
|
b11f814c41 | ||
|
|
1e991aed7e | ||
|
|
f56125f82a | ||
|
|
33b7b65239 | ||
|
|
664d14ad84 | ||
|
|
47cb393f76 | ||
|
|
6495f1c66e | ||
|
|
f0c52d1e02 | ||
|
|
d948f31331 | ||
|
|
e1b3087020 | ||
|
|
03e21ab81c | ||
|
|
ac72132969 | ||
|
|
cedb5f521b | ||
|
|
396df6713c |
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
|
||||||
#Thu Apr 03 11:14:05 HKT 2025
|
#Sun Jan 19 04:58:59 GMT 2025
|
||||||
stageCount=7
|
stageCount=3
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=7.6
|
||||||
publishVersion=15.2.6
|
publishVersion=7.6.2
|
||||||
buildCount=0
|
buildCount=4
|
||||||
baseBetaVersion=15.2.7
|
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,93 +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");
|
|
||||||
//appInfo.setIsAddDebugTools(false);
|
|
||||||
appInfo.setIsAddDebugTools(BuildConfig.DEBUG);
|
|
||||||
return new AboutView(mContext, appInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,26 +5,16 @@ package cc.winboll.studio.aes;
|
|||||||
* @Date 2024/06/13 19:03:58
|
* @Date 2024/06/13 19:03:58
|
||||||
* @Describe AES应用类
|
* @Describe AES应用类
|
||||||
*/
|
*/
|
||||||
import android.view.Gravity;
|
|
||||||
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 {
|
||||||
|
|
||||||
public static final String TAG = "App";
|
public static final String TAG = "App";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
//setIsDebug(BuildConfig.DEBUG);
|
||||||
// 初始化 Toast 框架
|
|
||||||
ToastUtils.init(this);
|
|
||||||
// 设置 Toast 布局样式
|
|
||||||
ToastUtils.setView(R.layout.view_toast);
|
|
||||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
|
||||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,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>
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ dependencies {
|
|||||||
// Android 类库
|
// Android 类库
|
||||||
//api 'com.android.support:appcompat-v7:28.0.0'
|
//api 'com.android.support:appcompat-v7:28.0.0'
|
||||||
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"
|
exclude group: "com.android.support", module: "support-vector-drawable"
|
||||||
exclude group: "com.android.support:animated-vector-drawable:28.0.0"
|
|
||||||
}
|
}
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||||
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||||
@@ -67,6 +66,6 @@ dependencies {
|
|||||||
// 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'
|
api 'com.android.support:recyclerview-v7:28.0.0'
|
||||||
|
|
||||||
api 'cc.winboll.studio:libapputils:15.2.2'
|
api 'cc.winboll.studio:libapputils:15.2.1'
|
||||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
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
|
||||||
#Thu Apr 03 03:17:18 GMT 2025
|
#Sat Mar 29 04:34:14 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.0
|
publishVersion=15.0.0
|
||||||
buildCount=21
|
buildCount=15
|
||||||
baseBetaVersion=15.0.1
|
baseBetaVersion=15.0.1
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ android {
|
|||||||
|
|
||||||
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 更新后需要手动设置
|
||||||
@@ -67,7 +67,7 @@ dependencies {
|
|||||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||||
//api 'androidx.fragment:fragment:1.1.0'
|
//api 'androidx.fragment:fragment:1.1.0'
|
||||||
|
|
||||||
api 'cc.winboll.studio:libaes:15.2.6'
|
api 'cc.winboll.studio:libaes:15.2.1'
|
||||||
api 'cc.winboll.studio:libapputils:15.2.2'
|
api 'cc.winboll.studio:libapputils:15.2.1'
|
||||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
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
|
||||||
#Thu Apr 03 03:15:55 GMT 2025
|
#Sat Mar 29 04:28:00 GMT 2025
|
||||||
stageCount=0
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.0
|
publishVersion=15.0.0
|
||||||
buildCount=18
|
buildCount=11
|
||||||
baseBetaVersion=15.0.1
|
baseBetaVersion=15.0.1
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import android.os.Handler;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -22,9 +21,7 @@ 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.androidxdemo.R;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
@@ -49,14 +46,6 @@ public class App extends GlobalApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
// 初始化 Toast 框架
|
|
||||||
ToastUtils.init(this);
|
|
||||||
// 设置 Toast 布局样式
|
|
||||||
ToastUtils.setView(R.layout.view_toast);
|
|
||||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
|
||||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
|
||||||
|
|
||||||
//CrashHandler.getInstance().registerGlobal(this);
|
//CrashHandler.getInstance().registerGlobal(this);
|
||||||
//CrashHandler.getInstance().registerPart(this);
|
//CrashHandler.getInstance().registerPart(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ 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;
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
import com.hjq.toast.ToastUtils;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@@ -19,8 +18,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
mLogView = findViewById(R.id.logview);
|
mLogView = findViewById(R.id.logview);
|
||||||
|
|
||||||
ToastUtils.show("onCreate");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
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
1
app/app_update_description.txt
Normal file
1
app/app_update_description.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
54
app/build.gradle
Normal file
54
app/build.gradle
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply from: '../.winboll/winboll_app_build.gradle'
|
||||||
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
|
def genVersionName(def versionName){
|
||||||
|
// 检查编译标志位配置
|
||||||
|
assert (winbollBuildProps['stageCount'] != null)
|
||||||
|
assert (winbollBuildProps['baseVersion'] != null)
|
||||||
|
// 保存基础版本号
|
||||||
|
winbollBuildProps.setProperty("baseVersion", "${versionName}");
|
||||||
|
//保存编译标志配置
|
||||||
|
FileOutputStream fos = new FileOutputStream(winbollBuildPropsFile)
|
||||||
|
winbollBuildProps.store(fos, "${winbollBuildPropsDesc}");
|
||||||
|
fos.close();
|
||||||
|
|
||||||
|
// 返回编译版本号
|
||||||
|
return "${versionName}." + winbollBuildProps['stageCount']
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 32
|
||||||
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "cc.winboll.studio.app"
|
||||||
|
minSdkVersion 21
|
||||||
|
targetSdkVersion 30
|
||||||
|
versionCode 1
|
||||||
|
// versionName 更新后需要手动设置
|
||||||
|
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||||
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
|
versionName "1.8"
|
||||||
|
if(true) {
|
||||||
|
versionName = genVersionName("${versionName}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api project(':winboll-shared')
|
||||||
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
}
|
||||||
8
app/build.properties
Normal file
8
app/build.properties
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
|
#Sun Jan 05 07:55:24 HKT 2025
|
||||||
|
stageCount=17
|
||||||
|
libraryProject=winboll-shared
|
||||||
|
baseVersion=1.8
|
||||||
|
publishVersion=1.8.16
|
||||||
|
buildCount=0
|
||||||
|
baseBetaVersion=1.8.17
|
||||||
17
app/proguard-rules.pro
vendored
Normal file
17
app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
13
app/src/beta/AndroidManifest.xml
Normal file
13
app/src/beta/AndroidManifest.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools" >
|
||||||
|
|
||||||
|
<application
|
||||||
|
tools:replace="android:icon"
|
||||||
|
android:icon="@drawable/ic_winbollbeta">
|
||||||
|
|
||||||
|
<!-- Put flavor specific code here -->
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
||||||
6
app/src/beta/res/values/strings.xml
Normal file
6
app/src/beta/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="app_name">WinBoll-APP+</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
48
app/src/main/AndroidManifest.xml
Normal file
48
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<manifest
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="cc.winboll.studio.app">
|
||||||
|
|
||||||
|
<!-- BIND_AUTOFILL_SERVICE -->
|
||||||
|
<uses-permission android:name="android.permission.BIND_AUTOFILL_SERVICE"/>
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name=".App"
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@drawable/ic_winboll"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||||
|
android:supportsRtl="true">
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="${applicationId}.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/studio_provider"/>
|
||||||
|
|
||||||
|
</provider>
|
||||||
|
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
24
app/src/main/java/cc/winboll/studio/app/App.java
Normal file
24
app/src/main/java/cc/winboll/studio/app/App.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package cc.winboll.studio.app;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/12/08 15:10:51
|
||||||
|
* @Describe 全局应用类
|
||||||
|
*/
|
||||||
|
import cc.winboll.studio.shared.app.WinBollApplication;
|
||||||
|
import cc.winboll.studio.shared.log.LogUtils;
|
||||||
|
|
||||||
|
public class App extends WinBollApplication {
|
||||||
|
|
||||||
|
public static final String TAG = "App";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
// 必须在调用基类前设置应用调试标志,
|
||||||
|
// 这样可以预先设置日志与数据的存储根目录。
|
||||||
|
//setIsDebug(BuildConfig.DEBUG);
|
||||||
|
super.onCreate();
|
||||||
|
LogUtils.d(TAG, "onCreate");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
168
app/src/main/java/cc/winboll/studio/app/MainActivity.java
Normal file
168
app/src/main/java/cc/winboll/studio/app/MainActivity.java
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
package cc.winboll.studio.app;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.shared.app.WinBollActivity;
|
||||||
|
import cc.winboll.studio.shared.app.WinBollActivityManager;
|
||||||
|
import cc.winboll.studio.shared.app.WinBollApplication;
|
||||||
|
import cc.winboll.studio.shared.log.LogUtils;
|
||||||
|
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 {
|
||||||
|
|
||||||
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
|
public static final int REQUEST_HOME_ACTIVITY = 0;
|
||||||
|
public static final int REQUEST_ABOUT_ACTIVITY = 1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isEnableDisplayHomeAsUp() {
|
||||||
|
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
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isAddWinBollToolBar() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Toolbar initToolBar() {
|
||||||
|
return findViewById(R.id.activitymainToolbar1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_winboll_app_main, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == R.id.item_unittest) {
|
||||||
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, UnitTestActivity.class);
|
||||||
|
} else if (item.getItemId() == R.id.item_exit) {
|
||||||
|
exit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
android:clickable="true">
|
android:clickable="true">
|
||||||
<item android:drawable="@drawable/ic_launcher_background"/>
|
<item android:drawable="@drawable/ic_launcher_background"/>
|
||||||
<item
|
<item
|
||||||
android:left="0dp"
|
android:left="15dp"
|
||||||
android:top="0dp"
|
android:top="15dp"
|
||||||
android:right="0dp"
|
android:right="15dp"
|
||||||
android:bottom="0dp"
|
android:bottom="15dp"
|
||||||
android:drawable="@drawable/winboll_logo"/>
|
android:drawable="@drawable/ic_launcher_foreground"/>
|
||||||
</layer-list>
|
</layer-list>
|
||||||
29
app/src/main/res/layout/activity_main.xml
Normal file
29
app/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Hello, WinBoll!"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
32
app/src/main/res/layout/view_toast.xml
Normal file
32
app/src/main/res/layout/view_toast.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?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>
|
||||||
5
app/src/main/res/menu/toolbar_winboll_app_main.xml
Normal file
5
app/src/main/res/menu/toolbar_winboll_app_main.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
</menu>
|
||||||
10
app/src/main/res/values/colors.xml
Normal file
10
app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- WinBoll 默认方案 -->
|
||||||
|
<color name="colorPrimary">#FF196ABC</color>
|
||||||
|
<color name="colorPrimaryDark">#FF002B57</color>
|
||||||
|
<color name="colorAccent">#FF80BFFF</color>
|
||||||
|
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||||
|
<color name="colorToastShadow">#FF000000</color>
|
||||||
|
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||||
|
</resources>
|
||||||
6
app/src/main/res/values/strings.xml
Normal file
6
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="app_name">WinBoll-APP</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
3
app/src/main/res/values/styles.xml
Normal file
3
app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
</resources>
|
||||||
25
app/src/main/res/xml/studio_provider.xml
Normal file
25
app/src/main/res/xml/studio_provider.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<paths>
|
||||||
|
<external-path
|
||||||
|
name="external_storage_root"
|
||||||
|
path="." />
|
||||||
|
<files-path
|
||||||
|
name="files_path"
|
||||||
|
path="." />
|
||||||
|
<cache-path
|
||||||
|
name="cache_path"
|
||||||
|
path="." />
|
||||||
|
<!--/storage/emulated/0/Android/data/...-->
|
||||||
|
<external-files-path
|
||||||
|
name="external_file_path"
|
||||||
|
path="." />
|
||||||
|
<!--代表app 外部存储区域根目录下的文件 Context.getExternalCacheDir目录下的目录-->
|
||||||
|
<external-cache-path
|
||||||
|
name="external_cache_path"
|
||||||
|
path="." />
|
||||||
|
<!--配置root-path。这样子可以读取到sd卡和一些应用分身的目录,否则微信分身保存的图片,就会导致 java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/999/tencent/MicroMsg/WeiXin/export1544062754693.jpg,在小米6的手机上微信分身有这个crash,华为没有
|
||||||
|
-->
|
||||||
|
<root-path
|
||||||
|
name="root_path"
|
||||||
|
path="" />
|
||||||
|
</paths>
|
||||||
12
app/src/stage/AndroidManifest.xml
Normal file
12
app/src/stage/AndroidManifest.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools" >
|
||||||
|
|
||||||
|
<application>
|
||||||
|
|
||||||
|
<!-- Put flavor specific code here -->
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
||||||
6
app/src/stage/res/values/strings.xml
Normal file
6
app/src/stage/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Put flavor specific strings here -->
|
||||||
|
|
||||||
|
</resources>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Apr 12 15:00:29 HKT 2025
|
#Sat Mar 29 11:28:02 HKT 2025
|
||||||
stageCount=5
|
stageCount=3
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.2
|
baseVersion=15.2
|
||||||
publishVersion=15.2.4
|
publishVersion=15.2.2
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.2.5
|
baseBetaVersion=15.2.3
|
||||||
|
|||||||
@@ -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.apputils"
|
applicationId "cc.winboll.studio.apputils"
|
||||||
minSdkVersion 26
|
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.2"
|
versionName "9.2"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -41,9 +41,15 @@ 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'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 12:14:55 HKT 2025
|
#Sat Jan 18 13:03:10 HKT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libapputils
|
libraryProject=libapputils
|
||||||
baseVersion=15.2
|
baseVersion=9.2
|
||||||
publishVersion=15.2.1
|
publishVersion=9.2.1
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.2.2
|
baseBetaVersion=9.2.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/MyUtilsTheme"
|
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||||
android:supportsRtl="true">
|
android:supportsRtl="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
@@ -27,13 +27,9 @@
|
|||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".TestStringToQRCodeViewActivity"/>
|
<activity android:name=".TestWinBollActivity"/>
|
||||||
|
|
||||||
<activity android:name=".TestBBMorseCodeActivity"/>
|
<activity android:name=".TestStringToQrCodeViewActivity"/>
|
||||||
|
|
||||||
<activity android:name=".AssetsHtmlActivity"/>
|
|
||||||
|
|
||||||
<activity android:name=".QRCodeDecodeActivity"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,27 @@ package cc.winboll.studio.apputils;
|
|||||||
* @Date 2024/12/08 15:10:51
|
* @Date 2024/12/08 15:10:51
|
||||||
* @Describe 全局应用类
|
* @Describe 全局应用类
|
||||||
*/
|
*/
|
||||||
import android.app.Application;
|
import android.view.Gravity;
|
||||||
import android.content.Context;
|
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import com.hjq.toast.ToastUtils;
|
||||||
|
import com.hjq.toast.style.WhiteToastStyle;
|
||||||
|
|
||||||
public class App extends GlobalApplication {
|
public class App extends WinBollApplication {
|
||||||
|
|
||||||
public static final String TAG = "App";
|
public static final String TAG = "App";
|
||||||
|
|
||||||
|
public static final String _ACTION_DEBUGVIEW = WinBollApplication.class.getName() + "_ACTION_DEBUGVIEW";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
// 初始化 Toast 框架
|
||||||
|
//
|
||||||
|
ToastUtils.init(this);
|
||||||
|
// 设置 Toast 布局样式
|
||||||
|
//ToastUtils.setView(R.layout.view_toast);
|
||||||
|
ToastUtils.setStyle(new WhiteToastStyle());
|
||||||
|
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +1,38 @@
|
|||||||
package cc.winboll.studio.apputils;
|
package cc.winboll.studio.apputils;
|
||||||
|
|
||||||
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 android.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import cc.winboll.studio.apputils.R;
|
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.activities.QRCodeDecodeActivity;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||||
import java.util.List;
|
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||||
import java.util.Set;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
|
|
||||||
final public class MainActivity extends Activity {
|
final public class MainActivity extends WinBollActivity {
|
||||||
|
|
||||||
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;
|
@Override
|
||||||
LogView mLogView;
|
protected boolean isEnableDisplayHomeAsUp() {
|
||||||
//
|
return false;
|
||||||
// @Override
|
}
|
||||||
// public Activity getActivity() {
|
|
||||||
// return this;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
@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);
|
||||||
|
|
||||||
mLogView = findViewById(R.id.logview);
|
//Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||||
mLogView.start();
|
//setActionBar(toolbar);
|
||||||
|
|
||||||
// 初始化工具栏
|
|
||||||
mToolbar = findViewById(R.id.toolbar);
|
|
||||||
setActionBar(mToolbar);
|
|
||||||
// if (isEnableDisplayHomeAsUp()) {
|
|
||||||
// // 显示后退按钮
|
|
||||||
// getActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
// }
|
|
||||||
// getActionBar().setSubtitle(getTag());
|
|
||||||
|
|
||||||
checkResolveActivity();
|
|
||||||
archiveInstance();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
||||||
//if (prosessIntents(getIntent())) return;
|
//if (prosessIntents(getIntent())) return;
|
||||||
@@ -66,94 +44,44 @@ final public class MainActivity extends Activity {
|
|||||||
// 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 onTestLogActivity(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);
|
||||||
|
|
||||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
|
||||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
|
super.onPostCreate(savedInstanceState);
|
||||||
|
// setSubTitle("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
// exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// void exit() {
|
||||||
|
// YesNoAlertDialog.OnDialogResultListener listener = new YesNoAlertDialog.OnDialogResultListener(){
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onYes() {
|
||||||
|
// WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onNo() {
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
||||||
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
// 处理传入的 Intent 数据
|
// 处理传入的 Intent 数据
|
||||||
//
|
//
|
||||||
@@ -198,106 +126,57 @@ final public class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public String getTag() {
|
||||||
//ToastUtils.show("onCreateOptionsMenu");
|
return TAG;
|
||||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
}
|
||||||
// if (isAddWinBollToolBar()) {
|
|
||||||
// //ToastUtils.show("mIWinBoll.isAddWinBollToolBar()");
|
|
||||||
// getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
|
|
||||||
// }
|
|
||||||
if (App.isDebuging()) {
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_studio_debug, menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isAddWinBollToolBar() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Toolbar initToolBar() {
|
||||||
|
return findViewById(R.id.activitymainToolbar1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_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_exit) {
|
if (item.getItemId() == R.id.item_testwinboll) {
|
||||||
//exit();
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestWinBollActivity.class);
|
||||||
return true;
|
|
||||||
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
|
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
|
||||||
Intent intent = new Intent(this, TestStringToQRCodeViewActivity.class);
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
||||||
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
|
||||||
//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 exit() {
|
public void onTestJavascriptHtmlActivity(View view) {
|
||||||
// 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 onTestAssetsHtmlActivity(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");
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AssetsHtmlActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
|
||||||
startActivity(intent);
|
|
||||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AssetsHtmlActivity.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onResume();
|
switch (requestCode) {
|
||||||
mLogView.start();
|
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
||||||
|
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
||||||
|
ToastUtils.show(text);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default : {
|
||||||
|
ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
protected void onActivithyResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
switch (requestCode) {
|
|
||||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
|
||||||
if (data != null) {
|
|
||||||
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
|
||||||
ToastUtils.show(text);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default : {
|
|
||||||
//ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
|
||||||
super.prosessActivityResult(requestCode, resultCode, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package cc.winboll.studio.apputils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/23 16:14:45
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
public class TestBBMorseCodeActivity extends Activity {
|
|
||||||
|
|
||||||
public static final String TAG = "TestBBMorseCodeActivity";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_testbbmorsecode);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
package cc.winboll.studio.apputils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@QQ.COM
|
|
||||||
* @Date 2025/01/17 19:50:46
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.apputils.R;
|
|
||||||
import cc.winboll.studio.libapputils.views.StringToQrCodeView;
|
|
||||||
|
|
||||||
public class TestStringToQRCodeViewActivity extends Activity {
|
|
||||||
|
|
||||||
public static final String TAG = "TestStringToQrCodeViewActivity";
|
|
||||||
|
|
||||||
StringToQrCodeView mStringToQrCodeView;
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public Activity getActivity() {
|
|
||||||
// return this;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_teststringtoqrcodeview);
|
|
||||||
|
|
||||||
// 初始化工具栏
|
|
||||||
Toolbar mToolbar = findViewById(R.id.toolbar);
|
|
||||||
mToolbar.setSubtitle(TAG);
|
|
||||||
setActionBar(mToolbar);
|
|
||||||
|
|
||||||
mStringToQrCodeView = findViewById(R.id.activityteststringtoqrcodeviewStringToQrCodeView1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
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
|
||||||
|
* @Date 2025/01/17 19:50:46
|
||||||
|
*/
|
||||||
|
public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "TestStringToQrCodeViewActivity";
|
||||||
|
|
||||||
|
StringToQrCodeView mStringToQrCodeView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Toolbar initToolBar() {
|
||||||
|
return findViewById(R.id.activityteststringtoqrcodeviewToolbar1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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_teststringtoqrcodeview);
|
||||||
|
mStringToQrCodeView = findViewById(R.id.activityteststringtoqrcodeviewStringToQrCodeView1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
|
super.onPostCreate(savedInstanceState);
|
||||||
|
setSubTitle(TAG);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package cc.winboll.studio.apputils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/28 17:11:37
|
|
||||||
* @Describe 应用活动窗口基类
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.PersistableBundle;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
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
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
getWinBollActivityManager().registeRemove(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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">
|
|
||||||
|
|
||||||
<android.widget.Toolbar
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/toolbar"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libapputils.views.SimpleWebView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/activityassetshtmlSimpleWebView1"/>
|
|
||||||
|
|
||||||
</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">
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<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"
|
||||||
@@ -27,39 +27,32 @@
|
|||||||
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
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="TestLogActivity"
|
android:text="LogUtils"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onTestLogActivity"/>
|
android:onClick="onLogUtilsClick"/>
|
||||||
|
|
||||||
</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="TestAssetsHtmlActivity"
|
android:text="Test Javascript Html Activity"
|
||||||
android:onClick="onTestAssetsHtmlActivity"/>
|
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>
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +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">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="QRCodeDecodeActivity"/>
|
|
||||||
|
|
||||||
<com.journeyapps.barcodescanner.DecoratedBarcodeView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/activityqrcodedecodeDecoratedBarcodeView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
@@ -6,10 +6,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<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/activityteststringtoqrcodeviewToolbar1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1.0">
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
<cc.winboll.studio.libapputils.views.StringToQrCodeView
|
<cc.winboll.studio.libapputils.view.StringToQrCodeView
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="300dp"
|
android:layout_height="300dp"
|
||||||
android:id="@+id/activityteststringtoqrcodeviewStringToQrCodeView1"/>
|
android:id="@+id/activityteststringtoqrcodeviewStringToQrCodeView1"/>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FF36B5B3">
|
android:background="#FF36B5B3">
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<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/activitytestwinbollToolbar1"/>
|
android:id="@+id/activitytestwinbollToolbar1"/>
|
||||||
|
|||||||
32
apputils/src/main/res/layout/view_toast.xml
Normal file
32
apputils/src/main/res/layout/view_toast.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?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>
|
||||||
@@ -1,13 +1,16 @@
|
|||||||
<?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">
|
||||||
|
<item
|
||||||
|
android:id="@+id/item_testwinboll"
|
||||||
|
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"
|
||||||
<item
|
app:showAsAction="ifRoom"/>
|
||||||
android:id="@+id/item_testcrashreport"
|
|
||||||
android:title="TestCrashReportActivity"/>
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<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,14 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="MyUtilsTheme" parent="UtilsTheme">
|
|
||||||
<item name="attrColorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="themeGlobalCrashActivity">@style/MyUtilsGlobalCrashActivityTheme</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="MyUtilsGlobalCrashActivityTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
|
|
||||||
<item name="colorTittle">#FFF2F2F2</item>
|
|
||||||
<item name="colorTittleBackgound">#FF55ABF8</item>
|
|
||||||
<item name="colorText">#FF55ABF8</item>
|
|
||||||
<item name="colorTextBackgound">#FFF2F2F2</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,11 +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 {
|
||||||
// 本地 Maven 仓库(默认路径为 ~/.m2/repository)
|
|
||||||
mavenLocal()
|
|
||||||
// 或自定义本地仓库路径
|
|
||||||
maven { url "file:///sdcard/.m2/repository" }
|
|
||||||
|
|
||||||
// Nexus Maven 库地址
|
// Nexus Maven 库地址
|
||||||
// "WinBoll Release"
|
// "WinBoll Release"
|
||||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||||
@@ -20,7 +15,7 @@ buildscript {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
//mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
|
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
|
||||||
|
|||||||
1
demo/app_update_description.txt
Normal file
1
demo/app_update_description.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
67
demo/build.gradle
Normal file
67
demo/build.gradle
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply from: '../.winboll/winboll_app_build.gradle'
|
||||||
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
|
def genVersionName(def versionName){
|
||||||
|
// 检查编译标志位配置
|
||||||
|
assert (winbollBuildProps['stageCount'] != null)
|
||||||
|
assert (winbollBuildProps['baseVersion'] != null)
|
||||||
|
// 保存基础版本号
|
||||||
|
winbollBuildProps.setProperty("baseVersion", "${versionName}");
|
||||||
|
//保存编译标志配置
|
||||||
|
FileOutputStream fos = new FileOutputStream(winbollBuildPropsFile)
|
||||||
|
winbollBuildProps.store(fos, "${winbollBuildPropsDesc}");
|
||||||
|
fos.close();
|
||||||
|
|
||||||
|
// 返回编译版本号
|
||||||
|
return "${versionName}." + winbollBuildProps['stageCount']
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 32
|
||||||
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "cc.winboll.studio.demo"
|
||||||
|
minSdkVersion 24
|
||||||
|
targetSdkVersion 30
|
||||||
|
versionCode 1
|
||||||
|
// versionName 更新后需要手动设置
|
||||||
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
|
versionName "1.0"
|
||||||
|
if(true) {
|
||||||
|
versionName = genVersionName("${versionName}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
//api 'cc.winboll.studio:winboll-shared:1.8.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 '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.0'
|
||||||
|
api 'cc.winboll.studio:libappbase:1.0.3'
|
||||||
|
|
||||||
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
}
|
||||||
8
demo/build.properties
Normal file
8
demo/build.properties
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
|
#Mon Jan 13 07:34:21 GMT 2025
|
||||||
|
stageCount=8
|
||||||
|
libraryProject=
|
||||||
|
baseVersion=1.0
|
||||||
|
publishVersion=1.0.7
|
||||||
|
buildCount=11
|
||||||
|
baseBetaVersion=1.0.8
|
||||||
17
demo/proguard-rules.pro
vendored
Normal file
17
demo/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
15
demo/src/beta/AndroidManifest.xml
Normal file
15
demo/src/beta/AndroidManifest.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools" >
|
||||||
|
|
||||||
|
<application
|
||||||
|
|
||||||
|
tools:replace="android:icon"
|
||||||
|
android:icon="@drawable/ic_winbollbeta">
|
||||||
|
|
||||||
|
<!-- Put flavor specific code here -->
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
||||||
6
demo/src/beta/res/values/strings.xml
Normal file
6
demo/src/beta/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="app_name">WinBoll-Demo+</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
39
demo/src/main/AndroidManifest.xml
Normal file
39
demo/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<manifest
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="cc.winboll.studio.demo"
|
||||||
|
android:sharedUserId="cc.winboll.studio">
|
||||||
|
|
||||||
|
<!-- 拥有完全的网络访问权限 -->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name=".App"
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@drawable/ic_winboll"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||||
|
android:supportsRtl="true">
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="standard"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity android:name=".activities.AboutActivity"
|
||||||
|
android:label="AboutActivity"/>
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
19
demo/src/main/java/cc/winboll/studio/demo/App.java
Normal file
19
demo/src/main/java/cc/winboll/studio/demo/App.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package cc.winboll.studio.demo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/11/28 15:42:47
|
||||||
|
* @Describe 全局应用类
|
||||||
|
*/
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
||||||
|
|
||||||
|
public class App extends WinBollApplication {
|
||||||
|
|
||||||
|
public static final String TAG = "App";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
86
demo/src/main/java/cc/winboll/studio/demo/MainActivity.java
Normal file
86
demo/src/main/java/cc/winboll/studio/demo/MainActivity.java
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
package cc.winboll.studio.demo;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
||||||
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
|
|
||||||
|
final public class MainActivity extends WinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
|
public static final int REQUEST_HOME_ACTIVITY = 0;
|
||||||
|
public static final int REQUEST_ABOUT_ACTIVITY = 1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isEnableDisplayHomeAsUp() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
// 设置 WinBoll 应用 UI 类型
|
||||||
|
WinBollApplication.setWinBollUI_TYPE(WinBollApplication.WinBollUI_TYPE.Aplication);
|
||||||
|
//ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isAddWinBollToolBar() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Toolbar initToolBar() {
|
||||||
|
return findViewById(R.id.activitymainToolbar1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// if (item.getItemId() == R.id.item_about) {
|
||||||
|
// try {
|
||||||
|
// WinBollActivity clazzActivity = AboutActivity.class.newInstance();
|
||||||
|
// String tag = clazzActivity.getTag();
|
||||||
|
// LogUtils.d(TAG, "String tag = clazzActivity.getTag(); tag " + tag);
|
||||||
|
// Intent intent = new Intent(getApplicationContext(), AboutActivity.class);
|
||||||
|
// startWinBollActivity(intent, tag);
|
||||||
|
// } catch (IllegalAccessException e) {} catch (InstantiationException e) {}
|
||||||
|
// }
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
demo/src/main/res/drawable/ic_launcher.xml
Normal file
11
demo/src/main/res/drawable/ic_launcher.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:clickable="true">
|
||||||
|
<item android:drawable="@drawable/ic_launcher_background"/>
|
||||||
|
<item
|
||||||
|
android:left="15dp"
|
||||||
|
android:top="15dp"
|
||||||
|
android:right="15dp"
|
||||||
|
android:bottom="15dp"
|
||||||
|
android:drawable="@drawable/ic_launcher_foreground"/>
|
||||||
|
</layer-list>
|
||||||
170
demo/src/main/res/drawable/ic_launcher_background.xml
Normal file
170
demo/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/colorPrimary"
|
||||||
|
android:pathData="M0,0h108v108h-108z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M9,0L9,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,0L19,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,0L29,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,0L39,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,0L49,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,0L59,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,0L69,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,0L79,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M89,0L89,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M99,0L99,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,9L108,9"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,19L108,19"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,29L108,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,39L108,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,49L108,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,59L108,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,69L108,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,79L108,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,89L108,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,99L108,99"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,29L89,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,39L89,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,49L89,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,59L89,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,69L89,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,79L89,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,19L29,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,19L39,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,19L49,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,19L59,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,19L69,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,19L79,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
</vector>
|
||||||
10
demo/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
10
demo/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:viewportWidth="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M16.61,15.15C16.15,15.15 15.77,14.78 15.77,14.32S16.15,13.5 16.61,13.5H16.61C17.07,13.5 17.45,13.86 17.45,14.32C17.45,14.78 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,14.78 6.57,14.32C6.57,13.86 6.95,13.5 7.41,13.5H7.41C7.87,13.5 8.24,13.86 8.24,14.32C8.24,14.78 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14H16.91Z"/>
|
||||||
|
</vector>
|
||||||
10
demo/src/main/res/drawable/shape_gradient.xml
Normal file
10
demo/src/main/res/drawable/shape_gradient.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="#FFFFFFFF"
|
||||||
|
android:startColor="#FFFFFFFF"
|
||||||
|
android:type="linear" />
|
||||||
|
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
</shape>
|
||||||
29
demo/src/main/res/layout/activity_main.xml
Normal file
29
demo/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/activitymainToolbar1"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Hello, WinBoll!"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
32
demo/src/main/res/layout/view_toast.xml
Normal file
32
demo/src/main/res/layout/view_toast.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?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>
|
||||||
9
demo/src/main/res/menu/toolbar_about.xml
Normal file
9
demo/src/main/res/menu/toolbar_about.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?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_help"
|
||||||
|
android:title="HELP"/>
|
||||||
|
|
||||||
|
</menu>
|
||||||
7
demo/src/main/res/menu/toolbar_main.xml
Normal file
7
demo/src/main/res/menu/toolbar_main.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?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_about"
|
||||||
|
android:title="About"/>
|
||||||
|
</menu>
|
||||||
10
demo/src/main/res/values/colors.xml
Normal file
10
demo/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- WinBoll 默认方案 -->
|
||||||
|
<color name="colorPrimary">#FF196ABC</color>
|
||||||
|
<color name="colorPrimaryDark">#FF002B57</color>
|
||||||
|
<color name="colorAccent">#FF80BFFF</color>
|
||||||
|
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||||
|
<color name="colorToastShadow">#FF000000</color>
|
||||||
|
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||||
|
</resources>
|
||||||
6
demo/src/main/res/values/strings.xml
Normal file
6
demo/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="app_name">WinBoll-Demo</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
3
demo/src/main/res/values/styles.xml
Normal file
3
demo/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
</resources>
|
||||||
12
demo/src/stage/AndroidManifest.xml
Normal file
12
demo/src/stage/AndroidManifest.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools" >
|
||||||
|
|
||||||
|
<application>
|
||||||
|
|
||||||
|
<!-- Put flavor specific code here -->
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
||||||
6
demo/src/stage/res/values/strings.xml
Normal file
6
demo/src/stage/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Put flavor specific strings here -->
|
||||||
|
|
||||||
|
</resources>
|
||||||
@@ -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.2'
|
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
|
||||||
#Thu Apr 03 11:13:53 HKT 2025
|
#Sun Jan 19 04:58:59 GMT 2025
|
||||||
stageCount=7
|
stageCount=3
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=7.6
|
||||||
publishVersion=15.2.6
|
publishVersion=7.6.2
|
||||||
buildCount=0
|
buildCount=4
|
||||||
baseBetaVersion=15.2.7
|
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