Compare commits
74 Commits
apputils-v
...
aes-v15.0.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
851ea8a50a | ||
![]() |
a2b216cb2c | ||
![]() |
8d7f1298f6 | ||
![]() |
803d1afc18 | ||
![]() |
a859fcb237 | ||
![]() |
e9cf4404d2 | ||
![]() |
5e42f21c9a | ||
![]() |
c394a37e0a | ||
![]() |
c203557a6a | ||
![]() |
00b619ee99 | ||
![]() |
3a6fb3e17c | ||
![]() |
83a061856a | ||
![]() |
ede6c07deb | ||
![]() |
652caf7a46 | ||
![]() |
a0627d5b3b | ||
![]() |
5411d5e590 | ||
![]() |
facf0b001d | ||
![]() |
df58c0355c | ||
![]() |
e657e45218 | ||
![]() |
c22946f0a5 | ||
![]() |
1363a7dcce | ||
![]() |
e0ca5725f1 | ||
![]() |
3c4988532f | ||
![]() |
b0a34579fa | ||
![]() |
dd08747edb | ||
![]() |
b497faa0b9 | ||
![]() |
603640b3cb | ||
![]() |
5b06ce9699 | ||
![]() |
363fc6c7c1 | ||
![]() |
7f43f8b5c5 | ||
![]() |
a117e6e110 | ||
![]() |
c1f576e343 | ||
![]() |
f43c40e317 | ||
![]() |
1dad84b65e | ||
![]() |
1ae377e665 | ||
![]() |
02fa0a4134 | ||
![]() |
a730aa3f92 | ||
![]() |
b3056e9d80 | ||
![]() |
cd23d625e1 | ||
![]() |
e7749cb95d | ||
![]() |
13f9f6d744 | ||
![]() |
df51422e42 | ||
![]() |
6e6540698b | ||
![]() |
5a756a0f00 | ||
![]() |
b13a3d4866 | ||
![]() |
57973b7210 | ||
![]() |
f30470e46f | ||
![]() |
7c6dc87cf4 | ||
![]() |
4756226a56 | ||
![]() |
334da43001 | ||
![]() |
d83abd7c83 | ||
![]() |
cd24504131 | ||
![]() |
e8921350fd | ||
![]() |
3765154f60 | ||
![]() |
8be7a931eb | ||
![]() |
c55183b10c | ||
![]() |
1204f295e1 | ||
![]() |
fbd6ed9cf4 | ||
![]() |
32d3960e03 | ||
![]() |
39b16318f9 | ||
![]() |
9afb1751a6 | ||
![]() |
48165364d1 | ||
![]() |
e98f62149d | ||
![]() |
c01a739b9d | ||
![]() |
7f8ee8d6de | ||
![]() |
c90d8549b4 | ||
![]() |
f3d97fc94b | ||
![]() |
8f8c3c6c97 | ||
![]() |
61200c37be | ||
![]() |
ebee402c84 | ||
![]() |
0a7a26d3cd | ||
![]() |
6410eda84e | ||
![]() |
c91c9c9887 | ||
![]() |
6450faa556 |
@@ -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
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "7.6"
|
||||
versionName "15.0"
|
||||
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
|
||||
#Mon Mar 24 14:31:46 HKT 2025
|
||||
stageCount=2
|
||||
libraryProject=libaes
|
||||
baseVersion=7.6
|
||||
publishVersion=7.6.2
|
||||
buildCount=4
|
||||
baseBetaVersion=7.6.3
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.1
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.2
|
||||
|
@@ -8,7 +8,7 @@
|
||||
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">
|
||||
|
||||
|
@@ -5,12 +5,219 @@ package cc.winboll.studio.aes;
|
||||
* @Date 2024/06/13 19:05:52
|
||||
* @Describe 应用主窗口
|
||||
*/
|
||||
import cc.winboll.studio.libaes.unittests.LibraryActivity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Toolbar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
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.libaes.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
||||
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 APPInfo getAppInfo() {
|
||||
String szBranchName = "aes";
|
||||
|
||||
APPInfo appInfo = AboutActivityFactory.buildDefaultAPPInfo();
|
||||
appInfo.setAppName("AES");
|
||||
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription("AES Description");
|
||||
appInfo.setAppGitName("APP");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(szBranchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES");
|
||||
appInfo.setAppAPKName("AES");
|
||||
appInfo.setAppAPKFolderName("AES");
|
||||
return appInfo;
|
||||
//return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (mTestAButtonFragment == null) {
|
||||
mTestAButtonFragment = new TestAButtonFragment();
|
||||
addFragment(mTestAButtonFragment);
|
||||
}
|
||||
showFragment(mTestAButtonFragment);
|
||||
//setSubtitle(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||
super.initDrawerMenuItemList(listDrawerMenu);
|
||||
LogUtils.d(TAG, "initDrawerMenuItemList");
|
||||
//listDrawerMenu.clear();
|
||||
// 添加抽屉菜单项
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||
notifyDrawerMenuDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||
super.reinitDrawerMenuItemList(listDrawerMenu);
|
||||
LogUtils.d(TAG, "reinitDrawerMenuItemList");
|
||||
//listDrawerMenu.clear();
|
||||
// 添加抽屉菜单项
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||
notifyDrawerMenuDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DrawerFragmentActivity.ActivityType initActivityType() {
|
||||
return DrawerFragmentActivity.ActivityType.Main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_library, menu);
|
||||
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) {
|
||||
AboutActivityFactory.showAboutActivity(this, getAppInfo());
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
@@ -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>
|
||||
|
@@ -18,15 +18,8 @@ def genVersionName(def versionName){
|
||||
}
|
||||
|
||||
android {
|
||||
productFlavors {
|
||||
beta {
|
||||
}
|
||||
stage {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.androidxdemo"
|
||||
@@ -36,7 +29,7 @@ android {
|
||||
// versionName 更新后需要手动设置
|
||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "1.0"
|
||||
versionName "15.0"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@@ -54,23 +47,26 @@ dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
// SSH
|
||||
implementation 'com.jcraft:jsch:0.1.55'
|
||||
api 'com.jcraft:jsch:0.1.55'
|
||||
// Html 解析
|
||||
implementation 'org.jsoup:jsoup:1.13.1'
|
||||
api 'org.jsoup:jsoup:1.13.1'
|
||||
// 二维码类库
|
||||
implementation 'com.google.zxing:core:3.4.1'
|
||||
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
api 'com.google.zxing:core:3.4.1'
|
||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
// 应用介绍页类库
|
||||
implementation 'io.github.medyo:android-about-page:2.0.0'
|
||||
api 'io.github.medyo:android-about-page:2.0.0'
|
||||
// 吐司类库
|
||||
implementation 'com.github.getActivity:ToastUtils:10.5'
|
||||
api 'com.github.getActivity:ToastUtils:10.5'
|
||||
// 网络连接类库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
// Android 类库
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.viewpager:viewpager:1.0.0'
|
||||
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||
implementation 'androidx.fragment:fragment:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
// AndroidX 类库
|
||||
api 'androidx.appcompat:appcompat:1.0.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:libappbase:15.0.9'
|
||||
api 'cc.winboll.studio:libapputils:15.0.11'
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Mar 11 18:25:43 GMT 2025
|
||||
#Mon Mar 24 06:19:57 GMT 2025
|
||||
stageCount=0
|
||||
libraryProject=
|
||||
baseVersion=1.0
|
||||
publishVersion=1.0.0
|
||||
buildCount=4
|
||||
baseBetaVersion=1.0.1
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=8
|
||||
baseBetaVersion=15.0.1
|
||||
|
@@ -8,9 +8,9 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:theme="@style/MyAppTheme"
|
||||
android:resizeableActivity="true"
|
||||
android:name=".GlobalApplication">
|
||||
android:name=".App">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
@@ -34,4 +34,4 @@
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cc.winboll.studio.androidxdemo;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
@@ -22,6 +21,7 @@ import android.widget.HorizontalScrollView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
@@ -39,15 +39,15 @@ import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class GlobalApplication extends Application {
|
||||
public class App extends GlobalApplication {
|
||||
|
||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
CrashHandler.getInstance().registerGlobal(this);
|
||||
CrashHandler.getInstance().registerPart(this);
|
||||
//CrashHandler.getInstance().registerGlobal(this);
|
||||
//CrashHandler.getInstance().registerPart(this);
|
||||
}
|
||||
|
||||
public static void write(InputStream input, OutputStream output) throws IOException {
|
||||
@@ -252,7 +252,7 @@ public class GlobalApplication extends Application {
|
||||
|
||||
private static String getKernel() {
|
||||
try {
|
||||
return GlobalApplication.toString(new FileInputStream("/proc/version")).trim();
|
||||
return App.toString(new FileInputStream("/proc/version")).trim();
|
||||
} catch (Throwable e) {
|
||||
return e.getMessage();
|
||||
}
|
||||
@@ -331,4 +331,4 @@ public class GlobalApplication extends Application {
|
||||
restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,17 +3,26 @@ package cc.winboll.studio.androidxdemo;
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
|
||||
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
|
||||
mLogView = findViewById(R.id.logview);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
}
|
||||
}
|
||||
|
@@ -34,5 +34,18 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
|
@@ -18,8 +18,8 @@ def genVersionName(def versionName){
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.appbase"
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Mar 15 15:30:02 HKT 2025
|
||||
stageCount=3
|
||||
#Mon Mar 24 14:06:25 HKT 2025
|
||||
stageCount=10
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.2
|
||||
publishVersion=15.0.9
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.3
|
||||
baseBetaVersion=15.0.10
|
||||
|
@@ -7,7 +7,7 @@
|
||||
android:name=".App"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MyAppTheme"
|
||||
android:theme="@style/MyAPPBaseTheme"
|
||||
android:resizeableActivity="true">
|
||||
|
||||
<activity
|
||||
@@ -49,6 +49,12 @@
|
||||
android:name=".services.MainService"
|
||||
android:exported="true"/>
|
||||
|
||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||
android:exported="true"/>
|
||||
|
||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
||||
android:exported="true"/>
|
||||
|
||||
<service android:name=".services.AssistantService"/>
|
||||
|
||||
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver">
|
||||
@@ -81,13 +87,13 @@
|
||||
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".widgets.APPNewsWidgetClickListener">
|
||||
<receiver android:name=".receivers.APPNewsWidgetClickListener">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidgetClickListener.ACTION_PRE"/>
|
||||
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_PRE"/>
|
||||
|
||||
<action android:name="cc.winboll.studio.appbase.widgets.APPNewsWidgetClickListener.ACTION_NEXT"/>
|
||||
<action android:name="cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener.ACTION_NEXT"/>
|
||||
|
||||
</intent-filter>
|
||||
|
||||
@@ -97,12 +103,6 @@
|
||||
android:name="android.max_aspect"
|
||||
android:value="4.0"/>
|
||||
|
||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||
android:exported="true"/>
|
||||
|
||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
||||
android:exported="true"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
@@ -89,7 +89,7 @@ public class MainActivity extends Activity {
|
||||
startService(intentService);
|
||||
}
|
||||
|
||||
public void onTestSOS(View view) {
|
||||
public void onTestDemoServiceSOS(View view) {
|
||||
Intent intent = new Intent(this, TestDemoService.class);
|
||||
stopService(intent);
|
||||
if (App.isDebuging()) {
|
||||
|
@@ -7,7 +7,7 @@ package cc.winboll.studio.appbase;
|
||||
import android.content.Context;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
||||
import cc.winboll.studio.appbase.models.MainServiceBean;
|
||||
import cc.winboll.studio.appbase.services.MainService;
|
||||
|
||||
public class MyTileService extends TileService {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package cc.winboll.studio.appbase.beans;
|
||||
package cc.winboll.studio.appbase.models;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
@@ -1,4 +1,4 @@
|
||||
package cc.winboll.studio.appbase.beans;
|
||||
package cc.winboll.studio.appbase.models;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
@@ -1,4 +1,4 @@
|
||||
package cc.winboll.studio.appbase.beans;
|
||||
package cc.winboll.studio.appbase.models;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
@@ -1,4 +1,4 @@
|
||||
package cc.winboll.studio.appbase.beans;
|
||||
package cc.winboll.studio.appbase.models;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
@@ -1,13 +1,13 @@
|
||||
package cc.winboll.studio.appbase.widgets;
|
||||
package cc.winboll.studio.appbase.receivers;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/02/15 17:20:46
|
||||
* @Describe WidgetButtonClickListener
|
||||
* @Date 2025/03/24 07:11:44
|
||||
*/
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
||||
public class APPNewsWidgetClickListener extends BroadcastReceiver {
|
@@ -10,7 +10,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import cc.winboll.studio.appbase.beans.WinBollNewsBean;
|
||||
import cc.winboll.studio.appbase.models.WinBollNewsBean;
|
||||
import cc.winboll.studio.appbase.services.MainService;
|
||||
import cc.winboll.studio.appbase.widgets.APPNewsWidget;
|
||||
import cc.winboll.studio.libappbase.AppUtils;
|
||||
|
@@ -11,7 +11,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
||||
import cc.winboll.studio.appbase.models.MainServiceBean;
|
||||
import cc.winboll.studio.appbase.services.AssistantService;
|
||||
import cc.winboll.studio.appbase.services.MainService;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
@@ -18,7 +18,7 @@ import android.content.ServiceConnection;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import cc.winboll.studio.appbase.MyTileService;
|
||||
import cc.winboll.studio.appbase.beans.MainServiceBean;
|
||||
import cc.winboll.studio.appbase.models.MainServiceBean;
|
||||
import cc.winboll.studio.appbase.handlers.MainServiceHandler;
|
||||
import cc.winboll.studio.appbase.receivers.MainReceiver;
|
||||
import cc.winboll.studio.appbase.services.AssistantService;
|
||||
|
@@ -10,7 +10,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import cc.winboll.studio.appbase.beans.TestDemoBindServiceBean;
|
||||
import cc.winboll.studio.appbase.models.TestDemoBindServiceBean;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||
import cc.winboll.studio.appbase.App;
|
||||
|
@@ -10,7 +10,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import cc.winboll.studio.appbase.beans.TestDemoServiceBean;
|
||||
import cc.winboll.studio.appbase.models.TestDemoServiceBean;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||
|
||||
|
@@ -12,15 +12,16 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.widget.RemoteViews;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.appbase.beans.WinBollNewsBean;
|
||||
import cc.winboll.studio.appbase.models.WinBollNewsBean;
|
||||
import cc.winboll.studio.appbase.receivers.APPNewsWidgetClickListener;
|
||||
import cc.winboll.studio.libappbase.AppUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.sos.APPModel;
|
||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import cc.winboll.studio.libappbase.sos.APPModel;
|
||||
import cc.winboll.studio.libappbase.sos.WinBoll;
|
||||
|
||||
public class APPNewsWidget extends AppWidgetProvider {
|
||||
|
||||
|
@@ -72,6 +72,26 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StartCenter"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStartCenter"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StopCenter"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStopCenter"/>
|
||||
</LinearLayout>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -105,54 +125,41 @@
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="SartTestDemoBindService"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onSartTestDemoBindService"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StopTestDemoBindService"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStopTestDemoBindService"/>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="SartTestDemoBindService"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onSartTestDemoBindService"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StopTestDemoBindServiceNoSettings"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStopTestDemoBindServiceNoSettings"/>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StopTestDemoBindService"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStopTestDemoBindService"/>
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StopTestDemoBindServiceNoSettings"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStopTestDemoBindServiceNoSettings"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StartCenter"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStartCenter"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="StopCenter"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onStopCenter"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
@@ -171,24 +178,24 @@
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TestSOS"
|
||||
android:text="TestDemoServiceSOS"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onTestSOS"/>
|
||||
android:onClick="onTestDemoServiceSOS"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_height="500dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/activitymainLogView1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_height="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/activitymainLogView1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#005800FF</color>
|
||||
<color name="colorPrimaryDark">#005800FF</color>
|
||||
<color name="colorAccent">#005800FF</color>
|
||||
<color name="colorPrimary">#FF00B322</color>
|
||||
<color name="colorPrimaryDark">#FF005C12</color>
|
||||
<color name="colorAccent">#FF8DFFA2</color>
|
||||
<color name="colorText">#FFFFFB8D</color>
|
||||
</resources>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="MyAppTheme" parent="APPBaseTheme">
|
||||
<style name="MyAPPBaseTheme" parent="APPBaseTheme">
|
||||
<item name="attrColorPrimary">@color/colorPrimary</item>
|
||||
<item name="themeGlobalCrashActivity">@style/MyGlobalCrashActivityTheme</item>
|
||||
</style>
|
||||
|
@@ -18,18 +18,18 @@ def genVersionName(def versionName){
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "33.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.apputils"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "15.0"
|
||||
versionName "9.2"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@@ -41,26 +41,15 @@ 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'])
|
||||
implementation 'cc.winboll.studio:libappbase:15.0.5'
|
||||
|
||||
// 二维码类库
|
||||
implementation 'com.google.zxing:core:3.4.1'
|
||||
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
|
||||
// 网络连接类库
|
||||
//implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
|
||||
// Html 解析
|
||||
//implementation 'org.jsoup:jsoup:1.13.1'
|
||||
|
||||
// SSH
|
||||
//implementation 'com.jcraft:jsch:0.1.55'
|
||||
|
||||
// 应用介绍页类库
|
||||
//implementation 'io.github.medyo:android-about-page:2.0.0'
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Mar 18 10:56:08 HKT 2025
|
||||
stageCount=6
|
||||
#Sat Jan 18 13:03:10 HKT 2025
|
||||
stageCount=2
|
||||
libraryProject=libapputils
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.5
|
||||
baseVersion=9.2
|
||||
publishVersion=9.2.1
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.6
|
||||
baseBetaVersion=9.2.2
|
||||
|
@@ -8,7 +8,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_winboll"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MyUtilsTheme"
|
||||
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||
android:supportsRtl="true">
|
||||
|
||||
<activity
|
||||
@@ -27,8 +27,10 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name=".TestWinBollActivity"/>
|
||||
|
||||
<activity android:name=".TestStringToQrCodeViewActivity"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
@@ -5,83 +5,27 @@ package cc.winboll.studio.apputils;
|
||||
* @Date 2024/12/08 15:10:51
|
||||
* @Describe 全局应用类
|
||||
*/
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.app.MyActivityLifecycleCallbacks;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.bean.DebugBean;
|
||||
import android.view.Gravity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollApplication;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.hjq.toast.style.WhiteToastStyle;
|
||||
|
||||
public class App extends GlobalApplication {
|
||||
public class App extends WinBollApplication {
|
||||
|
||||
public static final String TAG = "App";
|
||||
|
||||
public static final String _ACTION_DEBUGVIEW = App.class.getName() + "_ACTION_DEBUGVIEW";
|
||||
|
||||
//static volatile WinBollApplication _WinBollApplication = null;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
|
||||
// 标记当前应用是否处于调试状态
|
||||
static volatile boolean isDebug = false;
|
||||
|
||||
public synchronized static void setIsDebug(boolean isDebug) {
|
||||
App.isDebug = isDebug;
|
||||
}
|
||||
|
||||
public static boolean isDebug() {
|
||||
return isDebug;
|
||||
}
|
||||
|
||||
MyActivityLifecycleCallbacks getMyActivityLifecycleCallbacks() {
|
||||
return mMyActivityLifecycleCallbacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context getApplicationContext() {
|
||||
return super.getApplicationContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Application getApplication() {
|
||||
return this;
|
||||
}
|
||||
public static final String _ACTION_DEBUGVIEW = WinBollApplication.class.getName() + "_ACTION_DEBUGVIEW";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// 应用环境初始化, 基本调试环境
|
||||
// 初始化 Toast 框架
|
||||
//
|
||||
// 初始化日志模块
|
||||
//LogUtils.init(this);
|
||||
|
||||
try {
|
||||
// 初始化 Toast 框架
|
||||
// ToastUtils.init(this);
|
||||
// // 设置 Toast 布局样式
|
||||
// //ToastUtils.setView(R.layout.view_toast);
|
||||
// ToastUtils.setStyle(new WhiteToastStyle());
|
||||
// ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
// 设置应用调试标志
|
||||
DebugBean debugBean = DebugBean.loadBean(this, DebugBean.class);
|
||||
if (debugBean == null) {
|
||||
//ToastUtils.show("debugBean == null");
|
||||
setIsDebug(false);
|
||||
} else {
|
||||
//ToastUtils.show("saveDebugStatus(" + String.valueOf(debugBean.isDebuging()) + ")");
|
||||
setIsDebug(debugBean.isDebuging());
|
||||
}
|
||||
// 应用窗口管理模块参数设置
|
||||
//
|
||||
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks();
|
||||
registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
// 设置默认 WinBoll 应用 UI 类型
|
||||
WinBollActivityManager.getInstance(this).setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||
//ToastUtils.show("WinBollUI_TYPE " + getWinBollUI_TYPE());
|
||||
} catch (Exception e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
ToastUtils.init(this);
|
||||
// 设置 Toast 布局样式
|
||||
//ToastUtils.setView(R.layout.view_toast);
|
||||
ToastUtils.setStyle(new WhiteToastStyle());
|
||||
ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,83 +1,28 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import cc.winboll.studio.apputils.R;
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.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 android.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||
import cc.winboll.studio.libapputils.activities.LogActivity;
|
||||
import cc.winboll.studio.libapputils.activities.QRCodeDecodeActivity;
|
||||
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.view.AboutView;
|
||||
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
final public class MainActivity extends Activity implements IWinBollActivity {
|
||||
final public class MainActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "MainActivity";
|
||||
|
||||
public static final int REQUEST_QRCODEDECODE_ACTIVITY = 0;
|
||||
|
||||
Toolbar mToolbar;
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
String szBranchName = "apputils";
|
||||
|
||||
APPInfo appInfo = AboutActivityFactory.buildDefaultAPPInfo();
|
||||
appInfo.setAppName("APPUtils");
|
||||
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription("APPUtils Description");
|
||||
appInfo.setAppGitName("APP");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(szBranchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");
|
||||
appInfo.setAppAPKName("APPUtils");
|
||||
appInfo.setAppAPKFolderName("APPUtils");
|
||||
return appInfo;
|
||||
//return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitymainToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -86,22 +31,8 @@ final public class MainActivity extends Activity implements IWinBollActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
mLogView = findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
|
||||
// 初始化工具栏
|
||||
mToolbar = findViewById(R.id.activitymainToolbar1);
|
||||
setActionBar(mToolbar);
|
||||
if (isEnableDisplayHomeAsUp()) {
|
||||
// 显示后退按钮
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
getActionBar().setSubtitle(getTag());
|
||||
|
||||
checkResolveActivity();
|
||||
archiveInstance();
|
||||
|
||||
|
||||
//Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||
//setActionBar(toolbar);
|
||||
|
||||
// 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回
|
||||
//if (prosessIntents(getIntent())) return;
|
||||
@@ -113,94 +44,44 @@ final public class MainActivity extends Activity implements IWinBollActivity {
|
||||
// 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);
|
||||
|
||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
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("");
|
||||
}
|
||||
|
||||
@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 数据
|
||||
//
|
||||
@@ -245,87 +126,39 @@ final public class MainActivity extends Activity implements IWinBollActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
//ToastUtils.show("onCreateOptionsMenu");
|
||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||
if (isAddWinBollToolBar()) {
|
||||
//ToastUtils.show("mIWinBoll.isAddWinBollToolBar()");
|
||||
getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
|
||||
}
|
||||
if (App.isDebug()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_studio_debug, menu);
|
||||
}
|
||||
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_exit) {
|
||||
exit();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_about) {
|
||||
AboutActivityFactory.showAboutActivity(this, getAppInfo());
|
||||
return true;
|
||||
if (item.getItemId() == R.id.item_testwinboll) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestWinBollActivity.class);
|
||||
} else if (item.getItemId() == R.id.item_teststringtoqrcodeview) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, TestStringToQrCodeViewActivity.class);
|
||||
} else if (item.getItemId() == R.id.item_testqrcodedecodeactivity) {
|
||||
Intent intent = new Intent(this, QRCodeDecodeActivity.class);
|
||||
startActivityForResult(intent, REQUEST_QRCODEDECODE_ACTIVITY);
|
||||
} else if (item.getItemId() == R.id.item_testcrashreport) {
|
||||
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
|
||||
getString(i);
|
||||
}
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_log) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.item_exitdebug) {
|
||||
//AboutView.setApp2NormalMode(this);
|
||||
return true;
|
||||
} else if (item.getItemId() == android.R.id.home) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
void about() {
|
||||
// Intent intent = new Intent(this, AboutActivity.class);
|
||||
// intent.putExtra(AboutActivity.EXTRA_APPINFO, AboutActivityFactory.buildAPPBranchInfo(this));
|
||||
// WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, AboutActivity.class);
|
||||
}
|
||||
|
||||
void exit() {
|
||||
YesNoAlertDialog.OnDialogResultListener listener = new YesNoAlertDialog.OnDialogResultListener(){
|
||||
|
||||
@Override
|
||||
public void onYes() {
|
||||
WinBollActivityManager.getInstance(getApplicationContext()).finishAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNo() {
|
||||
}
|
||||
};
|
||||
YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (WinBollActivityManager.getInstance(getApplicationContext()).isFirstIWinBollActivity(this)) {
|
||||
exit();
|
||||
} else {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
public void onTestAboutActivity(View view) {
|
||||
about();
|
||||
}
|
||||
|
||||
public void onTestJavascriptHtmlActivity(View view) {
|
||||
Intent intent = new Intent(this, AssetsHtmlActivity.class);
|
||||
intent.putExtra(AssetsHtmlActivity.EXTRA_HTMLFILENAME, "javascript_test.html");
|
||||
@@ -333,25 +166,17 @@ final public class MainActivity extends Activity implements IWinBollActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
||||
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
||||
ToastUtils.show(text);
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*@Override
|
||||
protected void onActivithyResult(int requestCode, int resultCode, Intent data) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_QRCODEDECODE_ACTIVITY : {
|
||||
if (data != null) {
|
||||
String text = data.getStringExtra(QRCodeDecodeActivity.EXTRA_RESULT);
|
||||
ToastUtils.show(text);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
//ToastUtils.show(String.format("%d, %d", requestCode, resultCode));
|
||||
super.prosessActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@@ -1,50 +1,37 @@
|
||||
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
|
||||
*/
|
||||
import cc.winboll.studio.apputils.R;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.view.StringToQrCodeView;
|
||||
|
||||
public class TestStringToQrCodeViewActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
public class TestStringToQrCodeViewActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "TestStringToQrCodeViewActivity";
|
||||
|
||||
|
||||
StringToQrCodeView mStringToQrCodeView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityteststringtoqrcodeviewToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,4 +41,10 @@ public class TestStringToQrCodeViewActivity extends Activity implements IWinBoll
|
||||
setContentView(R.layout.activity_teststringtoqrcodeview);
|
||||
mStringToQrCodeView = findViewById(R.id.activityteststringtoqrcodeviewStringToQrCodeView1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,52 @@
|
||||
package cc.winboll.studio.apputils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.activities.AssetsHtmlActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/13 15:09:46
|
||||
*/
|
||||
public class TestWinBollActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "TestWinBollActivity";
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activitytestwinbollToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_testwinboll);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activitymainToolbar1"/>
|
||||
@@ -27,7 +27,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TestLog"
|
||||
android:textAllCaps="false"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onTestLogClick"/>
|
||||
|
||||
<Button
|
||||
@@ -39,27 +39,20 @@
|
||||
|
||||
</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="Test Javascript Html Activity"
|
||||
android:onClick="onTestJavascriptHtmlActivity"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:text="Button"
|
||||
android:id="@+id/logview"
|
||||
android:layout_weight="1.0"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activityteststringtoqrcodeviewToolbar1"/>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FF36B5B3">
|
||||
|
||||
<android.widget.Toolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activitytestwinbollToolbar1"/>
|
||||
|
32
apputils/src/main/res/layout/view_toast.xml
Normal file
32
apputils/src/main/res/layout/view_toast.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_gradient"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_launcher"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:textColor="#FF000000"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@@ -3,14 +3,14 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/item_testwinboll"
|
||||
android:title="TestWinBollActivity"/>
|
||||
android:title="TestWinBollActivity"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<item
|
||||
android:id="@+id/item_teststringtoqrcodeview"
|
||||
android:title="TestStringToQrCodeViewActivity"/>
|
||||
android:title="TestStringToQrCodeViewActivity"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<item
|
||||
android:id="@+id/item_testqrcodedecodeactivity"
|
||||
android:title="TestQRCodeDecodeActivity"/>
|
||||
<item
|
||||
android:id="@+id/item_testcrashreport"
|
||||
android:title="TestCrashReportActivity"/>
|
||||
android:title="TestQRCodeDecodeActivity"
|
||||
app:showAsAction="ifRoom"/>
|
||||
</menu>
|
||||
|
@@ -4,4 +4,7 @@
|
||||
<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,7 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="MyUtilsTheme" parent="UtilsTheme">
|
||||
<item name="attrColorPrimary">@color/colorPrimary</item>
|
||||
<item name="themeGlobalCrashActivity">@style/GlobalCrashActivityTheme</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
26
build.gradle
26
build.gradle
@@ -1,6 +1,12 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
repositories {
|
||||
// Nexus Maven 库地址
|
||||
// "WinBoll Release"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||
// "WinBoll Snapshot"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||
|
||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
||||
@@ -9,13 +15,6 @@ buildscript {
|
||||
maven { url "https://jitpack.io" }
|
||||
mavenCentral()
|
||||
google()
|
||||
|
||||
// Nexus Maven 库地址
|
||||
// "WinBoll Release"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||
// "WinBoll Snapshot"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
@@ -27,6 +26,12 @@ buildscript {
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
// Nexus Maven 库地址
|
||||
// "WinBoll Release"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||
// "WinBoll Snapshot"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||
|
||||
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/google/' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
|
||||
@@ -35,13 +40,6 @@ allprojects {
|
||||
maven { url "https://jitpack.io" }
|
||||
mavenCentral()
|
||||
google()
|
||||
|
||||
// Nexus Maven 库地址
|
||||
// "WinBoll Release"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-public/" }
|
||||
// "WinBoll Snapshot"
|
||||
maven { url "https://nexus.winboll.cc/repository/maven-snapshots/" }
|
||||
|
||||
mavenLocal()
|
||||
}
|
||||
ext {
|
||||
|
@@ -17,3 +17,5 @@ org.gradle.jvmargs=-Xmx2048m
|
||||
android.useAndroidX=false
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=false
|
||||
# 保持与旧版Gradle插件的兼容
|
||||
android.disableAutomaticComponentCreation=true
|
||||
|
@@ -17,3 +17,5 @@ org.gradle.jvmargs=-Xmx2048m
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
# 保持与旧版Gradle插件的兼容
|
||||
android.disableAutomaticComponentCreation=true
|
||||
|
@@ -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
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@@ -19,30 +17,39 @@ 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'])
|
||||
|
||||
// 权限请求框架: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.github.getActivity:ToastUtils:10.5'
|
||||
// 网络连接类库
|
||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
// AndroidX 类库
|
||||
api 'androidx.appcompat:appcompat:1.0.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:libappbase:15.0.9'
|
||||
api 'cc.winboll.studio:libapputils:15.0.11'
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sun Jan 19 04:58:59 GMT 2025
|
||||
stageCount=3
|
||||
#Mon Mar 24 14:31:46 HKT 2025
|
||||
stageCount=2
|
||||
libraryProject=libaes
|
||||
baseVersion=7.6
|
||||
publishVersion=7.6.2
|
||||
buildCount=4
|
||||
baseBetaVersion=7.6.3
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.1
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.2
|
||||
|
@@ -16,7 +16,6 @@ import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
@@ -27,18 +26,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.LogUtils;
|
||||
import com.baoyz.widget.PullRefreshLayout;
|
||||
import java.util.ArrayList;
|
||||
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
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 +59,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 +73,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public Intent getIntent() {
|
||||
// TODO: Implement this method
|
||||
return super.getIntent();
|
||||
@@ -80,7 +81,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
public Context getContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public MenuInflater getMenuInflater() {
|
||||
@@ -88,20 +89,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 +114,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public FragmentManager getSupportFragmentManager() {
|
||||
return super.getSupportFragmentManager();
|
||||
}
|
||||
@@ -131,7 +132,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 +152,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 +164,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
|
||||
|
@@ -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;
|
||||
|
@@ -5,7 +5,7 @@ import android.content.DialogInterface;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.Collator;
|
||||
|
@@ -1,170 +0,0 @@
|
||||
package cc.winboll.studio.libaes.unittests;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/06/14 03:43:23
|
||||
* @Describe AES类库主窗口
|
||||
*/
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
|
||||
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class LibraryActivity extends DrawerFragmentActivity {
|
||||
|
||||
public static final String TAG = "LibraryActivity";
|
||||
|
||||
TestAButtonFragment mTestAButtonFragment;
|
||||
TestViewPageFragment mTestViewPageFragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (mTestAButtonFragment == null) {
|
||||
mTestAButtonFragment = new TestAButtonFragment();
|
||||
addFragment(mTestAButtonFragment);
|
||||
}
|
||||
showFragment(mTestAButtonFragment);
|
||||
setSubtitle(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||
super.initDrawerMenuItemList(listDrawerMenu);
|
||||
LogUtils.d(TAG, "initDrawerMenuItemList");
|
||||
//listDrawerMenu.clear();
|
||||
// 添加抽屉菜单项
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||
notifyDrawerMenuDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||
super.reinitDrawerMenuItemList(listDrawerMenu);
|
||||
LogUtils.d(TAG, "reinitDrawerMenuItemList");
|
||||
//listDrawerMenu.clear();
|
||||
// 添加抽屉菜单项
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||
notifyDrawerMenuDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DrawerFragmentActivity.ActivityType initActivityType() {
|
||||
return DrawerFragmentActivity.ActivityType.Main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_library, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
super.onItemClick(parent, view, position, id);
|
||||
switch (position) {
|
||||
case 0 : {
|
||||
if (mTestAButtonFragment == null) {
|
||||
mTestAButtonFragment = new TestAButtonFragment();
|
||||
addFragment(mTestAButtonFragment);
|
||||
}
|
||||
showFragment(mTestAButtonFragment);
|
||||
break;
|
||||
}
|
||||
case 1 : {
|
||||
if (mTestViewPageFragment == null) {
|
||||
mTestViewPageFragment = new TestViewPageFragment();
|
||||
addFragment(mTestViewPageFragment);
|
||||
}
|
||||
showFragment(mTestViewPageFragment);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
// if (item.getItemId() == R.id.item_log) {
|
||||
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
|
||||
// } else
|
||||
if (nItemId == R.id.item_atoast) {
|
||||
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
|
||||
} else if (nItemId == R.id.item_atoolbar) {
|
||||
Intent intent = new Intent(this, TestAToolbarActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
} else if (nItemId == R.id.item_asupporttoolbar) {
|
||||
Intent intent = new Intent(this, TestASupportToolbarActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
} else if (nItemId == R.id.item_colordialog) {
|
||||
ColorPickerDialog dlg = new ColorPickerDialog(this, getResources().getColor(R.color.colorPrimary));
|
||||
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
|
||||
|
||||
@Override
|
||||
public void beforeColorChanged() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColorChanged(int color) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterColorChanged() {
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
dlg.show();
|
||||
|
||||
} else if (nItemId == R.id.item_dialogstoragepath) {
|
||||
final StoragePathDialog dialog = new StoragePathDialog(this, 0);
|
||||
dialog.setOnOKClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
|
||||
} else if (nItemId == R.id.item_localfileselectdialog) {
|
||||
final LocalFileSelectDialog dialog = new LocalFileSelectDialog(this);
|
||||
dialog.setOnOKClickListener(new LocalFileSelectDialog.OKClickListener() {
|
||||
@Override
|
||||
public void onOKClick(String sz) {
|
||||
Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
|
||||
//dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
|
||||
} else if (nItemId == R.id.item_secondarylibraryactivity) {
|
||||
Intent intent = new Intent(this, SecondaryLibraryActivity.class);
|
||||
startActivity(intent);
|
||||
} else if (nItemId == R.id.item_drawerfragmentactivity) {
|
||||
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
// else if (nItemId == R.id.item_about) {
|
||||
// Intent intent = new Intent(this, AboutActivity.class);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
@@ -6,18 +6,47 @@ import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/06/15 00:58:10
|
||||
* @Describe 第二级窗口
|
||||
*/
|
||||
public class SecondaryLibraryActivity extends DrawerFragmentActivity {
|
||||
public class SecondaryLibraryActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "SecondaryLibraryActivity";
|
||||
|
||||
SecondaryLibraryFragment mSecondaryLibraryFragment;
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -43,7 +72,7 @@ public class SecondaryLibraryActivity extends DrawerFragmentActivity {
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
if (nItemId == R.id.item_test) {
|
||||
Toast.makeText(getApplication(), "item_test", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getApplicationContext(), "item_test", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
@@ -9,11 +9,11 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.views.AButton;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
|
||||
public class TestAButtonFragment extends Fragment {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TestAButtonFragment extends Fragment {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
LogUtils.d(TAG, "onClick");
|
||||
Toast.makeText(getActivity(), "AButton", Toast.LENGTH_SHORT).show();
|
||||
ToastUtils.show("AButton");
|
||||
}
|
||||
|
||||
});
|
||||
|
@@ -4,26 +4,57 @@ package cc.winboll.studio.libaes.unittests;
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/06/30 15:00:51
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TestDrawerFragmentActivity extends DrawerFragmentActivity {
|
||||
public class TestDrawerFragmentActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static final String TAG = "TestDrawerFragmentActivity";
|
||||
|
||||
TestFragment1 mTestFragment1;
|
||||
TestFragment2 mTestFragment2;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -66,7 +97,7 @@ public class TestDrawerFragmentActivity extends DrawerFragmentActivity {
|
||||
super.onItemClick(parent, view, position, id);
|
||||
switch (position) {
|
||||
case 0 : {
|
||||
Toast.makeText(getContext(), "0", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getApplicationContext(), "0", Toast.LENGTH_SHORT).show();
|
||||
//LogUtils.d(TAG, "MenuItem 1");
|
||||
showFragment(mTestFragment1);
|
||||
break;
|
||||
|
@@ -5,6 +5,7 @@ package cc.winboll.studio.libaes.unittests;
|
||||
* @Date 2024/07/16 01:35:56
|
||||
* @Describe TestViewPageFragment
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -17,12 +18,17 @@ import androidx.viewpager.widget.ViewPager;
|
||||
import cc.winboll.studio.libaes.ImagePagerAdapter;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TestViewPageFragment extends Fragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
|
||||
|
||||
public static final String TAG = "TestViewPageFragment";
|
||||
|
||||
Context mContext;
|
||||
LogView mLogView;
|
||||
|
||||
private ViewPager viewPager;
|
||||
private List<View> views; //用来存放放进ViewPager里面的布局
|
||||
@@ -36,6 +42,10 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
mView = inflater.inflate(R.layout.fragment_viewpage, container, false);
|
||||
mContext = getActivity();
|
||||
|
||||
mLogView = mView.findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
|
||||
//viewPager = findViewById(R.id.activitymainViewPager1);
|
||||
initData();
|
||||
@@ -60,12 +70,13 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
||||
initPoint();//初始化页面下方的点
|
||||
viewPager.setOnPageChangeListener(this);
|
||||
initAOHPCTCSeekBar();
|
||||
initAOHPCTCSeekBar2();
|
||||
}
|
||||
|
||||
//初始化所要显示的布局
|
||||
void initData() {
|
||||
ViewPager viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
|
||||
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||
View view1 = inflater.inflate(R.layout.viewpage_atickprogressbar, viewPager, false);
|
||||
View view2 = inflater.inflate(R.layout.viewpage_acard, viewPager, false);
|
||||
View view3 = inflater.inflate(R.layout.viewpage_aohpctccard, viewPager, false);
|
||||
@@ -185,14 +196,31 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
||||
}
|
||||
|
||||
void initAOHPCTCSeekBar() {
|
||||
AOHPCTCSeekBar seekbar = mView.findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
||||
seekbar.setThumb(getActivity().getDrawable(R.drawable.ic_launcher));
|
||||
seekbar.setThumbOffset(10);
|
||||
AOHPCTCSeekBar seekbar = views.get(3).findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
||||
seekbar.setThumb(mContext.getDrawable(R.drawable.ic_launcher));
|
||||
//seekbar.setThumbOffset(200);
|
||||
//seekbar.setThumbOffset(1);
|
||||
seekbar.setBlurRightDP(50);
|
||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||
|
||||
@Override
|
||||
public void onOHPCommit() {
|
||||
Toast.makeText(getActivity(), "onOHPCommit ", Toast.LENGTH_SHORT).show();
|
||||
ToastUtils.show("onOHPCommit");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initAOHPCTCSeekBar2() {
|
||||
AOHPCTCSeekBar seekbar = views.get(3).findViewById(R.id.fragmentviewpageAOHPCTCSeekBar2);
|
||||
seekbar.setThumb(mContext.getDrawable(R.drawable.ic_call));
|
||||
//seekbar.setThumbOffset(200);
|
||||
//seekbar.setThumbOffset(1);
|
||||
seekbar.setBlurRightDP(50);
|
||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||
|
||||
@Override
|
||||
public void onOHPCommit() {
|
||||
ToastUtils.show("onOHPCommit 2");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -11,8 +11,8 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
|
||||
public class AESThemeUtil {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class AESThemeUtil {
|
||||
|
||||
public static <T extends Context> int getThemeTypeID(T context) {
|
||||
AESThemeBean bean = AESThemeBean.loadBean(context, AESThemeBean.class);
|
||||
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT): bean.getCurrentThemeTypeID();
|
||||
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES): bean.getCurrentThemeTypeID();
|
||||
}
|
||||
|
||||
public static <T extends Context> void saveThemeStyleID(T context, int nThemeTypeID) {
|
||||
@@ -41,9 +41,9 @@ public class AESThemeUtil {
|
||||
activity.setTheme(getThemeTypeID(activity));
|
||||
}
|
||||
|
||||
public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
|
||||
/*public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
|
||||
activity.setTheme(getThemeTypeID(activity.getApplicationContext()));
|
||||
}
|
||||
}*/
|
||||
|
||||
public static <T extends Activity> void applyAppTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||
@@ -53,9 +53,9 @@ public class AESThemeUtil {
|
||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||
}
|
||||
|
||||
public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||
/*public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||
}
|
||||
}*/
|
||||
|
||||
public static <T extends Activity> void inflateMenu(T activity, Menu menu) {
|
||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||
@@ -65,9 +65,9 @@ public class AESThemeUtil {
|
||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||
}
|
||||
|
||||
public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
|
||||
/*public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
|
||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||
}
|
||||
}*/
|
||||
|
||||
public static <T extends Activity> boolean onAppThemeItemSelected(T activity, MenuItem item) {
|
||||
int nThemeStyleID;
|
||||
@@ -92,7 +92,7 @@ public class AESThemeUtil {
|
||||
saveThemeStyleID(activity, nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
||||
saveThemeStyleID(activity, nThemeStyleID);
|
||||
return true;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class AESThemeUtil {
|
||||
saveThemeStyleID(activity, nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
||||
saveThemeStyleID(activity, nThemeStyleID);
|
||||
return true;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class AESThemeUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static <T extends WinBollActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||
public static <T extends AppCompatActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||
int nThemeStyleID;
|
||||
if (R.id.item_depththeme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
||||
@@ -154,7 +154,38 @@ public class AESThemeUtil {
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static <T extends DrawerFragmentActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||
int nThemeStyleID;
|
||||
if (R.id.item_depththeme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_skytheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_goldentheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_memortheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.MEMOR);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_taotheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
}
|
||||
|
@@ -6,24 +6,30 @@ package cc.winboll.studio.libaes.views;
|
||||
* @Describe AOneHundredPercantClickToCommitSeekBar
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.SeekBar;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
||||
public class AOHPCTCSeekBar extends SeekBar {
|
||||
|
||||
public static final String TAG = "AOHPCTCSeekBar";
|
||||
|
||||
// 可开始拉动的起始位置(百分比值)
|
||||
static final int ENABLE_POST_PERCENT_X = 20;
|
||||
// 最小拉动值,滑块拉动值要超过这个值,确定事件才会提交。
|
||||
static final int TO_MIN_VALUE = 15;
|
||||
volatile int thumbWidth = 1;
|
||||
volatile int progressBarWidth = 1;
|
||||
// 设置按钮模糊右边边缘像素
|
||||
volatile int blurRightDP = 1;
|
||||
// 是否从起点拉动的标志
|
||||
volatile boolean isStartSeek = false;
|
||||
|
||||
// 外部接口对象,确定事件提交会调用该对象的方法
|
||||
OnOHPCListener mOnOHPCListener;
|
||||
// 是否从起点拉动的标志
|
||||
boolean mIsStartTo = false;
|
||||
// 拉动的滑动值
|
||||
int mnTo = 0;
|
||||
|
||||
|
||||
public void setBlurRightDP(int blurRight) {
|
||||
this.blurRightDP = blurRight;
|
||||
}
|
||||
|
||||
public void setOnOHPCListener(OnOHPCListener listener) {
|
||||
mOnOHPCListener = listener;
|
||||
@@ -35,83 +41,68 @@ public class AOHPCTCSeekBar extends SeekBar {
|
||||
|
||||
public AOHPCTCSeekBar(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public AOHPCTCSeekBar(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
//LogUtils.d(TAG, "AOHPCTCSeekBar(...)");
|
||||
|
||||
// 获得TypedArray
|
||||
//TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AToolbar);
|
||||
// 获得attrs.xml里面的属性值,格式为:名称_属性名,后面是默认值
|
||||
//int colorBackgroud = a.getColor(R.styleable.ACard_backgroudColor, context.getColor(R.color.colorACardBackgroung));
|
||||
//int centerColor = a.getColor(R.styleable.AToolbar_centerColor, context.getColor(R.color.colorAToolbarCenterColor));
|
||||
//int endColor = a.getColor(R.styleable.AToolbar_endColor, context.getColor(R.color.colorAToolbarEndColor));
|
||||
//float tSize = a.getDimension(R.styleable.CustomView_tSize, 35);
|
||||
//p.setColor(tColor);
|
||||
//p.setTextSize(tSize);
|
||||
//Drawable drawable = context.getDrawable(R.drawable.frame_atoolbar);
|
||||
|
||||
//setBackground(context.getDrawable(R.drawable.acard_frame_main));
|
||||
|
||||
// 返回一个绑定资源结束的信号给资源
|
||||
//a.recycle();
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public AOHPCTCSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
void initView(Context context) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
//LogUtils.d(TAG, "ACTION_DOWN");
|
||||
// 有效的拖动起始位置(ENABLE_POST_PERCENT_X)%
|
||||
int nEnablePostX = ((getRight() - getLeft()) * ENABLE_POST_PERCENT_X / 100) + getLeft();
|
||||
|
||||
if ((getLeft() < event.getX())
|
||||
&& (event.getX() < nEnablePostX)) {
|
||||
//LogUtils.d(TAG, "event.getX() is " + Float.toString(event.getX()));
|
||||
mIsStartTo = true;
|
||||
return super.dispatchTouchEvent(event);
|
||||
}
|
||||
if (!mIsStartTo) {
|
||||
resetView();
|
||||
return false;
|
||||
if (thumbWidth + blurRightDP > event.getX() && event.getX() > 0) {
|
||||
getParent().requestDisallowInterceptTouchEvent(true);
|
||||
isStartSeek = true;
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
//LogUtils.d(TAG, "ACTION_MOVE");
|
||||
if (mIsStartTo) {
|
||||
mnTo++;
|
||||
if (isStartSeek) {
|
||||
super.dispatchTouchEvent(event);
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
//LogUtils.d(TAG, Integer.toString(getProgress()));
|
||||
// 提交100%确定事件
|
||||
if ((getProgress() == 100) && (mnTo > TO_MIN_VALUE)) {
|
||||
//LogUtils.d(TAG, "Commit mnTo is " + Integer.toString(mnTo));
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP
|
||||
|| event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
getParent().requestDisallowInterceptTouchEvent(false);
|
||||
if (getProgress() == progressBarWidth) {
|
||||
mOnOHPCListener.onOHPCommit();
|
||||
//resetView();
|
||||
//return true;
|
||||
}
|
||||
resetView();
|
||||
return false;
|
||||
// 重置控件状态
|
||||
setProgress(0);
|
||||
isStartSeek = false;
|
||||
}
|
||||
//LogUtils.d(TAG, "dispatchTouchEvent End");
|
||||
return super.dispatchTouchEvent(event);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 重置控件状态
|
||||
//
|
||||
void resetView() {
|
||||
setProgress(0);
|
||||
mnTo = 0;
|
||||
mIsStartTo = false;
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
int width = MeasureSpec.getSize(widthMeasureSpec);
|
||||
//int height = MeasureSpec.getSize(heightMeasureSpec);
|
||||
//LogUtils.d(TAG, String.format("width %d height %d", width, height));
|
||||
|
||||
// 获取SeekBar的图标宽度
|
||||
Drawable thumbDrawable = getThumb();
|
||||
if (thumbDrawable != null) {
|
||||
// 获取图标宽度
|
||||
thumbWidth = thumbDrawable.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
// 获取进度条宽度
|
||||
progressBarWidth = width;
|
||||
|
||||
//LogUtils.d(TAG, String.format("thumbWidth %d progressBarWidth %d", thumbWidth, progressBarWidth));
|
||||
|
||||
// 设置图标位置
|
||||
setThumbOffset(0);
|
||||
// 设置进度条刻度
|
||||
setMax(progressBarWidth);
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
package cc.winboll.studio.libaes.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/08 00:15:36
|
||||
* @Date 2025/03/24 08:23:40
|
||||
* @Describe WinBoll 活动窗口通用接口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
|
||||
@@ -13,8 +13,8 @@ public interface IWinBollActivity {
|
||||
|
||||
public static final String TAG = "IWinBollActivity";
|
||||
|
||||
// 获取当前具有 IWinBoll 特征的 AppCompatActivity 活动窗口
|
||||
abstract public Activity getActivity();
|
||||
// 获取应用资源上下文
|
||||
abstract public Context getApplicationContext();
|
||||
abstract public APPInfo getAppInfo();
|
||||
abstract public String getTag();
|
||||
abstract public Toolbar initToolBar();
|
@@ -0,0 +1,97 @@
|
||||
package cc.winboll.studio.libaes.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/24 08:24:52
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
|
||||
public class MyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
public static final String TAG = "MyActivityLifecycleCallbacks";
|
||||
|
||||
public String mInfo = "";
|
||||
|
||||
public MyActivityLifecycleCallbacks() {
|
||||
}
|
||||
|
||||
void createActivityeInfo(Activity activity) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Intent receivedIntent = activity.getIntent();
|
||||
sb.append("\nCallingActivity : \n");
|
||||
if (activity.getCallingActivity() != null) {
|
||||
sb.append(activity.getCallingActivity().getPackageName());
|
||||
}
|
||||
sb.append("\nReceived Intent Package : \n");
|
||||
sb.append(receivedIntent.getPackage());
|
||||
|
||||
Bundle extras = receivedIntent.getExtras();
|
||||
if (extras != null) {
|
||||
for (String key : extras.keySet()) {
|
||||
sb.append("\nIntentInfo");
|
||||
sb.append("\n键: ");
|
||||
sb.append(key);
|
||||
sb.append(", 值: ");
|
||||
sb.append(extras.get(key));
|
||||
//Log.d("IntentInfo", "键: " + key + ", 值: " + extras.get(key));
|
||||
}
|
||||
}
|
||||
mInfo = sb.toString();
|
||||
//Log.d("IntentInfo", "发送Intent的应用包名: " + senderPackage);
|
||||
}
|
||||
|
||||
public void showActivityeInfo() {
|
||||
ToastUtils.show("ActivityeInfo : " + mInfo);
|
||||
LogUtils.d(TAG, "ActivityeInfo : " + mInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
// 在这里可以做一些初始化相关的操作,例如记录Activity的创建时间等
|
||||
//System.out.println(activity.getLocalClassName() + " was created");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was created");
|
||||
createActivityeInfo(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
//System.out.println(activity.getLocalClassName() + " was started");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was started");
|
||||
//createActivityeInfo(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
//System.out.println(activity.getLocalClassName() + " was resumed");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was resumed");
|
||||
//createActivityeInfo(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
//System.out.println(activity.getLocalClassName() + " was paused");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was paused");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
//System.out.println(activity.getLocalClassName() + " was stopped");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was stopped");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
||||
// 可以在这里添加保存状态的自定义逻辑
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
//System.out.println(activity.getLocalClassName() + " was destroyed");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was destroyed");
|
||||
}
|
||||
}
|
@@ -0,0 +1,318 @@
|
||||
package cc.winboll.studio.libaes.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/24 08:25:43
|
||||
* @Describe 应用活动窗口管理器
|
||||
* 参考 :
|
||||
* android 类似微信小程序多任务窗口 及 设置 TaskDescription 修改 icon 和 label
|
||||
* https://blog.csdn.net/qq_29364417/article/details/109379915?app_version=6.4.2&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22109379915%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
|
||||
*/
|
||||
import android.app.ActivityManager;
|
||||
import android.app.TaskStackBuilder;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class WinBollActivityManager {
|
||||
|
||||
// public static final String TAG = "WinBollActivityManager";
|
||||
// public static final String EXTRA_TAG = "EXTRA_TAG";
|
||||
//
|
||||
// public static enum WinBollUI_TYPE {
|
||||
// Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
|
||||
// Service // 退出应用后,清理所有最近任务栏任务记录窗口
|
||||
// };
|
||||
//
|
||||
// // 应用类型标志
|
||||
// volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||
//
|
||||
// Context mContext;
|
||||
// MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
// static WinBollActivityManager _mWinBollActivityManager;
|
||||
// static Map<String, IWinBollActivity> _mapIWinBollList;
|
||||
// IWinBollActivity firstIWinBollActivity;
|
||||
//
|
||||
// public WinBollActivityManager(Context context) {
|
||||
// mContext = context;
|
||||
// LogUtils.d(TAG, "WinBollActivityManager()");
|
||||
// _mapIWinBollList = new HashMap<String, IWinBollActivity>();
|
||||
// }
|
||||
//
|
||||
// public static synchronized WinBollActivityManager getInstance(Context context) {
|
||||
// LogUtils.d(TAG, "getInstance");
|
||||
// if (_mWinBollActivityManager == null) {
|
||||
// LogUtils.d(TAG, "_mWinBollActivityManager == null");
|
||||
// _mWinBollActivityManager = new WinBollActivityManager(context);
|
||||
// }
|
||||
// return _mWinBollActivityManager;
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 设置 WinBoll 应用 UI 类型
|
||||
// //
|
||||
// public synchronized static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
|
||||
// _mWinBollUI_TYPE = mWinBollUI_TYPE;
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 获取 WinBoll 应用 UI 类型
|
||||
// //
|
||||
// public synchronized static WinBollUI_TYPE getWinBollUI_TYPE() {
|
||||
// return _mWinBollUI_TYPE;
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 把Activity添加到管理中
|
||||
// //
|
||||
// public <T extends IWinBollActivity> void add(T iWinBoll) {
|
||||
// if (isActive(iWinBoll.getTag())) {
|
||||
// LogUtils.d(TAG, String.format("add(...) %s is active.", iWinBoll.getTag()));
|
||||
// } else {
|
||||
// // 设置起始活动窗口,以便最后退出时提问
|
||||
// if (firstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
|
||||
// firstIWinBollActivity = iWinBoll;
|
||||
// }
|
||||
//
|
||||
// // 添加到活动窗口列表
|
||||
// _mapIWinBollList.put(iWinBoll.getTag(), iWinBoll);
|
||||
// LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", iWinBoll.getTag(), _mapIWinBollList.size()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //
|
||||
// // activity: 为 null 时,
|
||||
// // intent.putExtra 函数 EXTRA_TAG 参数为 tag
|
||||
// // activity: 不为 null 时,
|
||||
// // intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
// //
|
||||
// public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||
// try {
|
||||
// // 如果窗口已存在就重启窗口
|
||||
// String tag = clazz.newInstance().getTag();
|
||||
// if (isActive(tag)) {
|
||||
// resumeActivity(context, tag);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // 新建一个任务窗口
|
||||
// Intent intent = new Intent(context, clazz);
|
||||
// //打开多任务窗口 flags
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// intent.putExtra(EXTRA_TAG, tag);
|
||||
// mContext.startActivity(intent);
|
||||
// } catch (InstantiationException | IllegalAccessException e) {
|
||||
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||
// try {
|
||||
// // 如果窗口已存在就重启窗口
|
||||
// String tag = clazz.newInstance().getTag();
|
||||
// if (isActive(tag)) {
|
||||
// resumeActivity(context, tag);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // 新建一个任务窗口
|
||||
// //Intent intent = new Intent(context, clazz);
|
||||
// //打开多任务窗口 flags
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// intent.putExtra(EXTRA_TAG, tag);
|
||||
// mContext.startActivity(intent);
|
||||
// } catch (InstantiationException | IllegalAccessException e) {
|
||||
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
|
||||
// return firstIWinBollActivity != null && firstIWinBollActivity == iWinBollActivity;
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 判断 tag绑定的 MyActivity是否存在
|
||||
// //
|
||||
// public boolean isActive(String tag) {
|
||||
// //printAvtivityListInfo();
|
||||
// IWinBollActivity iWinBoll = getIWinBoll(tag);
|
||||
// if (iWinBoll != null) {
|
||||
// LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
|
||||
// //ToastUtils.show("activity != null tag " + tag);
|
||||
// //判断是否为 BaseActivity,如果已经销毁,则移除
|
||||
// if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
|
||||
// _mapIWinBollList.remove(iWinBoll.getTag());
|
||||
// //_mWinBollActivityList.remove(activity);
|
||||
// LogUtils.d(TAG, String.format("isActive(...) remove activity.\ntag : %s", tag));
|
||||
// return false;
|
||||
// } else {
|
||||
// LogUtils.d(TAG, String.format("isActive(...) activity is exist.\ntag : %s", tag));
|
||||
// return true;
|
||||
// }
|
||||
// } else {
|
||||
// LogUtils.d(TAG, String.format("isActive(...) activity == null\ntag : %s", tag));
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// static IWinBollActivity getIWinBoll(String tag) {
|
||||
// return _mapIWinBollList.get(tag);
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
// //
|
||||
// public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
|
||||
// LogUtils.d(TAG, "resumeActivty");
|
||||
// T iWinBoll = (T)getIWinBoll(tag);
|
||||
// //LogUtils.d(TAG, "activity " + activity.getTag());
|
||||
// if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
// resumeActivity(context, iWinBoll);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
// //
|
||||
// public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
|
||||
// ActivityManager am = (ActivityManager) iWinBoll.getActivity().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
// //返回启动它的根任务(home 或者 MainActivity)
|
||||
// Intent intent = new Intent(context, iWinBoll.getClass());
|
||||
// TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
||||
// stackBuilder.addNextIntentWithParentStack(intent);
|
||||
// stackBuilder.startActivities();
|
||||
// //moveTaskToFront(YourTaskId, 0);
|
||||
// LogUtils.d(TAG, "am.moveTaskToFront");
|
||||
// //ToastUtils.show("resumeActivity am.moveTaskToFront");
|
||||
// am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //
|
||||
// // 结束所有 Activity
|
||||
// //
|
||||
// public void finishAll() {
|
||||
// try {
|
||||
// for (String key : _mapIWinBollList.keySet()) {
|
||||
// //System.out.println("Key: " + key + ", Value: " + _mapActivityList.get(key));
|
||||
// IWinBollActivity iWinBoll = _mapIWinBollList.get(key);
|
||||
// //ToastUtils.show("finishAll() activity");
|
||||
// if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
// //ToastUtils.show("activity != null ...");
|
||||
// if (getWinBollUI_TYPE() == WinBollUI_TYPE.Service) {
|
||||
// // 结束窗口和最近任务栏, 建议前台服务类应用使用,可以方便用户再次调用 UI 操作。
|
||||
// iWinBoll.getActivity().finishAndRemoveTask();
|
||||
// //ToastUtils.show("finishAll() activity.finishAndRemoveTask();");
|
||||
// } else if (getWinBollUI_TYPE() == WinBollUI_TYPE.Aplication) {
|
||||
// // 结束窗口保留最近任务栏,建议前台服务类应用使用,可以保持应用的系统自觉性。
|
||||
// iWinBoll.getActivity().finish();
|
||||
// //ToastUtils.show("finishAll() activity.finish();");
|
||||
// } else {
|
||||
// LogUtils.d(TAG, "WinBollApplication.WinBollUI_TYPE error.");
|
||||
// //ToastUtils.show("WinBollApplication.WinBollUI_TYPE error.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 结束指定Activity
|
||||
// //
|
||||
// public <T extends IWinBollActivity> void finish(T iWinBoll) {
|
||||
// try {
|
||||
// if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
// //根据tag 移除 MyActivity
|
||||
// //String tag= activity.getTag();
|
||||
// //_mWinBollActivityList.remove(tag);
|
||||
// //ToastUtils.show("remove");
|
||||
// //ToastUtils.show("_mWinBollActivityArrayMap.size() " + Integer.toString(_mWinBollActivityArrayMap.size()));
|
||||
//
|
||||
// // 窗口回调规则:
|
||||
// // [] 当前窗口位置 >> 调度出的窗口位置
|
||||
// // ★:[0] 1 2 3 4 >> 1
|
||||
// // ★:0 1 [2] 3 4 >> 1
|
||||
// // ★:0 1 2 [3] 4 >> 2
|
||||
// // ★:0 1 2 3 [4] >> 3
|
||||
// // ★:[0] >> 直接关闭当前窗口
|
||||
// LogUtils.d(TAG, "finish no yet.");
|
||||
// IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
|
||||
// iWinBoll.getActivity().finish();
|
||||
// if (preIWinBoll != null) {
|
||||
// resumeActivity(mContext, preIWinBoll);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 获取窗口队列中的前一个窗口
|
||||
// //
|
||||
// IWinBollActivity getPreIWinBoll(IWinBollActivity iWinBoll) {
|
||||
// try {
|
||||
// boolean bingo = false;
|
||||
// IWinBollActivity preIWinBoll = null;
|
||||
// for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
|
||||
// if (entity.getKey().equals(iWinBoll.getTag())) {
|
||||
// bingo = true;
|
||||
// LogUtils.d(TAG, "bingo");
|
||||
// break;
|
||||
// }
|
||||
// preIWinBoll = entity.getValue();
|
||||
// }
|
||||
//
|
||||
// if (bingo) {
|
||||
// return preIWinBoll;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
// }
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 从管理列表中移除管理项
|
||||
// //
|
||||
// public <T extends IWinBollActivity> boolean registeRemove(T activity) {
|
||||
// IWinBollActivity iWinBollTest = _mapIWinBollList.get(activity.getTag());
|
||||
// if (iWinBollTest != null) {
|
||||
// _mapIWinBollList.remove(activity.getTag());
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// //
|
||||
// // 打印管理列表项列表里的信息
|
||||
// //
|
||||
// public static void printIWinBollListInfo() {
|
||||
// //LogUtils.d(TAG, "printAvtivityListInfo");
|
||||
// if (!_mapIWinBollList.isEmpty()) {
|
||||
// StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapIWinBollList.size()));
|
||||
// Iterator<Map.Entry<String, IWinBollActivity>> iterator = _mapIWinBollList.entrySet().iterator();
|
||||
// while (iterator.hasNext()) {
|
||||
// Map.Entry<String, IWinBollActivity> entry = iterator.next();
|
||||
// sb.append("\nKey: " + entry.getKey() + ", \nValue: " + entry.getValue().getTag());
|
||||
// //ToastUtils.show("\nKey: " + entry.getKey() + ", Value: " + entry.getValue().getTag());
|
||||
// }
|
||||
// sb.append("\nMap entries end.");
|
||||
// LogUtils.d(TAG, sb.toString());
|
||||
// } else {
|
||||
// LogUtils.d(TAG, "The map is empty.");
|
||||
// }
|
||||
// }
|
||||
}
|
11
libaes/src/main/res/drawable/ic_call.xml
Normal file
11
libaes/src/main/res/drawable/ic_call.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?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="#ff000000"
|
||||
android:pathData="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0,0 1,21 16.5V20A1,1 0,0 1,20 21A17,17 0,0 1,3 4A1,1 0,0 1,4 3H7.5A1,1 0,0 1,8.5 4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z"/>
|
||||
|
||||
</vector>
|
@@ -1,14 +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">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/activitylibraryFrameLayout1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical">
|
||||
@@ -12,49 +12,49 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="AOHPCTCSeekBar"/>
|
||||
|
||||
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/fragmentviewpageAOHPCTCSeekBar1"/>
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/fragmentviewpageViewPager1"/>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/fragmentviewpageViewPager1"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:id="@+id/fragmentviewpageLinearLayout1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:id="@+id/fragmentviewpageLinearLayout1">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
tools:ignore="ContentDescription"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -11,6 +11,25 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="AOHPCTCSeekBar"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/fragmentviewpageAOHPCTCSeekBar1"
|
||||
android:padding="10dp"/>
|
||||
|
||||
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/fragmentviewpageAOHPCTCSeekBar2"
|
||||
android:padding="10dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -32,6 +32,13 @@
|
||||
<attr name="attrASupportToolbarEndColor"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AButton">
|
||||
<attr name="attrAButtonTextColor" format="color" />
|
||||
<attr name="attrAButtonPrimary" format="color" />
|
||||
<attr name="attrAButtonPrimaryDark" format="color" />
|
||||
<attr name="attrAButtonAccent" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<attr name="ActionSheetList" format="reference"/>
|
||||
<!--<declare-styleable name="AToolbarStyle">
|
||||
<attr name="attrAToolbarStartColor" format="color" />
|
||||
|
@@ -1,10 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- 默认方案 -->
|
||||
<color name="colorPrimary">#FF03AB4E</color>
|
||||
<color name="colorPrimaryDark">#FF027C39</color>
|
||||
<color name="colorAccent">#FF3DDC84</color>
|
||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||
<color name="colorText">#FFFFFB8D</color>
|
||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||
<color name="colorToastShadow">#FF000000</color>
|
||||
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||
<color name="colorAToolbarStartColor">#FF7D3F12</color>
|
||||
@@ -14,16 +16,16 @@
|
||||
<color name="colorACardShadow">@color/colorPrimaryDark</color>
|
||||
<color name="colorACardFrame">@color/colorPrimary</color>
|
||||
<color name="colorACardBackgroung">@color/colorAccent</color>
|
||||
|
||||
|
||||
<color name="colorATickProgressBarBackgroung">@color/colorAccent</color>
|
||||
<color name="colorATickProgressBarProgress">@color/colorPrimary</color>
|
||||
|
||||
|
||||
<color name="colorOHPCTSBackground">@color/colorAccent</color>
|
||||
<color name="colorOHPCTSSecondaryProgress">@color/colorPrimary</color>
|
||||
<color name="colorOHPCTSProgress">@color/colorPrimaryDark</color>
|
||||
|
||||
|
||||
<!-- -->
|
||||
|
||||
|
||||
<!-- 调试方案
|
||||
<color name="colorPrimary">#FF727272</color>
|
||||
<color name="colorPrimaryDark">#FF444444</color>
|
||||
@@ -39,5 +41,5 @@
|
||||
|
||||
<color name="colorATickProgressBarBackgroung">#FF6DC4E2</color>
|
||||
<color name="colorATickProgressBarProgress">#FF22B0E1</color>
|
||||
-->
|
||||
-->
|
||||
</resources>
|
||||
|
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="colorPrimary">#FF03AB4E</item>
|
||||
<item name="colorPrimaryDark">#FF027C39</item>
|
||||
<item name="colorAccent">#FF3DDC84</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/AESAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/AESASupportToolbar</item>
|
||||
@@ -24,158 +23,196 @@
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="DefaultAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF03AB4E</item>
|
||||
<item name="colorPrimaryDark">#FF027C39</item>
|
||||
<item name="colorAccent">#FF3DDC84</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/DefaultAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/DefaultASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="DefaultAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="DefaultASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="DepthAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="DepthAESTheme" parent="AESTheme">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF2566FE</item>
|
||||
<item name="colorPrimaryDark">#FF1359FF</item>
|
||||
<item name="colorAccent">#FF8BAEFF</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/DepthAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/DepthASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="DepthAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="DepthASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="SkyAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="SkyAESTheme" parent="AESTheme">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF1E98D4</item>
|
||||
<item name="colorPrimaryDark">#FF046A9C</item>
|
||||
<item name="colorAccent">#FF8CD9FF</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/SkyAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/SkyASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="SkyAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="SkyASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="GoldenAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="GoldenAESTheme" parent="AESTheme">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FFFFE22A</item>
|
||||
<item name="colorPrimaryDark">#FFAE9600</item>
|
||||
<item name="colorAccent">#FFFFED78</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/GoldenAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/GoldenASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="GoldenAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="GoldenASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="MemorAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="MemorAESTheme" parent="AESTheme">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FFCE1ED4</item>
|
||||
<item name="colorPrimaryDark">#FFB500BC</item>
|
||||
<item name="colorAccent">#FFE653EB</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/MemorAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/MemorASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="MemorAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="MemorASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="TaoAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<style name="TaoAESTheme" parent="AESTheme">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF9F9F9F</item>
|
||||
<item name="colorPrimaryDark">#FF5E5E5E</item>
|
||||
<item name="colorAccent">#FFD9D9D9</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/TaoAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/TaoASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<!--<style name="AESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/AESAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/AESASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="AESAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AESASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>-->
|
||||
|
||||
<!--<style name="DepthAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF2566FE</item>
|
||||
<item name="colorPrimaryDark">#FF1359FF</item>
|
||||
<item name="colorAccent">#FF8BAEFF</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/DepthAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/DepthASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="DepthAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="DepthASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="SkyAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF1E98D4</item>
|
||||
<item name="colorPrimaryDark">#FF046A9C</item>
|
||||
<item name="colorAccent">#FF8CD9FF</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/SkyAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/SkyASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="SkyAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="SkyASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="GoldenAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FFFFE22A</item>
|
||||
<item name="colorPrimaryDark">#FFAE9600</item>
|
||||
<item name="colorAccent">#FFFFED78</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/GoldenAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/GoldenASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="GoldenAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="GoldenASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="MemorAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FFCE1ED4</item>
|
||||
<item name="colorPrimaryDark">#FFB500BC</item>
|
||||
<item name="colorAccent">#FFE653EB</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/MemorAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/MemorASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="MemorAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="MemorASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="TaoAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF9F9F9F</item>
|
||||
<item name="colorPrimaryDark">#FF5E5E5E</item>
|
||||
<item name="colorAccent">#FFD9D9D9</item>
|
||||
<item name="android:textColor">#FF000000</item>
|
||||
<item name="aToolbar">@style/TaoAToolbar</item>
|
||||
<item name="aSupportToolbar">@style/TaoASupportToolbar</item>
|
||||
</style>
|
||||
|
||||
<style name="TaoAToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="TaoASupportToolbar">
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>-->
|
||||
|
||||
<!--<style name="AToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarStartColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarCenterColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarEndColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarTitleTextColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarStartColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarCenterColor">#FF2DDA27</item>
|
||||
<item name="attrAToolbarEndColor">#FF2DDA27</item>
|
||||
</style>-->
|
||||
|
||||
<!--对话框的样式-->
|
||||
|
@@ -4,8 +4,8 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 26
|
||||
@@ -21,4 +21,32 @@ android {
|
||||
|
||||
dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
||||
implementation 'com.github.getActivity:XXPermissions:18.63'
|
||||
// 下拉控件
|
||||
implementation 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
||||
// 拼音搜索
|
||||
// https://mvnrepository.com/artifact/com.github.open-android/pinyin4j
|
||||
implementation 'com.github.open-android:pinyin4j:2.5.0'
|
||||
// SSH
|
||||
implementation 'com.jcraft:jsch:0.1.55'
|
||||
// Html 解析
|
||||
implementation 'org.jsoup:jsoup:1.13.1'
|
||||
// 二维码类库
|
||||
implementation 'com.google.zxing:core:3.4.1'
|
||||
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
// 网络连接类库
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
|
||||
// Android 类库
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.viewpager:viewpager:1.0.0'
|
||||
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
||||
implementation 'androidx.fragment:fragment:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
|
||||
implementation 'cc.winboll.studio:libappbase:15.0.5'
|
||||
implementation 'cc.winboll.studio:libapputils:15.0.2'
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sat Mar 15 15:29:07 HKT 2025
|
||||
stageCount=3
|
||||
#Mon Mar 24 14:06:10 HKT 2025
|
||||
stageCount=10
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.2
|
||||
publishVersion=15.0.9
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.3
|
||||
baseBetaVersion=15.0.10
|
||||
|
@@ -190,6 +190,7 @@ public class LogView extends RelativeLayout {
|
||||
|
||||
// 加载标签表
|
||||
mListViewTags = findViewById(cc.winboll.studio.libappbase.R.id.tags_listview);
|
||||
mListViewTags.setVerticalOffset(10);
|
||||
mTAGListAdapter = new TAGListAdapter(mContext, mapTAGList);
|
||||
mListViewTags.setAdapter(mTAGListAdapter);
|
||||
|
||||
|
@@ -12,7 +12,9 @@ import android.widget.ListView;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
|
||||
public class HorizontalListView extends ListView {
|
||||
|
||||
public static final String TAG = "HorizontalListView";
|
||||
int verticalOffset = 0;
|
||||
|
||||
public HorizontalListView(Context context) {
|
||||
super(context);
|
||||
@@ -25,25 +27,10 @@ public class HorizontalListView extends ListView {
|
||||
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
// @Override
|
||||
// protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
// super.onLayout(changed, l, t, r, b);
|
||||
// int childCount = getChildCount();
|
||||
// int left = getPaddingLeft();
|
||||
// // 获取HorizontalListView的高度
|
||||
// int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||
// for (int i = 0; i < childCount; i++) {
|
||||
// View child = getChildAt(i);
|
||||
// int width = child.getMeasuredWidth();
|
||||
// int height = child.getMeasuredHeight();
|
||||
// // 计算子项在垂直方向上的居中偏移量
|
||||
// int verticalOffset = (viewHeight - height) / 2;
|
||||
// // 设置子视图的位置,实现水平布局并垂直居中
|
||||
// child.layout(left, getPaddingTop() + verticalOffset, left + width, getPaddingTop() + verticalOffset + height);
|
||||
// left += width;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
public void setVerticalOffset(int verticalOffset) {
|
||||
this.verticalOffset = verticalOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
@@ -52,7 +39,7 @@ public class HorizontalListView extends ListView {
|
||||
int left = getPaddingLeft();
|
||||
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||
LogUtils.d(TAG, String.format("HorizontalListView的高度 %d", viewHeight));
|
||||
int verticalOffset = 20;
|
||||
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
View child = getChildAt(i);
|
||||
// 计算每个子视图的宽度和高度
|
||||
@@ -60,7 +47,7 @@ public class HorizontalListView extends ListView {
|
||||
int height = child.getMeasuredHeight();
|
||||
//LogUtils.d(TAG, String.format("child : width %d , height %d", width, height));
|
||||
// 设置子视图的位置,实现水平布局
|
||||
|
||||
|
||||
child.layout(left, verticalOffset, left + width, verticalOffset + height);
|
||||
left += width;
|
||||
}
|
||||
@@ -68,15 +55,11 @@ public class HorizontalListView extends ListView {
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
|
||||
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||
//super.onMeasure(widthMeasureSpec, newHeightMeasureSpec);
|
||||
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||
//LogUtils.d(TAG, String.format("newWidthMeasureSpec %d, newHeightMeasureSpec %d", newWidthMeasureSpec, newHeightMeasureSpec));
|
||||
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
||||
|
||||
// ViewGroup.LayoutParams params = getLayoutParams();
|
||||
// params.width = getMeasuredWidth();
|
||||
}
|
||||
}
|
||||
|
||||
|
13
libappbase/src/main/res/drawable/bg_border_round.xml
Normal file
13
libappbase/src/main/res/drawable/bg_border_round.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#000000" /> <!-- 这里可调整边框宽度和颜色 -->
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
@@ -10,8 +10,8 @@
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#0F000000"
|
||||
android:startColor="#0F000000" />
|
||||
android:endColor="@color/colorAccent"
|
||||
android:startColor="@color/colorAccent" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
|
41
libappbase/src/main/res/drawable/bg_toolbar_log.xml
Normal file
41
libappbase/src/main/res/drawable/bg_toolbar_log.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<!-- 阴影部分 -->
|
||||
<!-- 个人觉得更形象的表达:top代表下边的阴影高度,left代表右边的阴影宽度。其实也就是相对应的offset,solid中的颜色是阴影的颜色,也可以设置角度等等 -->
|
||||
<item
|
||||
android:left="2dp"
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/colorPrimary"
|
||||
android:startColor="@color/colorPrimary" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 背景部分 -->
|
||||
<!-- 形象的表达:bottom代表背景部分在上边缘超出阴影的高度,right代表背景部分在左边超出阴影的宽度(相对应的offset) -->
|
||||
<item
|
||||
android:left="3dp"
|
||||
android:top="3dp"
|
||||
android:right="3dp"
|
||||
android:bottom="5dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/colorPrimary"
|
||||
android:startColor="@color/colorPrimary" />
|
||||
<corners
|
||||
android:bottomLeftRadius="6dip"
|
||||
android:bottomRightRadius="6dip"
|
||||
android:topLeftRadius="6dip"
|
||||
android:topRightRadius="6dip" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
@@ -5,18 +5,18 @@
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFEEEEEE">
|
||||
android:background="@drawable/bg_border_round">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:id="@+id/viewlogtagTextView1"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:id="@+id/viewlogtagTextView1"/>
|
||||
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:id="@+id/viewlogtagCheckBox1"/>
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:id="@+id/viewlogtagCheckBox1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/bg_shadow"
|
||||
android:background="@drawable/bg_toolbar_log"
|
||||
android:id="@+id/viewlogRelativeLayoutToolbar">
|
||||
|
||||
<Button
|
||||
@@ -72,27 +72,29 @@
|
||||
android:layout_below="@+id/viewlogRelativeLayoutToolbar"
|
||||
android:id="@+id/viewlogLinearLayout1"
|
||||
android:gravity="center_vertical"
|
||||
android:background="#FFC0F4C2">
|
||||
android:background="@drawable/bg_toolbar_log">
|
||||
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/button_height"
|
||||
android:text="ALL"
|
||||
android:id="@+id/viewlogCheckBox1"/>
|
||||
android:id="@+id/viewlogCheckBox1"
|
||||
android:background="@drawable/bg_border_round"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_border"
|
||||
android:scrollbars="none"
|
||||
android:layout_weight="1.0"
|
||||
android:background="#FF97F2E3">
|
||||
android:padding="5dp"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<cc.winboll.studio.libappbase.views.HorizontalListView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/view_border"
|
||||
android:id="@+id/tags_listview"
|
||||
android:paddingLeft="10dp"/>
|
||||
android:id="@+id/tags_listview"/>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
|
9
libappbase/src/main/res/values/dimens.xml
Normal file
9
libappbase/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 定义一个名为text_size_normal的尺寸,值为16sp -->
|
||||
<dimen name="text_size_normal">16sp</dimen>
|
||||
<!-- 定义一个名为margin_small的尺寸,值为8dp -->
|
||||
<dimen name="margin_small">8dp</dimen>
|
||||
<!-- 定义一个名为image_width的尺寸,值为200dp -->
|
||||
<dimen name="button_height">24dp</dimen>
|
||||
</resources>
|
@@ -4,12 +4,12 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "33.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@@ -17,22 +17,28 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// 二维码使用的类库
|
||||
api 'com.google.zxing:core:3.4.1'
|
||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
|
||||
api 'io.github.medyo:android-about-page:2.0.0'
|
||||
api 'com.github.getActivity:ToastUtils:10.5'
|
||||
api 'com.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:libappbase:1.0.3'
|
||||
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'cc.winboll.studio:libappbase:15.0.5'
|
||||
|
||||
// 二维码类库
|
||||
implementation 'com.google.zxing:core:3.4.1'
|
||||
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
|
||||
// 网络连接类库
|
||||
//implementation 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||
|
||||
// Html 解析
|
||||
//implementation 'org.jsoup:jsoup:1.13.1'
|
||||
|
||||
// SSH
|
||||
//implementation 'com.jcraft:jsch:0.1.55'
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Mar 18 10:56:08 HKT 2025
|
||||
stageCount=6
|
||||
#Sat Jan 18 13:02:39 HKT 2025
|
||||
stageCount=2
|
||||
libraryProject=libapputils
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.5
|
||||
baseVersion=9.2
|
||||
publishVersion=9.2.1
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.6
|
||||
baseBetaVersion=9.2.2
|
||||
|
@@ -18,9 +18,6 @@
|
||||
<!-- 拍摄照片和视频 -->
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
|
||||
<!-- 拥有完全的网络访问权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<application android:networkSecurityConfig="@xml/network_security_config">
|
||||
|
||||
<activity
|
||||
@@ -29,7 +26,7 @@
|
||||
android:launchMode="standard"/>
|
||||
|
||||
<activity
|
||||
android:name=".activities.LogActivity"
|
||||
android:name=".log.LogActivity"
|
||||
android:label="LogActivity"
|
||||
android:launchMode="standard"/>
|
||||
|
||||
@@ -48,4 +45,4 @@
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
@@ -1,79 +1,70 @@
|
||||
package cc.winboll.studio.libapputils.activities;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/07/14 13:20:33
|
||||
* @Describe 应用介绍页
|
||||
*/
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||
import cc.winboll.studio.libapputils.app.WinBollActivityManager;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.view.AboutView;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
|
||||
final public class AboutActivity extends Activity implements IWinBollActivity {
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/07/14 13:20:33
|
||||
* @Describe AboutFragment Test
|
||||
*/
|
||||
final public class AboutActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "AboutActivity";
|
||||
|
||||
public static final String EXTRA_APPINFO = "EXTRA_APPINFO";
|
||||
|
||||
|
||||
APPInfo mAPPInfo;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityaboutToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
mAPPInfo = (APPInfo)intent.getSerializableExtra(EXTRA_APPINFO);
|
||||
}
|
||||
if (mAPPInfo == null) {
|
||||
mAPPInfo = new APPInfo();
|
||||
}
|
||||
|
||||
AboutView aboutView = new AboutView(this, mAPPInfo);
|
||||
LinearLayout llMain = findViewById(R.id.activityaboutLinearLayout1);
|
||||
llMain.addView(aboutView);
|
||||
/*AboutView aboutView = findViewById(R.id.activityaboutAboutView1);
|
||||
aboutView.setOnRequestDevUserInfoAutofillListener(new AboutView.OnRequestDevUserInfoAutofillListener(){
|
||||
|
||||
//ToastUtils.show(TAG);
|
||||
@Override
|
||||
public void requestAutofill(EditText etDevUserName, EditText etDevUserPassword) {
|
||||
AutofillManager autofillManager = (AutofillManager) getSystemService(AutofillManager.class);
|
||||
if (autofillManager!= null) {
|
||||
//ToastUtils.show("0");
|
||||
autofillManager.requestAutofill(findViewById(R.id.usernameEditText));
|
||||
autofillManager.requestAutofill(findViewById(R.id.passwordEditText));
|
||||
}
|
||||
}
|
||||
});*/
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
setSubTitle(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityaboutToolbar1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,11 +73,15 @@ final public class AboutActivity extends Activity implements IWinBollActivity {
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.item_help) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, AssetsHtmlActivity.class);
|
||||
}
|
||||
// else if (item.getItemId() == android.R.id.home) {
|
||||
// WinBollActivityManager.getInstance(this).finish(this);
|
||||
// }
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
@@ -5,28 +5,28 @@ package cc.winboll.studio.libapputils.activities;
|
||||
* @Date 2025/01/03 11:02:49
|
||||
* @Describe 一个可以浏览随 APP 附带的 Html 文档的窗口
|
||||
*/
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
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 android.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
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 java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import android.os.PersistableBundle;
|
||||
|
||||
public class AssetsHtmlActivity extends Activity implements IWinBollActivity {
|
||||
public class AssetsHtmlActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "AssetsHtmlActivity";
|
||||
|
||||
|
||||
public static final String EXTRA_HTMLFILENAME = "EXTRA_HTMLFILENAME";
|
||||
|
||||
|
||||
String mszHelpIndexFilePath = "";
|
||||
Uri mszHelpIndexFileUri;
|
||||
Context mContext;
|
||||
@@ -34,34 +34,24 @@ public class AssetsHtmlActivity extends Activity implements IWinBollActivity {
|
||||
// Assets 文件夹里的 Html 文件的名称
|
||||
String mszHtmlFileName;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityassetshtmlToolbar1);
|
||||
}
|
||||
|
||||
@@ -91,7 +81,7 @@ public class AssetsHtmlActivity extends Activity implements IWinBollActivity {
|
||||
if (szTemp != null && !szTemp.trim().equals("")) {
|
||||
mszHtmlFileName = szTemp.trim();
|
||||
}
|
||||
//ToastUtils.show(mszHtmlFileName);
|
||||
ToastUtils.show(mszHtmlFileName);
|
||||
}
|
||||
|
||||
// 与其他应用分享 html 帮助
|
||||
@@ -117,6 +107,13 @@ public class AssetsHtmlActivity extends Activity implements IWinBollActivity {
|
||||
// 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,68 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.activities;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/08 00:19:39
|
||||
* @Describe LogActivity
|
||||
*/
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
|
||||
public class LogActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "LogActivity";
|
||||
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
LogUtils.d(TAG, "onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_log);
|
||||
mLogView = findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
LogUtils.d(TAG, "onResume");
|
||||
super.onResume();
|
||||
}
|
||||
}
|
@@ -5,40 +5,29 @@ package cc.winboll.studio.libapputils.activities;
|
||||
* @Date 2025/01/18 10:32:21
|
||||
* @Describe 二维码扫码解码窗口
|
||||
*/
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.app.IWinBollActivity;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
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 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 Activity implements IWinBollActivity {
|
||||
public class QRCodeDecodeActivity extends WinBollActivity {
|
||||
|
||||
public static final String TAG = "QRCodeDecodeActivity";
|
||||
|
||||
public static final String EXTRA_RESULT = "EXTRA_RESULT";
|
||||
private static final int REQUEST_CAMERA_PERMISSION = 1;
|
||||
|
||||
private static final int REQUEST_CAMERA_PERMISSION = 1;
|
||||
TextView resultTextView;
|
||||
DecoratedBarcodeView barcodeView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public APPInfo getAppInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
@@ -46,18 +35,18 @@ public class QRCodeDecodeActivity extends Activity implements IWinBollActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnableDisplayHomeAsUp() {
|
||||
protected boolean isEnableDisplayHomeAsUp() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAddWinBollToolBar() {
|
||||
protected boolean isAddWinBollToolBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolbar initToolBar() {
|
||||
protected Toolbar initToolBar() {
|
||||
return findViewById(R.id.activityqrcodedecodeToolbar1);
|
||||
}
|
||||
|
||||
@@ -68,17 +57,16 @@ public class QRCodeDecodeActivity extends Activity implements IWinBollActivity {
|
||||
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();
|
||||
// }
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void startScanning() {
|
||||
|
@@ -0,0 +1,240 @@
|
||||
package cc.winboll.studio.libapputils.ads;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/12/09 15:37:35
|
||||
* @Describe WinBoll 应用推广视图
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.RelativeLayout;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
||||
public class ADsView extends RelativeLayout {
|
||||
|
||||
public static final String TAG = "ADsView";
|
||||
|
||||
public volatile boolean mIsHandling;
|
||||
public volatile boolean mIsAddNewLog;
|
||||
|
||||
Context mContext;
|
||||
WebView mWebView;
|
||||
//ScrollView mScrollView;
|
||||
//TextView mTextView;
|
||||
//CheckBox mSelectableCheckBox;
|
||||
//LogViewThread mLogViewThread;
|
||||
//LogViewHandler mLogViewHandler;
|
||||
//Spinner mLogLevelSpinner;
|
||||
//ArrayAdapter<CharSequence> mLogLevelSpinnerAdapter;
|
||||
|
||||
public ADsView(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public ADsView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public ADsView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public ADsView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
// public void start() {
|
||||
// mLogViewThread = new LogViewThread(LogView.this);
|
||||
// mLogViewThread.start();
|
||||
// // 显示日志
|
||||
// showAndScrollLogView();
|
||||
// }
|
||||
//
|
||||
// public void scrollLogUp() {
|
||||
// mScrollView.post(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
|
||||
// // 日志显示结束
|
||||
// mLogViewHandler.setIsHandling(false);
|
||||
// // 检查是否添加了新日志
|
||||
// if (mLogViewHandler.isAddNewLog()) {
|
||||
// // 有新日志添加,先更改新日志标志
|
||||
// mLogViewHandler.setIsAddNewLog(false);
|
||||
// // 再次发送显示日志的显示
|
||||
// Message message = mLogViewHandler.obtainMessage(LogViewHandler.MSG_LOGVIEW_UPDATE);
|
||||
// mLogViewHandler.sendMessage(message);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
void initView(Context context) {
|
||||
mContext = context;
|
||||
|
||||
// mLogViewHandler = new LogViewHandler();
|
||||
// 加载视图布局
|
||||
View viewMain = inflate(mContext, cc.winboll.studio.libapputils.R.layout.view_ads, null);
|
||||
mWebView = viewMain.findViewById(cc.winboll.studio.libapputils.R.id.viewadsWebView1);
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
view.loadUrl(url);
|
||||
ToastUtils.show(url);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// // 初始化日志子控件视图
|
||||
// //
|
||||
// mScrollView = findViewById(cc.winboll.studio.libapputils.R.id.viewlogScrollViewLog);
|
||||
// mTextView = findViewById(cc.winboll.studio.libapputils.R.id.viewlogTextViewLog);
|
||||
// // 获取Log Level spinner实例
|
||||
// mLogLevelSpinner = findViewById(cc.winboll.studio.libapputils.R.id.viewlogSpinner1);
|
||||
//
|
||||
// (findViewById(cc.winboll.studio.libapputils.R.id.viewlogButtonClean)).setOnClickListener(new View.OnClickListener(){
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// LogUtils.cleanLog();
|
||||
// LogUtils.d(TAG, "Log is cleaned.");
|
||||
// }
|
||||
// });
|
||||
// (findViewById(cc.winboll.studio.libapputils.R.id.viewlogButtonCopy)).setOnClickListener(new View.OnClickListener(){
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
//
|
||||
// ClipboardManager cm = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
// cm.setPrimaryClip(ClipData.newPlainText(mContext.getPackageName(), LogUtils.loadLog()));
|
||||
// LogUtils.d(TAG, "Log is copied.");
|
||||
// }
|
||||
// });
|
||||
// mSelectableCheckBox = findViewById(cc.winboll.studio.libapputils.R.id.viewlogCheckBoxSelectable);
|
||||
// mSelectableCheckBox.setOnClickListener(new View.OnClickListener(){
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if (mSelectableCheckBox.isChecked()) {
|
||||
// setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
|
||||
// } else {
|
||||
// setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // 设置日志级别列表
|
||||
// ArrayList<String> adapterItems = new ArrayList<>();
|
||||
// for (LogUtils.LOG_LEVEL e : LogUtils.LOG_LEVEL.values()) {
|
||||
// adapterItems.add(e.name());
|
||||
// }
|
||||
// // 假设你有一个字符串数组作为选项列表
|
||||
// //String[] options = {"Option 1", "Option 2", "Option 3"};
|
||||
// // 创建一个ArrayAdapter来绑定数据到spinner
|
||||
// mLogLevelSpinnerAdapter = ArrayAdapter.createFromResource(
|
||||
// context, cc.winboll.studio.libapputils.R.array.enum_loglevel_array, android.R.layout.simple_spinner_item);
|
||||
// mLogLevelSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
//
|
||||
// // 设置适配器并将它应用到spinner上
|
||||
// mLogLevelSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // 设置下拉视图样式
|
||||
// mLogLevelSpinner.setAdapter(mLogLevelSpinnerAdapter);
|
||||
// // 为Spinner添加监听器
|
||||
// mLogLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
// @Override
|
||||
// public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
// //String selectedOption = mLogLevelSpinnerAdapter.getItem(position);
|
||||
// // 处理选中的选项...
|
||||
// LogUtils.setLogLevel(LogUtils.LOG_LEVEL.values()[position]);
|
||||
// }
|
||||
// @Override
|
||||
// public void onNothingSelected(AdapterView<?> parent) {
|
||||
// // 如果没有选择,则执行此操作...
|
||||
// }
|
||||
// });
|
||||
// // 获取默认值的索引
|
||||
// int defaultValueIndex = LogUtils.getLogLevel().ordinal();
|
||||
//
|
||||
// if (defaultValueIndex != -1) {
|
||||
// // 如果找到了默认值,设置默认选项
|
||||
// mLogLevelSpinner.setSelection(defaultValueIndex);
|
||||
// }
|
||||
//
|
||||
// // 设置滚动时不聚焦日志
|
||||
// setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||
}
|
||||
|
||||
public void loadUrl(String url) {
|
||||
mWebView.loadUrl(url);
|
||||
//webView.loadUrl("https://www.winboll.cc");
|
||||
//webView.loadUrl("https://ads.winboll.cc");
|
||||
}
|
||||
|
||||
// public void updateLogView() {
|
||||
// if (mLogViewHandler.isHandling() == true) {
|
||||
// // 正在处理日志显示,
|
||||
// // 就先设置一个新日志标志位
|
||||
// // 以便日志显示完后,再次显示新日志内容
|
||||
// mLogViewHandler.setIsAddNewLog(true);
|
||||
// } else {
|
||||
// //LogUtils.d(TAG, "LogListener showLog(String path)");
|
||||
// Message message = mLogViewHandler.obtainMessage(LogViewHandler.MSG_LOGVIEW_UPDATE);
|
||||
// mLogViewHandler.sendMessage(message);
|
||||
// mLogViewHandler.setIsAddNewLog(false);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void showAndScrollLogView() {
|
||||
// mTextView.setText(LogUtils.loadLog());
|
||||
// scrollLogUp();
|
||||
// }
|
||||
//
|
||||
// class LogViewHandler extends Handler {
|
||||
//
|
||||
// final static int MSG_LOGVIEW_UPDATE = 0;
|
||||
// volatile boolean isHandling;
|
||||
// volatile boolean isAddNewLog;
|
||||
//
|
||||
// public LogViewHandler() {
|
||||
// setIsHandling(false);
|
||||
// setIsAddNewLog(false);
|
||||
// }
|
||||
//
|
||||
// public void setIsHandling(boolean isHandling) {
|
||||
// this.isHandling = isHandling;
|
||||
// }
|
||||
//
|
||||
// public boolean isHandling() {
|
||||
// return isHandling;
|
||||
// }
|
||||
//
|
||||
// public void setIsAddNewLog(boolean isAddNewLog) {
|
||||
// this.isAddNewLog = isAddNewLog;
|
||||
// }
|
||||
//
|
||||
// public boolean isAddNewLog() {
|
||||
// return isAddNewLog;
|
||||
// }
|
||||
//
|
||||
// public void handleMessage(Message msg) {
|
||||
// switch (msg.what) {
|
||||
// case MSG_LOGVIEW_UPDATE:{
|
||||
// if (isHandling() == false) {
|
||||
// setIsHandling(true);
|
||||
// showAndScrollLogView();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// super.handleMessage(msg);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
@@ -1,54 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/02/06 08:45:23
|
||||
* @Describe 关于活动窗口的介绍窗口工厂
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
|
||||
public class AboutActivityFactory {
|
||||
|
||||
public static final String TAG = "AboutActivityFactory";
|
||||
|
||||
public static APPInfo buildDefaultAPPInfo() {
|
||||
String szBranchName = "";
|
||||
|
||||
APPInfo appInfo = new APPInfo();
|
||||
appInfo.setAppName("APP");
|
||||
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
|
||||
appInfo.setAppDescription("APP Description");
|
||||
appInfo.setAppGitName("APP");
|
||||
appInfo.setAppGitOwner("Studio");
|
||||
appInfo.setAppGitAPPBranch(szBranchName);
|
||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");
|
||||
appInfo.setAppAPKName("APP");
|
||||
appInfo.setAppAPKFolderName("APP");
|
||||
return appInfo;
|
||||
}
|
||||
|
||||
public static void showAboutActivity(Context context, APPInfo appInfo) {
|
||||
/*String szPN = ((IWinBollActivity)context).getActivityPackageName();
|
||||
//String szPN = context.getPackageName();
|
||||
String szBranchName = "";
|
||||
if (szPN != null) {
|
||||
//String szPN = "cc.winboll.studio.apputils.beta";
|
||||
String regex = "cc\\.winboll\\.studio\\.([^.]+)\\.*";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(szPN);
|
||||
if (matcher.find()) {
|
||||
szBranchName = matcher.group(1);
|
||||
}
|
||||
}*/
|
||||
//ToastUtils.show(szPN);
|
||||
|
||||
Intent intent = new Intent(context, AboutActivity.class);
|
||||
intent.putExtra(AboutActivity.EXTRA_APPINFO, (appInfo == null) ? AboutActivityFactory.buildDefaultAPPInfo():appInfo);
|
||||
WinBollActivityManager.getInstance(context).startWinBollActivity(context, intent, AboutActivity.class);
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@ package cc.winboll.studio.libapputils.app;
|
||||
* @Date 2024/08/12 14:45:35
|
||||
* @Describe 应用版本工具集
|
||||
*/
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -23,7 +23,6 @@ public class AppVersionUtils {
|
||||
// true 新版本 == 当前版本
|
||||
//
|
||||
public static boolean isHasNewVersion2(String szCurrentName, String szNextName) {
|
||||
LogUtils.d(TAG, String.format("isHasNewVersion2\nszCurrentName : %s\nszNextName : %s", szCurrentName, szNextName));
|
||||
//szCurrentName = "AES_6.2.0-beta0_3234.apk";
|
||||
//szNextName = "AES_6.1.12.apk";
|
||||
//szCurrentName = "AES_6.2.0-beta0_3234.apk";
|
||||
@@ -78,9 +77,8 @@ public class AppVersionUtils {
|
||||
//LogUtils.d(TAG, "App version is the newest. ");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isHasNewStageReleaseVersion(String szCurrentName, String szNextName) {
|
||||
LogUtils.d(TAG, String.format("isHasNewStageReleaseVersion\nszCurrentName : %s\nszNextName : %s", szCurrentName, szNextName));
|
||||
//szCurrentName = "AES_6.2.12.apk";
|
||||
//szNextName = "AES_6.3.12.apk";
|
||||
if (checkNewVersion(getCodeInPackageName(szCurrentName), getCodeInPackageName(szNextName))) {
|
||||
@@ -98,10 +96,6 @@ public class AppVersionUtils {
|
||||
// 返回 :true 新版本 > 当前版本
|
||||
//
|
||||
public static Boolean checkNewVersion(String szCurrentCode, String szNextCode) {
|
||||
if (szCurrentCode == null || szCurrentCode.equals("") || szNextCode == null || szNextCode.equals("")) {
|
||||
LogUtils.d(TAG, String.format("checkNewVersion unexpected parameters:\nszCurrentCode : %s\nszNextCode : %s", szCurrentCode, szNextCode));
|
||||
return false;
|
||||
}
|
||||
boolean isNew = false;
|
||||
String[] appVersionCurrent = szCurrentCode.split("\\.");
|
||||
String[] appVersionNext = szNextCode.split("\\.");
|
||||
@@ -112,7 +106,7 @@ public class AppVersionUtils {
|
||||
if (Integer.parseInt(appVersionNext[i]) > Integer.parseInt(appVersionCurrent[i])) {
|
||||
isNew = true;
|
||||
return isNew;
|
||||
} else if (Integer.parseInt(appVersionNext[i]) == Integer.parseInt(appVersionCurrent[i])) {
|
||||
} else if(Integer.parseInt(appVersionNext[i]) == Integer.parseInt(appVersionCurrent[i])) {
|
||||
continue ;
|
||||
} else {
|
||||
isNew = false;
|
||||
@@ -128,17 +122,14 @@ public class AppVersionUtils {
|
||||
// 如 :AppUtils_7.0.4.apk 版本号为 7.0.4
|
||||
//
|
||||
public static String getCodeInPackageName(String apkName) {
|
||||
LogUtils.d(TAG, String.format("getCodeInPackageName apkName : %s", apkName));
|
||||
//String apkName = "AppUtils_7.0.0.apk";
|
||||
Pattern pattern = Pattern.compile("\\d+\\.\\d+\\.\\d+");
|
||||
Matcher matcher = pattern.matcher(apkName);
|
||||
if (matcher.find()) {
|
||||
String version = matcher.group();
|
||||
LogUtils.d(TAG, String.format("version is %s", version));
|
||||
return version;
|
||||
//System.out.println("Version number: " + version); // 输出:7.0.0
|
||||
}
|
||||
LogUtils.d(TAG, String.format("No result."));
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -158,4 +149,5 @@ public class AppVersionUtils {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -6,19 +6,22 @@ package cc.winboll.studio.libapputils.app;
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.Set;
|
||||
|
||||
public class MyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
public static final String TAG = "MyActivityLifecycleCallbacks";
|
||||
|
||||
|
||||
public String mInfo = "";
|
||||
|
||||
public MyActivityLifecycleCallbacks() {
|
||||
public MyActivityLifecycleCallbacks(WinBollApplication application) {
|
||||
|
||||
}
|
||||
|
||||
void createActivityeInfo(Activity activity) {
|
||||
|
@@ -0,0 +1,479 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/08/12 14:32:08
|
||||
* @Describe WinBoll 活动窗口基础类
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import cc.winboll.studio.libapputils.activities.AboutActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogActivity;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.view.AboutView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
abstract public class WinBollActivity extends AppCompatActivity {
|
||||
|
||||
public static final String TAG = "WinBollActivity";
|
||||
|
||||
public static final int REQUEST_LOG_ACTIVITY = 0;
|
||||
|
||||
Toolbar mToolBar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
checkResolveActivity();
|
||||
LogUtils.d(TAG, "onCreate");
|
||||
super.onCreate(savedInstanceState);
|
||||
archiveInstance();
|
||||
|
||||
}
|
||||
|
||||
boolean checkResolveActivity() {
|
||||
PackageManager packageManager = getPackageManager();
|
||||
//Intent intent = new Intent("your_action_here");
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
if (resolveInfoList.size() > 0) {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里有定义
|
||||
if (intent.getAction() != null) {
|
||||
if (intent.getAction().equals(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW)) {
|
||||
WinBollApplication.setIsDebug(true);
|
||||
//ToastUtils.show!("WinBollApplication.setIsDebug(true) by action : " + intent.getAction());
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// 传入的Intent action在Activity清单的intent-filter的action节点里没有定义
|
||||
//ToastUtils.show("false : " + intent.getAction());
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
|
||||
if (resolveInfo != null) {
|
||||
// action在清单文件中有声明
|
||||
|
||||
} else {
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
// action在清单文件中没有声明
|
||||
ToastUtils.show("false");
|
||||
return false;
|
||||
}
|
||||
|
||||
void archiveInstance() {
|
||||
Intent intent = getIntent();
|
||||
StringBuilder sb = new StringBuilder("\n### Archive Instance ###\n");
|
||||
|
||||
if (intent != null) {
|
||||
ComponentName componentName = intent.getComponent();
|
||||
if (componentName != null) {
|
||||
String packageName = componentName.getPackageName();
|
||||
//Log.d("AppStarter", "启动本应用的应用包名: " + packageName);
|
||||
sb.append("启动本应用的应用包名: \n" + packageName);
|
||||
}
|
||||
|
||||
sb.append("\nImplicit Intent Tracker :\n接收到的 Intent 动作: \n" + intent.getAction());
|
||||
Set<String> categories = intent.getCategories();
|
||||
if (categories != null) {
|
||||
for (String category : categories) {
|
||||
sb.append("\n接收到的 Intent 类别 :\n" + category);
|
||||
}
|
||||
}
|
||||
Uri data = intent.getData();
|
||||
if (data != null) {
|
||||
sb.append("\n接收到的 Intent 数据 :\n" + data.toString());
|
||||
}
|
||||
} else {
|
||||
sb.append("Intent is null.");
|
||||
}
|
||||
sb.append("\n\n");
|
||||
LogUtils.d(TAG, sb.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
mToolBar = initToolBar();
|
||||
setSupportActionBar(mToolBar);
|
||||
if (isEnableDisplayHomeAsUp() && mToolBar != null) {
|
||||
// 显示后退按钮
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
// 缓存当前 activity
|
||||
LogUtils.d(TAG, "ActManager.getInstance().add(this);");
|
||||
//ToastUtils.show("getTag() " + getTag());
|
||||
WinBollActivityManager.getInstance(this).add(this);
|
||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||
//ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE());
|
||||
//boolean isDebuging = WinBollApplication.loadDebugStatusIsDebuging();
|
||||
//ToastUtils.show(String.valueOf(isDebuging));
|
||||
//WinBollApplication.setIsDebug(true);
|
||||
|
||||
setSubTitle(getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreate() {
|
||||
super.recreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
WinBollActivityManager.getInstance(this).registeRemove(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(int layoutResID) {
|
||||
super.setContentView(layoutResID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends View> T findViewById(int id) {
|
||||
return super.findViewById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MenuInflater getMenuInflater() {
|
||||
return super.getMenuInflater();
|
||||
}
|
||||
|
||||
public WinBollActivity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context getApplicationContext() {
|
||||
return super.getApplicationContext();
|
||||
}
|
||||
|
||||
public <T extends FragmentManager> T getWinBollActivitySupportFragmentManager() {
|
||||
return (T)super.getSupportFragmentManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionBar getSupportActionBar() {
|
||||
return super.getSupportActionBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSupportActionBar(Toolbar toolbar) {
|
||||
super.setSupportActionBar(toolbar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActionBar(android.widget.Toolbar toolbar) {
|
||||
super.setActionBar(toolbar);
|
||||
}
|
||||
|
||||
public void setSubTitle(CharSequence title) {
|
||||
LogUtils.d(TAG, "setSubTitle");
|
||||
if (super.getSupportActionBar() != null) {
|
||||
super.getSupportActionBar().setSubtitle(title);
|
||||
LogUtils.d(TAG, String.format("setSubtitle title : %s", title));
|
||||
}
|
||||
}
|
||||
|
||||
public CharSequence getSubTitle() {
|
||||
if (super.getSupportActionBar() != null) {
|
||||
return super.getSupportActionBar().getSubtitle();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
//super.setTitle(title);
|
||||
if (super.getSupportActionBar() != null) {
|
||||
super.getSupportActionBar().setTitle(title);
|
||||
LogUtils.d(TAG, String.format("setSubtitle title : %s", title));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(int titleId) {
|
||||
//super.setTitle(titleId);
|
||||
if (super.getSupportActionBar() != null) {
|
||||
super.getSupportActionBar().setTitle(titleId);
|
||||
//LogUtils.d(TAG, String.format("setSubtitle title : %s", title));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTheme(Resources.Theme theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTheme(int resid) {
|
||||
super.setTheme(resid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitleColor(int textColor) {
|
||||
super.setTitleColor(textColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
super.setContentView(view, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view) {
|
||||
super.setContentView(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||
return super.getSharedPreferences(name, mode);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean releaseInstance() {
|
||||
return super.releaseInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, int flags) {
|
||||
return super.registerReceiver(receiver, filter, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler) {
|
||||
return super.registerReceiver(receiver, filter, broadcastPermission, scheduler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter, String broadcastPermission, Handler scheduler, int flags) {
|
||||
return super.registerReceiver(receiver, filter, broadcastPermission, scheduler, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivities(Intent[] intents) {
|
||||
super.startActivities(intents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode) {
|
||||
super.startActivityFromFragment(fragment, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(android.app.Fragment fragment, Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityFromFragment(fragment, intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromChild(Activity child, Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityFromChild(child, intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivities(Intent[] intents, Bundle options) {
|
||||
super.startActivities(intents, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startActivityIfNeeded(Intent intent, int requestCode) {
|
||||
return super.startActivityIfNeeded(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startActivityIfNeeded(Intent intent, int requestCode, Bundle options) {
|
||||
return super.startActivityIfNeeded(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromChild(Activity child, Intent intent, int requestCode) {
|
||||
super.startActivityFromChild(child, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComponentName startService(Intent service) {
|
||||
return super.startService(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(android.app.Fragment fragment, Intent intent, int requestCode) {
|
||||
super.startActivityFromFragment(fragment, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivityFromFragment(Fragment requestIndex, Intent fragment, int intent, Bundle requestCode) {
|
||||
super.startActivityFromFragment(requestIndex, fragment, intent, requestCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent, Bundle options) {
|
||||
super.startActivity(intent, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
if (isAddWinBollToolBar()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_winboll_shared_main, menu);
|
||||
}
|
||||
if (WinBollApplication.isDebug()) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_studio_debug, menu);
|
||||
}
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
LogUtils.d(TAG, "onOptionsItemSelected");
|
||||
if (item.getItemId() == R.id.item_log) {
|
||||
LogUtils.d(TAG, "item_log not yet.");
|
||||
//WinBollActivityManager.getInstance().printAvtivityListInfo();
|
||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, LogActivity.class);
|
||||
} else if (item.getItemId() == R.id.item_exit) {
|
||||
WinBollActivityManager.getInstance(this).finishAll();
|
||||
} else if (item.getItemId() == R.id.item_info) {
|
||||
WinBollApplication application = (WinBollApplication) getApplication();
|
||||
application.getMyActivityLifecycleCallbacks().showActivityeInfo();
|
||||
} else if (item.getItemId() == R.id.item_exitdebug) {
|
||||
AboutView.setApp2NormalMode(getApplicationContext());
|
||||
} else if (item.getItemId() == R.id.item_about) {
|
||||
startAboutActivity();
|
||||
} else if (item.getItemId() == android.R.id.home) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
// else if (item.getItemId() == android.R.id.home) {
|
||||
// 回到主窗口速度缓慢,方法备用。现在用 WinBollActivityManager resumeActivity 和 finish 方法管理。
|
||||
// _mMainWinBollActivity 是 WinBollActivity 的静态属性
|
||||
// onCreate 函数下 _mMainWinBollActivity 为空时就用 _mMainWinBollActivity = this 赋值。
|
||||
//startWinBollActivity(new Intent(_mMainWinBollActivity, _mMainWinBollActivity.getClass()), _mMainWinBollActivity.getTag(), _mMainWinBollActivity);
|
||||
//}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
//ToastUtils.show("onBackPressed");
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
|
||||
|
||||
/*public void getInstanse() {
|
||||
startWinBollActivity(new Intent(), getTag(), null);
|
||||
}*/
|
||||
|
||||
//
|
||||
// activity: 为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 tag
|
||||
// activity: 不为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
//
|
||||
// protected <T extends WinBollActivity> void startWinBollActivity(Intent intent, String tag, T activity) {
|
||||
// LogUtils.d(TAG, "startWinBollActivityForResult tag " + tag);
|
||||
// //ToastUtils.show("startWinBollActivityForResult tag " + tag);
|
||||
// //打开多任务窗口 flags
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// if (activity != null) {
|
||||
// intent.putExtra("tag", activity.getTag());
|
||||
// } else {
|
||||
// intent.putExtra("tag", tag);
|
||||
// }
|
||||
// //ToastUtils.show("super.startActivityForResult(intent, requestCode); tag " + tag);
|
||||
// LogUtils.d(TAG, "startActivityForResult(intent, requestCode);" + tag);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
|
||||
//
|
||||
// activity: 为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 tag
|
||||
// activity: 不为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
//
|
||||
protected <T extends AboutActivity> void startAboutActivity() {
|
||||
Intent intent = new Intent(this, AboutActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
intent.putExtra("tag", AboutActivity.TAG);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent) {
|
||||
//绑定唯一标识 tag,存在 则根据 taskId 移动到前台
|
||||
String tag = intent.getStringExtra("tag");
|
||||
//ToastUtils.show("startActivityForResult tag " + tag);
|
||||
//WinBollActivityManager.getInstance(this).printAvtivityListInfo();
|
||||
if (WinBollActivityManager.getInstance(this).isActive(tag)) {
|
||||
//ToastUtils.show("resumeActivity");
|
||||
LogUtils.d(TAG, "resumeActivity");
|
||||
WinBollActivityManager.getInstance(this).resumeActivity(this, tag);
|
||||
} else {
|
||||
//ToastUtils.show("super.startActivity(intent);");
|
||||
super.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int targetFragment, Intent data) {
|
||||
LogUtils.d(TAG, "onActivityResult");
|
||||
switch (requestCode) {
|
||||
case REQUEST_LOG_ACTIVITY : {
|
||||
LogUtils.d(TAG, "REQUEST_LOG_ACTIVITY");
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
super.onActivityResult(requestCode, targetFragment, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAddWinBollInfoMenu() {
|
||||
return true;
|
||||
}
|
||||
|
||||
abstract public String getTag();
|
||||
abstract protected Toolbar initToolBar();
|
||||
abstract protected boolean isEnableDisplayHomeAsUp();
|
||||
abstract protected boolean isAddWinBollToolBar();
|
||||
}
|
@@ -9,10 +9,10 @@ package cc.winboll.studio.libapputils.app;
|
||||
* https://blog.csdn.net/qq_29364417/article/details/109379915?app_version=6.4.2&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22109379915%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
|
||||
*/
|
||||
import android.app.ActivityManager;
|
||||
import android.app.TaskStackBuilder;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import androidx.core.app.TaskStackBuilder;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -20,26 +20,17 @@ import java.util.Map;
|
||||
public class WinBollActivityManager {
|
||||
|
||||
public static final String TAG = "WinBollActivityManager";
|
||||
public static final String EXTRA_TAG = "EXTRA_TAG";
|
||||
|
||||
public static enum WinBollUI_TYPE {
|
||||
Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
|
||||
Service // 退出应用后,清理所有最近任务栏任务记录窗口
|
||||
};
|
||||
|
||||
// 应用类型标志
|
||||
volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||
|
||||
Context mContext;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
static WinBollActivityManager _mWinBollActivityManager;
|
||||
static Map<String, IWinBollActivity> _mapIWinBollList;
|
||||
IWinBollActivity firstIWinBollActivity;
|
||||
static Map<String, WinBollActivity> _mapActivityList;
|
||||
//static ArrayList<WinBollActivity> _mWinBollActivityList;
|
||||
|
||||
public WinBollActivityManager(Context context) {
|
||||
mContext = context;
|
||||
LogUtils.d(TAG, "WinBollActivityManager()");
|
||||
_mapIWinBollList = new HashMap<String, IWinBollActivity>();
|
||||
_mapActivityList = new HashMap<String, WinBollActivity>();
|
||||
//_mWinBollActivityList = new ArrayList<WinBollActivity>();
|
||||
}
|
||||
|
||||
public static synchronized WinBollActivityManager getInstance(Context context) {
|
||||
@@ -51,46 +42,35 @@ public class WinBollActivityManager {
|
||||
return _mWinBollActivityManager;
|
||||
}
|
||||
|
||||
//
|
||||
// 设置 WinBoll 应用 UI 类型
|
||||
//
|
||||
public synchronized static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
|
||||
_mWinBollUI_TYPE = mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
//
|
||||
// 获取 WinBoll 应用 UI 类型
|
||||
//
|
||||
public synchronized static WinBollUI_TYPE getWinBollUI_TYPE() {
|
||||
return _mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
//
|
||||
// 把Activity添加到管理中
|
||||
//
|
||||
public <T extends IWinBollActivity> void add(T iWinBoll) {
|
||||
if (isActive(iWinBoll.getTag())) {
|
||||
LogUtils.d(TAG, String.format("add(...) %s is active.", iWinBoll.getTag()));
|
||||
/**
|
||||
* 把Activity添加到管理中
|
||||
*/
|
||||
public <T extends WinBollActivity> void add(T activity) {
|
||||
/*for (int i = 0; i < _mWinBollActivityList.size(); i++) {
|
||||
LogUtils.d(TAG, String.format("add for i %d\nget(i).getTag() %s", i, _mWinBollActivityList.get(i).getTag()));
|
||||
if (_mWinBollActivityList.get(i).getTag().equals(activity.getTag())) {
|
||||
_mWinBollActivityList.add(i, activity);
|
||||
_mWinBollActivityList.remove(i);
|
||||
LogUtils.d(TAG, String.format("Replace activity : %s\nSize %d", activity.getTag(), _mWinBollActivityList.size()));
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
if (isActive(activity.getTag())) {
|
||||
LogUtils.d(TAG, String.format("add(...) %s is active.", activity.getTag()));
|
||||
} else {
|
||||
// 设置起始活动窗口,以便最后退出时提问
|
||||
if (firstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
|
||||
firstIWinBollActivity = iWinBoll;
|
||||
}
|
||||
|
||||
// 添加到活动窗口列表
|
||||
_mapIWinBollList.put(iWinBoll.getTag(), iWinBoll);
|
||||
LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", iWinBoll.getTag(), _mapIWinBollList.size()));
|
||||
_mapActivityList.put(activity.getTag(), activity);
|
||||
LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", activity.getTag(), _mapActivityList.size()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// activity: 为 null 时,
|
||||
// intent.putExtra 函数 EXTRA_TAG 参数为 tag
|
||||
// intent.putExtra 函数 "tag" 参数为 tag
|
||||
// activity: 不为 null 时,
|
||||
// intent.putExtra 函数 "tag" 参数为 activity.getTag()
|
||||
//
|
||||
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||
public <T extends WinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||
try {
|
||||
// 如果窗口已存在就重启窗口
|
||||
String tag = clazz.newInstance().getTag();
|
||||
@@ -104,15 +84,14 @@ public class WinBollActivityManager {
|
||||
//打开多任务窗口 flags
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(EXTRA_TAG, tag);
|
||||
intent.putExtra("tag", tag);
|
||||
mContext.startActivity(intent);
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||
public <T extends WinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||
try {
|
||||
// 如果窗口已存在就重启窗口
|
||||
String tag = clazz.newInstance().getTag();
|
||||
@@ -126,30 +105,25 @@ public class WinBollActivityManager {
|
||||
//打开多任务窗口 flags
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(EXTRA_TAG, tag);
|
||||
intent.putExtra("tag", tag);
|
||||
mContext.startActivity(intent);
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
|
||||
return firstIWinBollActivity != null && firstIWinBollActivity == iWinBollActivity;
|
||||
}
|
||||
|
||||
//
|
||||
// 判断 tag绑定的 MyActivity是否存在
|
||||
//
|
||||
/**
|
||||
* 判断 tag绑定的 MyActivity是否存在
|
||||
*/
|
||||
public boolean isActive(String tag) {
|
||||
//printAvtivityListInfo();
|
||||
IWinBollActivity iWinBoll = getIWinBoll(tag);
|
||||
if (iWinBoll != null) {
|
||||
printAvtivityListInfo();
|
||||
WinBollActivity activity = getWinBollActivity(tag);
|
||||
if (activity != null) {
|
||||
LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
|
||||
//ToastUtils.show("activity != null tag " + tag);
|
||||
//判断是否为 BaseActivity,如果已经销毁,则移除
|
||||
if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
|
||||
_mapIWinBollList.remove(iWinBoll.getTag());
|
||||
if (activity.isFinishing() || activity.isDestroyed()) {
|
||||
_mapActivityList.remove(activity.getTag());
|
||||
//_mWinBollActivityList.remove(activity);
|
||||
LogUtils.d(TAG, String.format("isActive(...) remove activity.\ntag : %s", tag));
|
||||
return false;
|
||||
@@ -163,75 +137,75 @@ public class WinBollActivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
static IWinBollActivity getIWinBoll(String tag) {
|
||||
return _mapIWinBollList.get(tag);
|
||||
static WinBollActivity getWinBollActivity(String tag) {
|
||||
return _mapActivityList.get(tag);
|
||||
}
|
||||
|
||||
//
|
||||
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
//
|
||||
public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
|
||||
/**
|
||||
* 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
*/
|
||||
public <T extends WinBollActivity> void resumeActivity(Context context, String tag) {
|
||||
LogUtils.d(TAG, "resumeActivty");
|
||||
T iWinBoll = (T)getIWinBoll(tag);
|
||||
//LogUtils.d(TAG, "activity " + activity.getTag());
|
||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
resumeActivity(context, iWinBoll);
|
||||
T activity = (T)getWinBollActivity(tag);
|
||||
LogUtils.d(TAG, "activity " + activity.getTag());
|
||||
if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
|
||||
resumeActivity(context, activity);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
//
|
||||
public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
|
||||
ActivityManager am = (ActivityManager) iWinBoll.getActivity().getSystemService(Context.ACTIVITY_SERVICE);
|
||||
/**
|
||||
* 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||
*/
|
||||
public <T extends WinBollActivity> void resumeActivity(Context context, T activity) {
|
||||
ActivityManager am = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
//返回启动它的根任务(home 或者 MainActivity)
|
||||
Intent intent = new Intent(context, iWinBoll.getClass());
|
||||
Intent intent = new Intent(context, activity.getClass());
|
||||
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
||||
stackBuilder.addNextIntentWithParentStack(intent);
|
||||
stackBuilder.startActivities();
|
||||
//moveTaskToFront(YourTaskId, 0);
|
||||
LogUtils.d(TAG, "am.moveTaskToFront");
|
||||
//ToastUtils.show("resumeActivity am.moveTaskToFront");
|
||||
am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||
am.moveTaskToFront(activity.getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 结束所有 Activity
|
||||
//
|
||||
/**
|
||||
* 结束所有 Activity
|
||||
*/
|
||||
public void finishAll() {
|
||||
try {
|
||||
for (String key : _mapIWinBollList.keySet()) {
|
||||
//System.out.println("Key: " + key + ", Value: " + _mapActivityList.get(key));
|
||||
IWinBollActivity iWinBoll = _mapIWinBollList.get(key);
|
||||
//ToastUtils.show("finishAll() activity");
|
||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
//ToastUtils.show("activity != null ...");
|
||||
if (getWinBollUI_TYPE() == WinBollUI_TYPE.Service) {
|
||||
// 结束窗口和最近任务栏, 建议前台服务类应用使用,可以方便用户再次调用 UI 操作。
|
||||
iWinBoll.getActivity().finishAndRemoveTask();
|
||||
//ToastUtils.show("finishAll() activity.finishAndRemoveTask();");
|
||||
} else if (getWinBollUI_TYPE() == WinBollUI_TYPE.Aplication) {
|
||||
// 结束窗口保留最近任务栏,建议前台服务类应用使用,可以保持应用的系统自觉性。
|
||||
iWinBoll.getActivity().finish();
|
||||
//ToastUtils.show("finishAll() activity.finish();");
|
||||
} else {
|
||||
LogUtils.d(TAG, "WinBollApplication.WinBollUI_TYPE error.");
|
||||
//ToastUtils.show("WinBollApplication.WinBollUI_TYPE error.");
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtils.d(TAG, "finishAll no yet.");
|
||||
//ToastUtils.show(String.format("finishAll() size : %d", _mWinBollActivityList.size()));
|
||||
// for (int i = _mWinBollActivityList.size() - 1; i > -1; i--) {
|
||||
// WinBollActivity activity = _mWinBollActivityList.get(i);
|
||||
// ToastUtils.show("finishAll() activity");
|
||||
// if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
|
||||
// //ToastUtils.show("activity != null ...");
|
||||
// if (WinBollApplication.getWinBollUI_TYPE() == WinBollApplication.WinBollUI_TYPE.Service) {
|
||||
// // 结束窗口和最近任务栏, 建议前台服务类应用使用,可以方便用户再次调用 UI 操作。
|
||||
// activity.finishAndRemoveTask();
|
||||
// //ToastUtils.show("finishAll() activity.finishAndRemoveTask();");
|
||||
// } else if (WinBollApplication.getWinBollUI_TYPE() == WinBollApplication.WinBollUI_TYPE.Aplication) {
|
||||
// // 结束窗口保留最近任务栏,建议前台服务类应用使用,可以保持应用的系统自觉性。
|
||||
// activity.finish();
|
||||
// //ToastUtils.show("finishAll() activity.finish();");
|
||||
// } else {
|
||||
// ToastUtils.show("WinBollApplication.WinBollUI_TYPE error.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 结束指定Activity
|
||||
//
|
||||
public <T extends IWinBollActivity> void finish(T iWinBoll) {
|
||||
/**
|
||||
* 结束指定Activity
|
||||
*/
|
||||
public <T extends WinBollActivity> void finish(T activity) {
|
||||
try {
|
||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||
if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
|
||||
//根据tag 移除 MyActivity
|
||||
//String tag= activity.getTag();
|
||||
//_mWinBollActivityList.remove(tag);
|
||||
@@ -246,11 +220,27 @@ public class WinBollActivityManager {
|
||||
// ★:0 1 2 3 [4] >> 3
|
||||
// ★:[0] >> 直接关闭当前窗口
|
||||
LogUtils.d(TAG, "finish no yet.");
|
||||
IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
|
||||
iWinBoll.getActivity().finish();
|
||||
if (preIWinBoll != null) {
|
||||
resumeActivity(mContext, preIWinBoll);
|
||||
WinBollActivity preActivity = getPreActivity(activity);
|
||||
activity.finish();
|
||||
if (preActivity != null) {
|
||||
resumeActivity(mContext, preActivity);
|
||||
}
|
||||
|
||||
// for (int i = 0; i < _mWinBollActivityList.size(); i++) {
|
||||
// if (_mWinBollActivityList.get(i).getTag().equals(activity.getTag())) {
|
||||
// //ToastUtils.show(String.format("equals i : %d\nTag : %s\nSize : %d", i, activity.getTag(), _mWinBollActivityList.size()));
|
||||
// if (i == 0) {
|
||||
// finishAll();
|
||||
// //ToastUtils.show("finish finishAll");
|
||||
// return;
|
||||
// }
|
||||
// if (i > 0) {
|
||||
// activity.finish();
|
||||
// resumeActivity(mContext, _mWinBollActivityList.get(i - 1));
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -258,24 +248,21 @@ public class WinBollActivityManager {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 获取窗口队列中的前一个窗口
|
||||
//
|
||||
IWinBollActivity getPreIWinBoll(IWinBollActivity iWinBoll) {
|
||||
WinBollActivity getPreActivity(WinBollActivity activity) {
|
||||
try {
|
||||
boolean bingo = false;
|
||||
IWinBollActivity preIWinBoll = null;
|
||||
for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
|
||||
if (entity.getKey().equals(iWinBoll.getTag())) {
|
||||
WinBollActivity preActivity = null;
|
||||
for (Map.Entry<String, WinBollActivity> entity : _mapActivityList.entrySet()) {
|
||||
if (entity.getKey().equals(activity.getTag())) {
|
||||
bingo = true;
|
||||
LogUtils.d(TAG, "bingo");
|
||||
break;
|
||||
}
|
||||
preIWinBoll = entity.getValue();
|
||||
preActivity = entity.getValue();
|
||||
}
|
||||
|
||||
if (bingo) {
|
||||
return preIWinBoll;
|
||||
return preActivity;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||
@@ -284,28 +271,36 @@ public class WinBollActivityManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
//
|
||||
// 从管理列表中移除管理项
|
||||
//
|
||||
public <T extends IWinBollActivity> boolean registeRemove(T activity) {
|
||||
IWinBollActivity iWinBollTest = _mapIWinBollList.get(activity.getTag());
|
||||
if (iWinBollTest != null) {
|
||||
_mapIWinBollList.remove(activity.getTag());
|
||||
public <T extends WinBollActivity> boolean registeRemove(T activity) {
|
||||
// for (int i = 0; i < _mWinBollActivityList.size(); i++) {
|
||||
// if (registeRemove(activity, i)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
WinBollActivity activityTest = _mapActivityList.get(activity.getTag());
|
||||
if (activityTest != null) {
|
||||
_mapActivityList.remove(activity.getTag());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// 打印管理列表项列表里的信息
|
||||
//
|
||||
public static void printIWinBollListInfo() {
|
||||
// public <T extends WinBollActivity> boolean registeRemove(T activity, int position) {
|
||||
// if (_mWinBollActivityList.get(position) == activity) {
|
||||
// _mWinBollActivityList.remove(position);
|
||||
// //ToastUtils.show(String.format("registeRemove remove.\nTag %s\nposition %d", activity.getTag(), position));
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
public static void printAvtivityListInfo() {
|
||||
//LogUtils.d(TAG, "printAvtivityListInfo");
|
||||
if (!_mapIWinBollList.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapIWinBollList.size()));
|
||||
Iterator<Map.Entry<String, IWinBollActivity>> iterator = _mapIWinBollList.entrySet().iterator();
|
||||
if (!_mapActivityList.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapActivityList.size()));
|
||||
Iterator<Map.Entry<String, WinBollActivity>> iterator = _mapActivityList.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, IWinBollActivity> entry = iterator.next();
|
||||
Map.Entry<String, WinBollActivity> entry = iterator.next();
|
||||
sb.append("\nKey: " + entry.getKey() + ", \nValue: " + entry.getValue().getTag());
|
||||
//ToastUtils.show("\nKey: " + entry.getKey() + ", Value: " + entry.getValue().getTag());
|
||||
}
|
||||
@@ -315,4 +310,6 @@ public class WinBollActivityManager {
|
||||
LogUtils.d(TAG, "The map is empty.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,76 @@
|
||||
package cc.winboll.studio.libapputils.app;
|
||||
|
||||
import cc.winboll.studio.libapputils.bean.DebugBean;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
|
||||
public class WinBollApplication extends cc.winboll.studio.libappbase.GlobalApplication {
|
||||
|
||||
public static final String TAG = "WinBollApplication";
|
||||
|
||||
public static enum WinBollUI_TYPE {
|
||||
Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
|
||||
Service // 退出应用后,清理所有最近任务栏任务记录窗口
|
||||
};
|
||||
|
||||
// 应用类型标志
|
||||
volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||
|
||||
static volatile WinBollApplication _WinBollApplication = null;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
|
||||
// 标记当前应用是否处于调试状态
|
||||
static volatile boolean isDebug = false;
|
||||
|
||||
public static void setIsDebug(boolean isDebug) {
|
||||
WinBollApplication.isDebug = isDebug;
|
||||
}
|
||||
|
||||
public static boolean isDebug() {
|
||||
return isDebug;
|
||||
}
|
||||
|
||||
//
|
||||
// 设置 WinBoll 应用 UI 类型
|
||||
//
|
||||
public static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
|
||||
_mWinBollUI_TYPE = mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
//
|
||||
// 获取 WinBoll 应用 UI 类型
|
||||
//
|
||||
public static WinBollUI_TYPE getWinBollUI_TYPE() {
|
||||
return _mWinBollUI_TYPE;
|
||||
}
|
||||
|
||||
MyActivityLifecycleCallbacks getMyActivityLifecycleCallbacks() {
|
||||
return mMyActivityLifecycleCallbacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
_WinBollApplication = this;
|
||||
// 应用环境初始化, 基本调试环境
|
||||
//
|
||||
CrashHandler.init(this);
|
||||
LogUtils.init(this);
|
||||
|
||||
DebugBean debugBean = DebugBean.loadBean(this, DebugBean.class);
|
||||
if (debugBean == null) {
|
||||
//ToastUtils.show("debugBean == null");
|
||||
setIsDebug(false);
|
||||
} else {
|
||||
//ToastUtils.show("saveDebugStatus(" + String.valueOf(debugBean.isDebuging()) + ")");
|
||||
setIsDebug(debugBean.isDebuging());
|
||||
}
|
||||
|
||||
// 应用运行状态环境设置
|
||||
//
|
||||
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(this);
|
||||
registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
// 设置默认 WinBoll 应用 UI 类型
|
||||
setWinBollUI_TYPE(WinBollUI_TYPE.Service);
|
||||
//ToastUtils.show("WinBollUI_TYPE " + getWinBollUI_TYPE());
|
||||
}
|
||||
}
|
@@ -1,141 +0,0 @@
|
||||
package cc.winboll.studio.libapputils.bean;
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2025/01/20 14:19:02
|
||||
* @Describe 应用信息类
|
||||
*/
|
||||
import cc.winboll.studio.libapputils.R;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class APPInfo implements Serializable {
|
||||
|
||||
public static final String TAG = "APPInfo";
|
||||
|
||||
// 应用名称
|
||||
String appName;
|
||||
// 应用图标
|
||||
int appIcon;
|
||||
// 应用描述
|
||||
String appDescription;
|
||||
// 应用Git仓库地址
|
||||
String appGitName;
|
||||
// 应用Git仓库拥有者
|
||||
String appGitOwner;
|
||||
// 应用Git仓库分支
|
||||
String appGitAPPBranch;
|
||||
// 应用Git仓库子项目文件夹
|
||||
String appGitAPPSubProjectFolder;
|
||||
// 应用主页
|
||||
String appHomePage;
|
||||
// 应用包名称
|
||||
String appAPKName;
|
||||
// 应用包存储文件夹名称
|
||||
String appAPKFolderName;
|
||||
|
||||
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitOwner, String appGitAPPBranch, String appGitAPPSubProjectFolder, String appHomePage, String appAPKName, String appAPKFolderName) {
|
||||
this.appName = appName;
|
||||
this.appIcon = appIcon;
|
||||
this.appDescription = appDescription;
|
||||
this.appGitName = appGitName;
|
||||
this.appGitOwner = appGitOwner;
|
||||
this.appGitAPPBranch = appGitAPPBranch;
|
||||
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
||||
this.appHomePage = appHomePage;
|
||||
this.appAPKName = appAPKName;
|
||||
this.appAPKFolderName = appAPKFolderName;
|
||||
}
|
||||
|
||||
public APPInfo() {
|
||||
this.appName = "WinBoll-APP";
|
||||
this.appIcon = R.drawable.ic_launcher;
|
||||
this.appDescription = "WinBoll APP";
|
||||
this.appGitName = "APP";
|
||||
this.appGitOwner = "Studio";
|
||||
this.appGitAPPBranch = "app";
|
||||
this.appGitAPPSubProjectFolder = "app";
|
||||
this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP";
|
||||
this.appAPKName = "APP";
|
||||
this.appAPKFolderName = "APP";
|
||||
}
|
||||
|
||||
public void setAppGitOwner(String appGitOwner) {
|
||||
this.appGitOwner = appGitOwner;
|
||||
}
|
||||
|
||||
public String getAppGitOwner() {
|
||||
return appGitOwner;
|
||||
}
|
||||
|
||||
public void setAppGitAPPBranch(String appGitAPPBranch) {
|
||||
this.appGitAPPBranch = appGitAPPBranch;
|
||||
}
|
||||
|
||||
public String getAppGitAPPBranch() {
|
||||
return appGitAPPBranch;
|
||||
}
|
||||
|
||||
public void setAppGitAPPSubProjectFolder(String appGitAPPSubProjectFolder) {
|
||||
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
||||
}
|
||||
|
||||
public String getAppGitAPPSubProjectFolder() {
|
||||
return appGitAPPSubProjectFolder;
|
||||
}
|
||||
|
||||
public void setAppIcon(int appIcon) {
|
||||
this.appIcon = appIcon;
|
||||
}
|
||||
|
||||
public int getAppIcon() {
|
||||
return appIcon;
|
||||
}
|
||||
|
||||
public void setAppDescription(String appDescription) {
|
||||
this.appDescription = appDescription;
|
||||
}
|
||||
|
||||
public String getAppDescription() {
|
||||
return appDescription;
|
||||
}
|
||||
|
||||
public void setAppAPKFolderName(String appAPKFolderName) {
|
||||
this.appAPKFolderName = appAPKFolderName;
|
||||
}
|
||||
|
||||
public String getAppAPKFolderName() {
|
||||
return appAPKFolderName;
|
||||
}
|
||||
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
|
||||
public void setAppGitName(String appGitName) {
|
||||
this.appGitName = appGitName;
|
||||
}
|
||||
|
||||
public String getAppGitName() {
|
||||
return appGitName;
|
||||
}
|
||||
|
||||
public void setAppHomePage(String appHomePage) {
|
||||
this.appHomePage = appHomePage;
|
||||
}
|
||||
|
||||
public String getAppHomePage() {
|
||||
return appHomePage;
|
||||
}
|
||||
|
||||
public void setAppAPKName(String appAPKName) {
|
||||
this.appAPKName = appAPKName;
|
||||
}
|
||||
|
||||
public String getAppAPKName() {
|
||||
return appAPKName;
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ package cc.winboll.studio.libapputils.bean;
|
||||
import android.content.Context;
|
||||
import android.util.JsonReader;
|
||||
import android.util.JsonWriter;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import cc.winboll.studio.libapputils.util.FileUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cc.winboll.studio.libapputils.git;
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user