保持现有Contacts分支,加入紧急修复分支。
This commit is contained in:
commit
58dabb7138
20
README.md
20
README.md
@ -9,8 +9,8 @@
|
||||
|
||||
## WinBoll 项目组研发计划
|
||||
致力于把 WinBoll-APP 应用在手机端 Android 项目开发。
|
||||
也在探索 https://gitea.winboll.cc/<WinBoll 项目组>/WinBoll-APP.git 应用于 WinBoll-APP APK 分发。
|
||||
更想进阶 https://github.com/<WinBoll 项目组>/WinBoll-APP.git 应用于 WinBoll-APP Beta APK 分发。
|
||||
也在探索 https://gitea.winboll.cc/<WinBoll 项目组>/APP.git 应用于 WinBoll-APP APK 分发。
|
||||
更想进阶 https://github.com/<WinBoll 项目组>/APP.git 应用于 WinBoll-APP Beta APK 分发。
|
||||
|
||||
## WinBoll-APP 汗下...
|
||||
#### ☁应用何置如此呢。且观用户云云。
|
||||
@ -55,10 +55,10 @@
|
||||
☁ WinBoll 主机建立 1Panel Gitea 应用。
|
||||
☁ WinBoll 主机设置 WinBoll 应用为非登录状态。
|
||||
☁ WinBoll 主机建立 WinBoll 账户与 WinBoll 用户组。
|
||||
☁ WinBoll 账户 User ID 为: winboll。
|
||||
☁ WinBoll 用户组 Group ID 为: winboll。
|
||||
☁ WinBoll 账户 User ID 为: J。
|
||||
☁ WinBoll 用户组 Group ID 为: Studio。
|
||||
☁ WinBoll 主机 WinBoll 1Panel Gitea 建立 WinBoll 工作组。
|
||||
☁ WinBoll 主机 WinBoll 1Panel Gitea 用户项目 APK 编译输出目录为 /sdcard/<用户名>/WinBoll/app/
|
||||
☁ WinBoll 主机 WinBoll 1Panel Gitea 用户项目 APK 编译输出目录为 /sdcard/WinBollStudio/<用户名>/APKs/
|
||||
☁ WinBoll 项目配置文件示例为 "<WinBoll 项目根目录>/.winboll/winboll.properties-demo"(WinBoll 项目已设置)
|
||||
☁ WinBoll 项目配置文件为 "<WinBoll 项目根目录>/.winboll/winboll.properties"
|
||||
☁ WinBoll 项目配置文件设定为源码提交时忽略。(WinBoll 项目已设置)
|
||||
@ -72,17 +72,17 @@
|
||||
☁ MySQL winbollclient 数据库中
|
||||
WinBoll 客户端用户信息设定为:
|
||||
<用户名, 验证密码, 验证邮箱, 验证手机, 唯一存储令牌Token, 备用验证邮箱>。
|
||||
☁ WinBoll 项目源码仓库托管在 WinBoll 1Panel Gitea 目录 /opt/1panel/apps/gitea/gitea/data/git/repositories/winboll/winboll.git中。
|
||||
☁ WinBoll 项目源码仓库托管在 WinBoll 1Panel Gitea 目录 /opt/1panel/apps/gitea/gitea/data/git/repositories/studio/app.git中。
|
||||
☁ WinBoll 主机提供 WinBoll 1Panel Gitea 应用的 WinBoll 项目源码仓库存取功能。(Gitea 应用已提供)
|
||||
☁ WinBoll 主机提供 WinBoll Gitea 项目仓库存档功能。(Gitea 应用已提供)
|
||||
☁ 提供 WinBoll 客户端用户登录功能。(Gitea 应用已提供)
|
||||
|
||||
### ☁ 看远方 ☁ ###
|
||||
### ☁ 心忧虑 ☁ WinBoll-APP 应用前置需求
|
||||
☁ WinBoll-APP WinBoll 项目根目录设定为手机的 /sdcard/WinBoll 目录。(需要用户手动建立文件夹)
|
||||
☁ WinBoll-APP WinBoll 项目根目录设定为手机的 /sdcard/WinBollStudio/Sources 目录。(需要用户手动建立文件夹)
|
||||
☁ WinBoll-APP 具有手机 /sdcard/WinBoll 目录的存储权限。(需要手机操作系统授权)
|
||||
☁ WinBoll-APP WinBoll 项目仓库源码存储路径为 /sdcard/WinBoll/repositories/winboll.git(需要用户手动建立文件夹)
|
||||
☁ WinBoll-APP 项目 APK 编译输出目录为 /sdcard/WinBoll/app/
|
||||
☁ WinBoll-APP WinBoll 项目仓库源码存储路径为 /sdcard/WinBollStudio/Sources/APP.git(需要用户手动建立文件夹)
|
||||
☁ WinBoll-APP 项目 APK 编译输出目录为 /sdcard/WinBollStudio/APKs/
|
||||
☁ WinBoll-APP 应用签名验证可定制化。(WinBoll 项目已提供)
|
||||
☁ WinBoll-APP 与系列衍生 APP 应用共享 cc.winboll.studio 命名空间资源。(WinBoll 项目已提供)
|
||||
☁ WinBoll-APP 用户客户端信息存储在命名空间为 WinBoll APP MySQLLite 应用的 winbollappclient 数据库中。
|
||||
@ -92,7 +92,7 @@
|
||||
|
||||
### ☁ 云游四方 ☁ ###
|
||||
### ☁ 呔! ☁ WinBoll-APP 应用需求规划
|
||||
☁ WinBoll-APP 提供手机目录 /sdcard/WinBoll 的 WinBoll 项目源码管理功能。
|
||||
☁ WinBoll-APP 提供手机目录 /sdcard/WinBollStudio/Sources 的 WinBoll 项目源码管理功能。
|
||||
|
||||
### ☁ 吁! ☁ WinBoll-APP 共享计划前景
|
||||
☁ WinBoll-APP 将会实现 https://winboll.cc/api 访问功能。
|
||||
|
@ -19,17 +19,17 @@ def genVersionName(def versionName){
|
||||
|
||||
android {
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "33.0.3"
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.aes"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "7.6"
|
||||
versionName "15.2"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@ -41,29 +41,9 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
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'])
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sun Jan 19 04:58:59 GMT 2025
|
||||
stageCount=3
|
||||
#Thu Apr 03 11:14:05 HKT 2025
|
||||
stageCount=7
|
||||
libraryProject=libaes
|
||||
baseVersion=7.6
|
||||
publishVersion=7.6.2
|
||||
buildCount=4
|
||||
baseBetaVersion=7.6.3
|
||||
baseVersion=15.2
|
||||
publishVersion=15.2.6
|
||||
buildCount=0
|
||||
baseBetaVersion=15.2.7
|
||||
|
@ -8,9 +8,10 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||
android:theme="@style/MyAESTheme"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true">
|
||||
android:supportsRtl="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
@ -30,6 +31,8 @@
|
||||
android:name="android.max_aspect"
|
||||
android:value="4.0"/>
|
||||
|
||||
<activity android:name=".AboutActivity"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
93
aes/src/main/java/cc/winboll/studio/aes/AboutActivity.java
Normal file
93
aes/src/main/java/cc/winboll/studio/aes/AboutActivity.java
Normal file
@ -0,0 +1,93 @@
|
||||
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,16 +5,26 @@ package cc.winboll.studio.aes;
|
||||
* @Date 2024/06/13 19:03:58
|
||||
* @Describe AES应用类
|
||||
*/
|
||||
import android.view.Gravity;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
|
||||
public class App extends GlobalApplication {
|
||||
|
||||
|
||||
public static final String TAG = "App";
|
||||
|
||||
@Override
|
||||
public void 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,12 +5,193 @@ package cc.winboll.studio.aes;
|
||||
* @Date 2024/06/13 19:05:52
|
||||
* @Describe 应用主窗口
|
||||
*/
|
||||
import cc.winboll.studio.libaes.unittests.LibraryActivity;
|
||||
import android.app.Activity;
|
||||
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";
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
60
aes/src/main/java/cc/winboll/studio/aes/WinBollActivity.java
Normal file
60
aes/src/main/java/cc/winboll/studio/aes/WinBollActivity.java
Normal file
@ -0,0 +1,60 @@
|
||||
package cc.winboll.studio.aes;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import android.view.MenuItem;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/30 00:34:02
|
||||
* @Describe WinBoll 活动窗口通用基类
|
||||
*/
|
||||
public class WinBollActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "WinBollActivity";
|
||||
|
||||
protected volatile AESThemeBean.ThemeType mThemeType;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
mThemeType = getThemeType();
|
||||
setThemeStyle();
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
AESThemeBean.ThemeType getThemeType() {
|
||||
/*SharedPreferences sharedPreferences = getSharedPreferences(
|
||||
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
||||
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
||||
*/
|
||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
||||
}
|
||||
|
||||
void setThemeStyle() {
|
||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if(item.getItemId() == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
@ -6,16 +6,17 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activityassetshtmlToolbar1"/>
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<cc.winboll.studio.libapputils.view.SimpleWebView
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/activityassetshtmlSimpleWebView1"/>
|
||||
android:id="@+id/aboutviewroot_ll"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<item
|
||||
android:id="@+id/item_localfileselectdialog"
|
||||
android:title="LocalFileSelectDialog"/>
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/item_atoolbar"
|
||||
android:title="Test AToolbar"/>
|
7
aes/src/main/res/values/colors.xml
Normal file
7
aes/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?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"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="MyAESTheme" parent="AESTheme">
|
||||
</style>
|
||||
</resources>
|
||||
|
6
aes/src/main/res/xml/network_security_config.xml
Normal file
6
aes/src/main/res/xml/network_security_config.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="true">winboll.cc</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
@ -49,7 +49,8 @@ dependencies {
|
||||
// Android 类库
|
||||
//api 'com.android.support:appcompat-v7:28.0.0'
|
||||
api('com.android.support:appcompat-v7:28.0.0'){
|
||||
exclude group: "com.android.support", module: "support-vector-drawable"
|
||||
//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
|
||||
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||
@ -66,6 +67,6 @@ dependencies {
|
||||
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
||||
api 'com.android.support:recyclerview-v7:28.0.0'
|
||||
|
||||
api 'cc.winboll.studio:libapputils:15.2.1'
|
||||
api 'cc.winboll.studio:libapputils:15.2.2'
|
||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Mar 29 04:34:14 GMT 2025
|
||||
#Thu Apr 03 03:17:18 GMT 2025
|
||||
stageCount=0
|
||||
libraryProject=
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=15
|
||||
buildCount=21
|
||||
baseBetaVersion=15.0.1
|
||||
|
@ -23,7 +23,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.androidxdemo"
|
||||
minSdkVersion 26
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
@ -67,7 +67,7 @@ dependencies {
|
||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||
//api 'androidx.fragment:fragment:1.1.0'
|
||||
|
||||
api 'cc.winboll.studio:libaes:15.2.1'
|
||||
api 'cc.winboll.studio:libapputils:15.2.1'
|
||||
api 'cc.winboll.studio:libaes:15.2.6'
|
||||
api 'cc.winboll.studio:libapputils:15.2.2'
|
||||
api 'cc.winboll.studio:libappbase:15.2.2'
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Mar 29 04:28:00 GMT 2025
|
||||
#Thu Apr 03 03:15:55 GMT 2025
|
||||
stageCount=0
|
||||
libraryProject=
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=11
|
||||
buildCount=18
|
||||
baseBetaVersion=15.0.1
|
||||
|
@ -14,6 +14,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.ViewGroup;
|
||||
@ -21,7 +22,9 @@ import android.widget.HorizontalScrollView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.androidxdemo.R;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
@ -46,6 +49,14 @@ public class App extends GlobalApplication {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
// 初始化 Toast 框架
|
||||
ToastUtils.init(this);
|
||||
// 设置 Toast 布局样式
|
||||
ToastUtils.setView(R.layout.view_toast);
|
||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
|
||||
//CrashHandler.getInstance().registerGlobal(this);
|
||||
//CrashHandler.getInstance().registerPart(this);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@ -18,6 +19,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
mLogView = findViewById(R.id.logview);
|
||||
|
||||
ToastUtils.show("onCreate");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1 +0,0 @@
|
||||
|
@ -1,54 +0,0 @@
|
||||
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'])
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#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
17
app/proguard-rules.pro
vendored
@ -1,17 +0,0 @@
|
||||
# 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 *;
|
||||
#}
|
@ -1,13 +0,0 @@
|
||||
<?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>
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">WinBoll-APP+</string>
|
||||
|
||||
</resources>
|
@ -1,48 +0,0 @@
|
||||
<?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>
|
@ -1,24 +0,0 @@
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
@ -1,168 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?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>
|
@ -1,29 +0,0 @@
|
||||
<?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>
|
||||
|
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_gradient"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_launcher"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:textColor="#FF000000"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
</menu>
|
@ -1,10 +0,0 @@
|
||||
<?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>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">WinBoll-APP</string>
|
||||
|
||||
</resources>
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
</resources>
|
@ -1,25 +0,0 @@
|
||||
<?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>
|
@ -1,12 +0,0 @@
|
||||
<?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>
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?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
|
||||
#Sat Mar 29 11:28:02 HKT 2025
|
||||
stageCount=3
|
||||
#Sat Apr 12 15:06:52 HKT 2025
|
||||
stageCount=6
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.2
|
||||
publishVersion=15.2.2
|
||||
publishVersion=15.2.5
|
||||
buildCount=0
|
||||
baseBetaVersion=15.2.3
|
||||
baseBetaVersion=15.2.6
|
||||
|
@ -19,17 +19,17 @@ def genVersionName(def versionName){
|
||||
|
||||
android {
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "33.0.3"
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.apputils"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "9.2"
|
||||
versionName "15.2"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@ -41,15 +41,9 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(':libapputils')
|
||||
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
|
||||
#Sat Jan 18 13:03:10 HKT 2025
|
||||
#Sat Mar 29 12:14:55 HKT 2025
|
||||
stageCount=2
|
||||
libraryProject=libapputils
|
||||
baseVersion=9.2
|
||||
publishVersion=9.2.1
|
||||
baseVersion=15.2
|
||||
publishVersion=15.2.1
|
||||
buildCount=0
|
||||
baseBetaVersion=9.2.2
|
||||
baseBetaVersion=15.2.2
|
||||
|
@ -8,7 +8,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_winboll"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||
android:theme="@style/MyUtilsTheme"
|
||||
android:supportsRtl="true">
|
||||
|
||||
<activity
|
||||
@ -27,9 +27,13 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".TestWinBollActivity"/>
|
||||
<activity android:name=".TestStringToQRCodeViewActivity"/>
|
||||
|
||||
<activity android:name=".TestStringToQrCodeViewActivity"/>
|
||||
<activity android:name=".TestBBMorseCodeActivity"/>
|
||||
|
||||
<activity android:name=".AssetsHtmlActivity"/>
|
||||
|
||||
<activity android:name=".QRCodeDecodeActivity"/>
|
||||
|
||||
</application>
|
||||
|
||||
|
@ -5,27 +5,16 @@ package cc.winboll.studio.apputils;
|
||||
* @Date 2024/12/08 15:10:51
|
||||
* @Describe 全局应用类
|
||||
*/
|
||||
import android.view.Gravity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.hjq.toast.style.WhiteToastStyle;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
|
||||
public class App extends WinBollApplication {
|
||||
public class App extends GlobalApplication {
|
||||
|
||||
public static final String TAG = "App";
|
||||
|
||||
public static final String _ACTION_DEBUGVIEW = WinBollApplication.class.getName() + "_ACTION_DEBUGVIEW";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 初始化 Toast 框架
|
||||
//
|
||||
ToastUtils.init(this);
|
||||
// 设置 Toast 布局样式
|
||||
//ToastUtils.setView(R.layout.view_toast);
|
||||
ToastUtils.setStyle(new WhiteToastStyle());
|
||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,59 +1,53 @@
|
||||
package cc.winboll.studio.libapputils.activities;
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/03 11:02:49
|
||||
* @Describe 一个可以浏览随 APP 附带的 Html 文档的窗口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.view.SimpleWebView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.apputils.R;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.views.SimpleWebView;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import android.os.PersistableBundle;
|
||||
|
||||
public class AssetsHtmlActivity extends WinBollActivity {
|
||||
public class AssetsHtmlActivity extends WinBollActivityBase implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "AssetsHtmlActivity";
|
||||
|
||||
public static final String EXTRA_HTMLFILENAME = "EXTRA_HTMLFILENAME";
|
||||
|
||||
String mszHelpIndexFilePath = "";
|
||||
Uri mszHelpIndexFileUri;
|
||||
Context mContext;
|
||||
|
||||
// Assets 文件夹里的 Html 文件的名称
|
||||
String mszHtmlFileName;
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return super.getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final String TAG = "AssetsHtmlActivity";
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
public static final String EXTRA_HTMLFILENAME = "EXTRA_HTMLFILENAME";
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityassetshtmlToolbar1);
|
||||
}
|
||||
String mszHelpIndexFilePath = "";
|
||||
Uri mszHelpIndexFileUri;
|
||||
Context mContext;
|
||||
|
||||
// Assets 文件夹里的 Html 文件的名称
|
||||
String mszHtmlFileName;
|
||||
//
|
||||
// @Override
|
||||
// public Activity getActivity() {
|
||||
// return this;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
@ -73,6 +67,10 @@ public class AssetsHtmlActivity extends WinBollActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_assetshtml);
|
||||
|
||||
// 初始化工具栏
|
||||
Toolbar mToolbar = findViewById(R.id.toolbar);
|
||||
setActionBar(mToolbar);
|
||||
|
||||
mszHtmlFileName = "index.html";
|
||||
|
||||
Intent intent = getIntent();
|
||||
@ -81,7 +79,7 @@ public class AssetsHtmlActivity extends WinBollActivity {
|
||||
if (szTemp != null && !szTemp.trim().equals("")) {
|
||||
mszHtmlFileName = szTemp.trim();
|
||||
}
|
||||
ToastUtils.show(mszHtmlFileName);
|
||||
//ToastUtils.show(mszHtmlFileName);
|
||||
}
|
||||
|
||||
// 与其他应用分享 html 帮助
|
||||
@ -107,13 +105,6 @@ public class AssetsHtmlActivity extends WinBollActivity {
|
||||
// myWebView.loadUrl(mszHelpIndexFileUri.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
|
||||
super.onPostCreate(savedInstanceState, persistentState);
|
||||
setSubTitle(mszHtmlFileName);
|
||||
//setSubTitle(TAG);
|
||||
}
|
||||
|
||||
//
|
||||
void initWebViewFromAssets(String szHtmlFileName) {
|
||||
try {
|
@ -1,38 +1,60 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||
import cc.winboll.studio.libapputils.activities.QRCodeDecodeActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.apputils.R;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
final public class MainActivity extends WinBollActivity {
|
||||
final public class MainActivity extends Activity {
|
||||
|
||||
public static final String TAG = "MainActivity";
|
||||
|
||||
public static final int REQUEST_QRCODEDECODE_ACTIVITY = 0;
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
Toolbar mToolbar;
|
||||
LogView mLogView;
|
||||
//
|
||||
// @Override
|
||||
// public Activity getActivity() {
|
||||
// return this;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
//Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||
//setActionBar(toolbar);
|
||||
mLogView = findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
|
||||
// 初始化工具栏
|
||||
mToolbar = findViewById(R.id.toolbar);
|
||||
setActionBar(mToolbar);
|
||||
// if (isEnableDisplayHomeAsUp()) {
|
||||
// // 显示后退按钮
|
||||
// getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
// }
|
||||
// getActionBar().setSubtitle(getTag());
|
||||
|
||||
checkResolveActivity();
|
||||
archiveInstance();
|
||||
|
||||
|
||||
|
||||
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
||||
//if (prosessIntents(getIntent())) return;
|
||||
@ -44,44 +66,94 @@ final public class MainActivity extends WinBollActivity {
|
||||
// LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG));
|
||||
}
|
||||
|
||||
boolean checkResolveActivity() {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
//Intent intent = new Intent("your_action_here");
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
if (resolveInfoList.size() > 0) {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里有定义
|
||||
if (intent.getAction() != null) {
|
||||
// if (intent.getAction().equals(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW)) {
|
||||
// App.setIsDebug(true);
|
||||
// //ToastUtils.show!("WinBollApplication.setIsDebug(true) by action : " + intent.getAction());
|
||||
//
|
||||
// }
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里没有定义
|
||||
//ToastUtils.show("false : " + intent.getAction());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// action在清单文件中没有声明
|
||||
ToastUtils.show("false");
|
||||
return false;
|
||||
}
|
||||
|
||||
void archiveInstance() {
|
||||
Intent intent = getIntent();
|
||||
StringBuilder sb = new StringBuilder("\n### Archive Instance ###\n");
|
||||
|
||||
if (intent != null) {
|
||||
ComponentName componentName = intent.getComponent();
|
||||
if (componentName != null) {
|
||||
String packageName = componentName.getPackageName();
|
||||
//Log.d("AppStarter", "启动本应用的应用包名: " + packageName);
|
||||
sb.append("启动本应用的应用包名: \n" + packageName);
|
||||
}
|
||||
|
||||
sb.append("\nImplicit Intent Tracker :\n接收到的 Intent 动作: \n" + intent.getAction());
|
||||
Set<String> categories = intent.getCategories();
|
||||
if (categories != null) {
|
||||
for (String category : categories) {
|
||||
sb.append("\n接收到的 Intent 类别 :\n" + category);
|
||||
}
|
||||
}
|
||||
Uri data = intent.getData();
|
||||
if (data != null) {
|
||||
sb.append("\n接收到的 Intent 数据 :\n" + data.toString());
|
||||
}
|
||||
} else {
|
||||
sb.append("Intent is null.");
|
||||
}
|
||||
sb.append("\n\n");
|
||||
LogUtils.d(TAG, sb.toString());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
// 缓存当前 activity
|
||||
//WinBollActivityManager.getInstance(this).add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
//WinBollActivityManager.getInstance(this).registeRemove(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
public void onTestLogClick(View view) {
|
||||
LogUtils.d(TAG, "onTestLogClick");
|
||||
Toast.makeText(getApplication(), "onTestLogClick", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public void onLogUtilsClick(View view) {
|
||||
Intent intent = new Intent(this, LogActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
startActivity(intent);
|
||||
}
|
||||
public void onTestLogActivity(View view) {
|
||||
// Intent intent = new Intent(this, LogActivity.class);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// startActivity(intent);
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
// setSubTitle("");
|
||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
}
|
||||
|
||||
@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 数据
|
||||
//
|
||||
@ -125,58 +197,107 @@ final public class MainActivity extends WinBollActivity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitymainToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
//ToastUtils.show("onCreateOptionsMenu");
|
||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||
// if (isAddWinBollToolBar()) {
|
||||
// //ToastUtils.show("mIWinBoll.isAddWinBollToolBar()");
|
||||
// getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
|
||||
// }
|
||||
if (App.isDebuging()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_studio_debug, menu);
|
||||
}
|
||||
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.item_testwinboll) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestWinBollActivity.class);
|
||||
if (item.getItemId() == R.id.item_exit) {
|
||||
//exit();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
||||
Intent intent = new Intent(this, TestStringToQRCodeViewActivity.class);
|
||||
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
||||
} else if (item.getItemId() == R.id.item_testqrcodedecodeactivity) {
|
||||
Intent intent = new Intent(this, QRCodeDecodeActivity.class);
|
||||
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
||||
} else if (item.getItemId() == R.id.item_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);
|
||||
}
|
||||
|
||||
public void onTestJavascriptHtmlActivity(View view) {
|
||||
// void exit() {
|
||||
// YesNoAlertDialog.OnDialogResultListener listener = new YesNoAlertDialog.OnDialogResultListener(){
|
||||
//
|
||||
// @Override
|
||||
// public void onYes() {
|
||||
// //WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNo() {
|
||||
// }
|
||||
// };
|
||||
// YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
// if (WinBollActivityManager.getInstance(getApplicationContext()).isFirstIWinBollActivity(this)) {
|
||||
// exit();
|
||||
// } else {
|
||||
// WinBollActivityManager.getInstance(this).finish(this);
|
||||
// super.onBackPressed();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public void onTestAssetsHtmlActivity(View view) {
|
||||
Intent intent = new Intent(this, AssetsHtmlActivity.class);
|
||||
intent.putExtra(AssetsHtmlActivity.EXTRA_HTMLFILENAME, "javascript_test.html");
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AssetsHtmlActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
startActivity(intent);
|
||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AssetsHtmlActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
||||
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
||||
ToastUtils.show(text);
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
}
|
||||
|
||||
/*@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,72 +1,59 @@
|
||||
package cc.winboll.studio.libapputils.activities;
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/18 10:32:21
|
||||
* @Describe 二维码扫码解码窗口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.apputils.R;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.journeyapps.barcodescanner.BarcodeCallback;
|
||||
import com.journeyapps.barcodescanner.BarcodeResult;
|
||||
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||
import java.util.List;
|
||||
|
||||
public class QRCodeDecodeActivity extends WinBollActivity {
|
||||
public class QRCodeDecodeActivity extends Activity {
|
||||
|
||||
public static final String TAG = "QRCodeDecodeActivity";
|
||||
public static final String EXTRA_RESULT = "EXTRA_RESULT";
|
||||
|
||||
public static final String EXTRA_RESULT = "EXTRA_RESULT";
|
||||
private static final int REQUEST_CAMERA_PERMISSION = 1;
|
||||
|
||||
TextView resultTextView;
|
||||
DecoratedBarcodeView barcodeView;
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityqrcodedecodeToolbar1);
|
||||
}
|
||||
// @Override
|
||||
// public Activity getActivity() {
|
||||
// return this;
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_qrcodedecode);
|
||||
resultTextView = findViewById(R.id.activityqrcodedecodeTextView1);
|
||||
|
||||
// 初始化工具栏
|
||||
// Toolbar mToolbar = findViewById(R.id.toolbar);
|
||||
// setActionBar(mToolbar);
|
||||
|
||||
//resultTextView = findViewById(R.id.activityqrcodedecodeTextView1);
|
||||
barcodeView = findViewById(R.id.activityqrcodedecodeDecoratedBarcodeView1);
|
||||
// 请求相机权限
|
||||
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[]{android.Manifest.permission.CAMERA},
|
||||
REQUEST_CAMERA_PERMISSION);
|
||||
} else {
|
||||
startScanning();
|
||||
}
|
||||
|
||||
|
||||
// if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)
|
||||
// != PackageManager.PERMISSION_GRANTED) {
|
||||
// ActivityCompat.requestPermissions(this,
|
||||
// new String[]{android.Manifest.permission.CAMERA},
|
||||
// REQUEST_CAMERA_PERMISSION);
|
||||
// } else {
|
||||
// startScanning();
|
||||
// }
|
||||
startScanning();
|
||||
}
|
||||
|
||||
private void startScanning() {
|
@ -0,0 +1,20 @@
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/13 15:09:46
|
||||
*/
|
||||
public class TestWinBollActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "TestWinBollActivity";
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitytestwinbollToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_testwinboll);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
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);
|
||||
}
|
||||
}
|
21
apputils/src/main/res/layout/activity_assetshtml.xml
Normal file
21
apputils/src/main/res/layout/activity_assetshtml.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?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_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activitymainToolbar1"/>
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@ -27,32 +27,39 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TestLog"
|
||||
android:textAllCaps="false"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onTestLogClick"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="LogUtils"
|
||||
android:text="TestLogActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onLogUtilsClick"/>
|
||||
android:onClick="onTestLogActivity"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAllCaps="false"
|
||||
android:text="Test Javascript Html Activity"
|
||||
android:onClick="onTestJavascriptHtmlActivity"/>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAllCaps="false"
|
||||
android:text="TestAssetsHtmlActivity"
|
||||
android:onClick="onTestAssetsHtmlActivity"/>
|
||||
|
||||
</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>
|
||||
|
||||
|
20
apputils/src/main/res/layout/activity_qrcodedecode.xml
Normal file
20
apputils/src/main/res/layout/activity_qrcodedecode.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?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>
|
||||
|
@ -5,11 +5,5 @@
|
||||
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="Text"
|
||||
android:id="@+id/page_text"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -6,10 +6,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activityteststringtoqrcodeviewToolbar1"/>
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
@ -17,7 +17,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<cc.winboll.studio.libapputils.view.StringToQrCodeView
|
||||
<cc.winboll.studio.libapputils.views.StringToQrCodeView
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:id="@+id/activityteststringtoqrcodeviewStringToQrCodeView1"/>
|
||||
|
@ -7,7 +7,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FF36B5B3">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activitytestwinbollToolbar1"/>
|
||||
|
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_gradient"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_launcher"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:textColor="#FF000000"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,16 +1,13 @@
|
||||
<?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_testwinboll"
|
||||
android:title="TestWinBollActivity"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<item
|
||||
android:id="@+id/item_teststringtoqrcodeview"
|
||||
android:title="TestStringToQrCodeViewActivity"
|
||||
app:showAsAction="ifRoom"/>
|
||||
android:title="TestStringToQRCodeViewActivity"/>
|
||||
<item
|
||||
android:id="@+id/item_testqrcodedecodeactivity"
|
||||
android:title="TestQRCodeDecodeActivity"
|
||||
app:showAsAction="ifRoom"/>
|
||||
android:title="TestQRCodeDecodeActivity"/>
|
||||
<item
|
||||
android:id="@+id/item_testcrashreport"
|
||||
android:title="TestCrashReportActivity"/>
|
||||
</menu>
|
||||
|
@ -4,7 +4,4 @@
|
||||
<color name="colorPrimary">#FF196ABC</color>
|
||||
<color name="colorPrimaryDark">#FF002B57</color>
|
||||
<color name="colorAccent">#FF80BFFF</color>
|
||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||
<color name="colorToastShadow">#FF000000</color>
|
||||
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||
</resources>
|
||||
|
@ -1,3 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="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>
|
||||
|
@ -1,6 +1,11 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
repositories {
|
||||
// 本地 Maven 仓库(默认路径为 ~/.m2/repository)
|
||||
mavenLocal()
|
||||
// 或自定义本地仓库路径
|
||||
maven { url "file:///sdcard/.m2/repository" }
|
||||
|
||||
// Nexus Maven 库地址
|
||||
// "WinBoll Release"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||
@ -15,7 +20,7 @@ buildscript {
|
||||
maven { url "https://jitpack.io" }
|
||||
mavenCentral()
|
||||
google()
|
||||
mavenLocal()
|
||||
//mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Apr 12 13:11:52 GMT 2025
|
||||
stageCount=7
|
||||
#Sat Apr 12 18:57:32 GMT 2025
|
||||
stageCount=8
|
||||
libraryProject=
|
||||
baseVersion=15.2
|
||||
publishVersion=15.2.6
|
||||
buildCount=5
|
||||
baseBetaVersion=15.2.7
|
||||
publishVersion=15.2.7
|
||||
buildCount=2
|
||||
baseBetaVersion=15.2.8
|
||||
|
@ -3,11 +3,12 @@ package cc.winboll.studio.contacts.activities;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import cc.winboll.studio.contacts.R;
|
||||
import cc.winboll.studio.contacts.dun.Rules;
|
||||
import cc.winboll.studio.contacts.utils.IntUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import android.widget.EditText;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
@ -37,6 +38,9 @@ public class UnitTestActivity extends Activity {
|
||||
}
|
||||
|
||||
public void onTestMain(View view) {
|
||||
LogUtils.d(TAG, "IntUtils.unittest_getIntInRange();");
|
||||
IntUtils.unittest_getIntInRange();
|
||||
|
||||
Rules rules = Rules.getInstance(this);
|
||||
|
||||
// 如果没有规则就添加测试规则
|
||||
@ -86,6 +90,5 @@ public class UnitTestActivity extends Activity {
|
||||
|
||||
phone = "95566";
|
||||
LogUtils.d(TAG, String.format("Test phone : %s\n%s", phone, rules.isAllowed(phone)));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,13 +9,16 @@ import android.util.JsonReader;
|
||||
import android.util.JsonWriter;
|
||||
import cc.winboll.studio.libappbase.BaseBean;
|
||||
import java.io.IOException;
|
||||
import cc.winboll.studio.contacts.utils.IntUtils;
|
||||
|
||||
public class SettingsModel extends BaseBean {
|
||||
|
||||
public static final String TAG = "SettingsModel";
|
||||
|
||||
public static final String DEFAULT_BOBULLTOON_URL = "http://10.8.0.12:3000/Studio/BoBullToon/archive/main.zip"; // 替换为实际的 ZIP 文件 URL
|
||||
|
||||
public static final int MAX_INTRANGE = 666666;
|
||||
public static final int MIN_INTRANGE = 1;
|
||||
|
||||
// 云盾防御层数量
|
||||
int dunTotalCount;
|
||||
// 当前云盾防御层
|
||||
@ -39,10 +42,10 @@ public class SettingsModel extends BaseBean {
|
||||
}
|
||||
|
||||
public SettingsModel(int dunTotalCount, int dunCurrentCount, int dunResumeSecondCount, int dunResumeCount, boolean isEnableDun, String szBoBullToon_URL) {
|
||||
this.dunTotalCount = dunTotalCount;
|
||||
this.dunCurrentCount = dunCurrentCount;
|
||||
this.dunResumeSecondCount = dunResumeSecondCount;
|
||||
this.dunResumeCount = dunResumeCount;
|
||||
this.dunTotalCount = getSettingsModelRangeInt(dunTotalCount);
|
||||
this.dunCurrentCount = getSettingsModelRangeInt(dunCurrentCount);
|
||||
this.dunResumeSecondCount = getSettingsModelRangeInt(dunResumeSecondCount);
|
||||
this.dunResumeCount = getSettingsModelRangeInt(dunResumeCount);
|
||||
this.isEnableDun = isEnableDun;
|
||||
this.szBoBullToon_URL = szBoBullToon_URL;
|
||||
}
|
||||
@ -56,7 +59,7 @@ public class SettingsModel extends BaseBean {
|
||||
}
|
||||
|
||||
public void setDunTotalCount(int dunTotalCount) {
|
||||
this.dunTotalCount = dunTotalCount;
|
||||
this.dunTotalCount = getSettingsModelRangeInt(dunTotalCount);
|
||||
}
|
||||
|
||||
public int getDunTotalCount() {
|
||||
@ -64,7 +67,7 @@ public class SettingsModel extends BaseBean {
|
||||
}
|
||||
|
||||
public void setDunCurrentCount(int dunCurrentCount) {
|
||||
this.dunCurrentCount = dunCurrentCount;
|
||||
this.dunCurrentCount = getSettingsModelRangeInt(dunCurrentCount);
|
||||
}
|
||||
|
||||
public int getDunCurrentCount() {
|
||||
@ -72,7 +75,7 @@ public class SettingsModel extends BaseBean {
|
||||
}
|
||||
|
||||
public void setDunResumeSecondCount(int dunResumeSecondCount) {
|
||||
this.dunResumeSecondCount = dunResumeSecondCount;
|
||||
this.dunResumeSecondCount = getSettingsModelRangeInt(dunResumeSecondCount);
|
||||
}
|
||||
|
||||
public int getDunResumeSecondCount() {
|
||||
@ -80,7 +83,7 @@ public class SettingsModel extends BaseBean {
|
||||
}
|
||||
|
||||
public void setDunResumeCount(int dunResumeCount) {
|
||||
this.dunResumeCount = dunResumeCount;
|
||||
this.dunResumeCount = getSettingsModelRangeInt(dunResumeCount);
|
||||
}
|
||||
|
||||
public int getDunResumeCount() {
|
||||
@ -94,7 +97,10 @@ public class SettingsModel extends BaseBean {
|
||||
public boolean isEnableDun() {
|
||||
return isEnableDun;
|
||||
}
|
||||
|
||||
|
||||
int getSettingsModelRangeInt(int origin) {
|
||||
return IntUtils.getIntInRange(origin, MIN_INTRANGE, MAX_INTRANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@ -118,13 +124,13 @@ public class SettingsModel extends BaseBean {
|
||||
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
||||
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
||||
if (name.equals("dunTotalCount")) {
|
||||
setDunTotalCount(jsonReader.nextInt());
|
||||
setDunTotalCount(getSettingsModelRangeInt(jsonReader.nextInt()));
|
||||
} else if (name.equals("dunCurrentCount")) {
|
||||
setDunCurrentCount(jsonReader.nextInt());
|
||||
setDunCurrentCount(getSettingsModelRangeInt(jsonReader.nextInt()));
|
||||
} else if (name.equals("dunResumeSecondCount")) {
|
||||
setDunResumeSecondCount(jsonReader.nextInt());
|
||||
setDunResumeSecondCount(getSettingsModelRangeInt(jsonReader.nextInt()));
|
||||
} else if (name.equals("dunResumeCount")) {
|
||||
setDunResumeCount(jsonReader.nextInt());
|
||||
setDunResumeCount(getSettingsModelRangeInt(jsonReader.nextInt()));
|
||||
} else if (name.equals("isEnableDun")) {
|
||||
setIsEnableDun(jsonReader.nextBoolean());
|
||||
} else if (name.equals("szBoBullToon_URL")) {
|
||||
|
@ -11,6 +11,7 @@ import cc.winboll.studio.contacts.beans.PhoneConnectRuleModel;
|
||||
import cc.winboll.studio.contacts.beans.SettingsModel;
|
||||
import cc.winboll.studio.contacts.services.MainService;
|
||||
import cc.winboll.studio.contacts.utils.ContactUtils;
|
||||
import cc.winboll.studio.contacts.utils.IntUtils;
|
||||
import cc.winboll.studio.contacts.utils.RegexPPiUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.util.ArrayList;
|
||||
@ -55,6 +56,7 @@ public class Rules {
|
||||
|
||||
// 盾牌恢复定时器
|
||||
mDunResumeTimer = new Timer();
|
||||
int ss = IntUtils.getIntInRange(mSettingsModel.getDunResumeSecondCount() * 1000, SettingsModel.MIN_INTRANGE, SettingsModel.MAX_INTRANGE);
|
||||
mDunResumeTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -69,7 +71,7 @@ public class Rules {
|
||||
SettingsActivity.notifyDunInfoUpdate();
|
||||
}
|
||||
}
|
||||
}, 1000, mSettingsModel.getDunResumeSecondCount() * 1000);
|
||||
}, 1000, ss);
|
||||
}
|
||||
|
||||
public void loadRules() {
|
||||
|
@ -0,0 +1,24 @@
|
||||
package cc.winboll.studio.contacts.utils;
|
||||
import android.widget.EditText;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/04/13 00:59:13
|
||||
* @Describe Int类型数字输入框工具集
|
||||
*/
|
||||
public class EditTextIntUtils {
|
||||
|
||||
public static final String TAG = "EditTextIntUtils";
|
||||
|
||||
public static int getIntFromEditText(EditText editText) {
|
||||
try {
|
||||
String sz = editText.getText().toString().trim();
|
||||
return Integer.parseInt(sz);
|
||||
} catch (NumberFormatException e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cc.winboll.studio.contacts.utils;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/04/13 01:16:28
|
||||
* @Describe Int数字操作工具集
|
||||
*/
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
||||
public class IntUtils {
|
||||
|
||||
public static final String TAG = "IntUtils";
|
||||
|
||||
public static int getIntInRange(int origin, int range_a, int range_b) {
|
||||
int min = Math.min(range_a, range_b);
|
||||
int max = Math.max(range_a, range_b);
|
||||
int res = Math.min(origin, max);
|
||||
res = Math.max(res, min);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void unittest_getIntInRange() {
|
||||
LogUtils.d(TAG, String.format("getIntInRange(-100, 5, 10); %d", getIntInRange(-100, 5, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(8, 5, 10); %d", getIntInRange(8, 5, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(200, 5, 10); %d", getIntInRange(200, 5, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(-100, -5, 10); %d", getIntInRange(-100, -5, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(9, -5, 10); %d", getIntInRange(9, -5, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(100, -5, 10); %d", getIntInRange(100, -5, 10)));
|
||||
|
||||
LogUtils.d(TAG, String.format("getIntInRange(500, 5, -10); %d", getIntInRange(500, 5, -10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(4, 5, -10); %d", getIntInRange(4, 5, -10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(-20, 5, -10); %d", getIntInRange(-20, 5, -10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(500, 50, 10); %d", getIntInRange(500, 50, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(30, 50, 10); %d", getIntInRange(30, 50, 10)));
|
||||
LogUtils.d(TAG, String.format("getIntInRange(6, 50, 10); %d", getIntInRange(6, 50, 10)));
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
|
@ -1,67 +0,0 @@
|
||||
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'])
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#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
17
demo/proguard-rules.pro
vendored
@ -1,17 +0,0 @@
|
||||
# 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 *;
|
||||
#}
|
@ -1,15 +0,0 @@
|
||||
<?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>
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">WinBoll-Demo+</string>
|
||||
|
||||
</resources>
|
@ -1,39 +0,0 @@
|
||||
<?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>
|
@ -1,19 +0,0 @@
|
||||
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();
|
||||
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,170 +0,0 @@
|
||||
<?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>
|
@ -1,10 +0,0 @@
|
||||
<?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>
|
@ -1,10 +0,0 @@
|
||||
<?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>
|
@ -1,29 +0,0 @@
|
||||
<?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>
|
||||
|
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_gradient"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_launcher"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:textColor="#FF000000"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/item_help"
|
||||
android:title="HELP"/>
|
||||
|
||||
</menu>
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/item_about"
|
||||
android:title="About"/>
|
||||
</menu>
|
@ -1,10 +0,0 @@
|
||||
<?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>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">WinBoll-Demo</string>
|
||||
|
||||
</resources>
|
@ -1,3 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
</resources>
|
@ -1,12 +0,0 @@
|
||||
<?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>
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Put flavor specific strings here -->
|
||||
|
||||
</resources>
|
@ -4,14 +4,12 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
android {
|
||||
namespace 'cc.winboll.studio.libaes'
|
||||
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "33.0.3"
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
targetSdkVersion 29
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@ -19,30 +17,40 @@ android {
|
||||
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.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'
|
||||
|
||||
// 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'])
|
||||
|
||||
// 吐司类库
|
||||
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 '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 'cc.winboll.studio:libappbase:15.2.2'
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sun Jan 19 04:58:59 GMT 2025
|
||||
stageCount=3
|
||||
#Thu Apr 03 11:13:53 HKT 2025
|
||||
stageCount=7
|
||||
libraryProject=libaes
|
||||
baseVersion=7.6
|
||||
publishVersion=7.6.2
|
||||
buildCount=4
|
||||
baseBetaVersion=7.6.3
|
||||
baseVersion=15.2
|
||||
publishVersion=15.2.6
|
||||
buildCount=0
|
||||
baseBetaVersion=15.2.7
|
||||
|
@ -5,16 +5,27 @@
|
||||
|
||||
<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.activitys.AboutActivity"/>
|
||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"
|
||||
android:exported="true"/>
|
||||
|
||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"/>
|
||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"
|
||||
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>
|
||||
|
||||
</manifest>
|
||||
|
@ -27,18 +27,20 @@ import cc.winboll.studio.libaes.beans.AESThemeBean;
|
||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import com.baoyz.widget.PullRefreshLayout;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class DrawerFragmentActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
|
||||
public abstract class DrawerFragmentActivity extends AppCompatActivity implements IWinBollActivity,AdapterView.OnItemClickListener {
|
||||
|
||||
public static final String TAG = "DrawerFragmentActivity";
|
||||
|
||||
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
|
||||
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
|
||||
|
||||
protected Context mContext;
|
||||
//protected Context mContext;
|
||||
ActivityType mActivityType;
|
||||
ActionBarDrawerToggle mActionBarDrawerToggle;
|
||||
DrawerLayout mDrawerLayout;
|
||||
@ -58,7 +60,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
mContext = this;
|
||||
//mContext = this;
|
||||
mThemeType = getThemeType();
|
||||
setThemeStyle();
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -72,7 +74,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public Intent getIntent() {
|
||||
// TODO: Implement this method
|
||||
return super.getIntent();
|
||||
@ -80,7 +82,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
public Context getContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public MenuInflater getMenuInflater() {
|
||||
@ -88,20 +90,20 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
return super.getMenuInflater();
|
||||
}
|
||||
|
||||
public void setSubtitle(CharSequence context) {
|
||||
/*public void setSubtitle(CharSequence context) {
|
||||
// TODO: Implement this method
|
||||
getSupportActionBar().setSubtitle(context);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void recreate() {
|
||||
super.recreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public boolean moveTaskToBack(boolean nonRoot) {
|
||||
return super.moveTaskToBack(nonRoot);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent) {
|
||||
@ -113,7 +115,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public FragmentManager getSupportFragmentManager() {
|
||||
return super.getSupportFragmentManager();
|
||||
}
|
||||
@ -131,7 +133,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
public void setTitle(int resId) {
|
||||
// TODO: Implement this method
|
||||
getSupportActionBar().setTitle(resId);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||
@ -151,7 +153,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
void setThemeStyle() {
|
||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
||||
setTheme(AESThemeUtil.getThemeTypeID(this));
|
||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
||||
}
|
||||
|
||||
boolean checkThemeStyleChange() {
|
||||
@ -163,7 +165,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
||||
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
||||
*/
|
||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(this));
|
||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -174,6 +176,8 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
|
||||
getString(i);
|
||||
}
|
||||
} else if (R.id.item_log == item.getItemId()) {
|
||||
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||
} else if (R.id.item_about == item.getItemId()) {
|
||||
LogUtils.d(TAG, "onAbout");
|
||||
} 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.JsonWriter;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libapputils.bean.BaseBean;
|
||||
import cc.winboll.studio.libappbase.BaseBean;
|
||||
import java.io.IOException;
|
||||
|
||||
public class AESThemeBean extends BaseBean {
|
||||
@ -16,7 +16,7 @@ public class AESThemeBean extends BaseBean {
|
||||
public static final String TAG = "AESThemeBean";
|
||||
|
||||
public enum ThemeType {
|
||||
DEFAULT("默认主题"),
|
||||
AES("默认主题"),
|
||||
DEPTH("深奥主题"),
|
||||
SKY("天空主题"),
|
||||
GOLDEN("辉煌主题"),
|
||||
@ -42,7 +42,7 @@ public class AESThemeBean extends BaseBean {
|
||||
}
|
||||
|
||||
// 保存当前主题
|
||||
int currentThemeStyleID = getThemeStyleID(ThemeType.DEFAULT);
|
||||
int currentThemeStyleID = getThemeStyleID(ThemeType.AES);
|
||||
|
||||
public AESThemeBean() {
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class AESThemeBean extends BaseBean {
|
||||
}
|
||||
|
||||
public static int getThemeStyleID(ThemeType themeType) {
|
||||
int themeStyleID = R.style.DefaultAESTheme;
|
||||
int themeStyleID = R.style.AESTheme;
|
||||
if (AESThemeBean.ThemeType.DEPTH == themeType) {
|
||||
themeStyleID = R.style.DepthAESTheme;
|
||||
} else if (AESThemeBean.ThemeType.SKY == themeType) {
|
||||
@ -110,15 +110,15 @@ public class AESThemeBean extends BaseBean {
|
||||
themeStyleID = R.style.MemorAESTheme;
|
||||
} else if (AESThemeBean.ThemeType.TAO == themeType) {
|
||||
themeStyleID = R.style.TaoAESTheme;
|
||||
} else if (AESThemeBean.ThemeType.DEFAULT == themeType) {
|
||||
themeStyleID = R.style.DefaultAESTheme;
|
||||
} else if (AESThemeBean.ThemeType.AES == themeType) {
|
||||
themeStyleID = R.style.AESTheme;
|
||||
}
|
||||
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
|
||||
return themeStyleID;
|
||||
}
|
||||
|
||||
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
|
||||
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.AES;
|
||||
if (R.style.DepthAESTheme == nThemeStyleID) {
|
||||
themeStyle = AESThemeBean.ThemeType.DEPTH ;
|
||||
} else if (R.style.SkyAESTheme == nThemeStyleID) {
|
||||
@ -129,8 +129,8 @@ public class AESThemeBean extends BaseBean {
|
||||
themeStyle = AESThemeBean.ThemeType.MEMOR ;
|
||||
} else if (R.style.TaoAESTheme == nThemeStyleID) {
|
||||
themeStyle = AESThemeBean.ThemeType.TAO ;
|
||||
} else if (R.style.DefaultAESTheme == nThemeStyleID) {
|
||||
themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||
} else if (R.style.AESTheme == nThemeStyleID) {
|
||||
themeStyle = AESThemeBean.ThemeType.AES;
|
||||
}
|
||||
//LogUtils.d(TAG, "themeStyle " + Integer.toString(themeStyle.ordinal()));
|
||||
return themeStyle;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user