Compare commits
36 Commits
aes-v15.0.
...
mymessagem
Author | SHA1 | Date | |
---|---|---|---|
![]() |
46e4ee7fb7 | ||
![]() |
b2b959232c | ||
![]() |
b11f814c41 | ||
![]() |
56a13b4a40 | ||
![]() |
8bdd42ce68 | ||
![]() |
d4986c6ba4 | ||
![]() |
529f420668 | ||
![]() |
b3439aa36a | ||
![]() |
7488fa7af2 | ||
![]() |
d4e4541bfd | ||
![]() |
ac627e53b1 | ||
![]() |
42a2e6d559 | ||
![]() |
0d44734c0b | ||
![]() |
e89873046b | ||
![]() |
f3ef7226d8 | ||
![]() |
1e991aed7e | ||
![]() |
f56125f82a | ||
![]() |
9706a39f41 | ||
![]() |
e85cbd803e | ||
![]() |
00a9ec1d66 | ||
![]() |
64051bb9fe | ||
![]() |
dd7600d617 | ||
![]() |
75c2f6304c | ||
![]() |
ec6926f629 | ||
![]() |
3fe1ea7ff2 | ||
![]() |
33b7b65239 | ||
![]() |
664d14ad84 | ||
![]() |
47cb393f76 | ||
![]() |
6495f1c66e | ||
![]() |
f0c52d1e02 | ||
![]() |
d948f31331 | ||
![]() |
e1b3087020 | ||
![]() |
03e21ab81c | ||
![]() |
ac72132969 | ||
![]() |
cedb5f521b | ||
![]() |
396df6713c |
@@ -19,17 +19,17 @@ def genVersionName(def versionName){
|
||||
|
||||
android {
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
buildToolsVersion "33.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "cc.winboll.studio.aes"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
// versionName 更新后需要手动设置
|
||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "15.0"
|
||||
versionName "7.6"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@@ -41,9 +41,29 @@ 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
|
||||
#Mon Mar 24 06:25:20 GMT 2025
|
||||
stageCount=0
|
||||
#Sun Jan 19 04:58:59 GMT 2025
|
||||
stageCount=3
|
||||
libraryProject=libaes
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=7
|
||||
baseBetaVersion=15.0.1
|
||||
baseVersion=7.6
|
||||
publishVersion=7.6.2
|
||||
buildCount=4
|
||||
baseBetaVersion=7.6.3
|
||||
|
@@ -8,7 +8,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MyAESTheme"
|
||||
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true">
|
||||
|
||||
|
@@ -5,219 +5,12 @@ package cc.winboll.studio.aes;
|
||||
* @Date 2024/06/13 19:05:52
|
||||
* @Describe 应用主窗口
|
||||
*/
|
||||
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;
|
||||
import cc.winboll.studio.libaes.unittests.LibraryActivity;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#FF00B322</color>
|
||||
<color name="colorPrimaryDark">#FF005C12</color>
|
||||
<color name="colorAccent">#FF8DFFA2</color>
|
||||
<color name="colorText">#FFFFFB8D</color>
|
||||
</resources>
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="MyAESTheme" parent="AESTheme">
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
</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.androiddemo"
|
||||
@@ -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,21 +47,25 @@ dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
// 吐司类库
|
||||
implementation 'com.github.getActivity:ToastUtils:10.5'
|
||||
api 'com.github.getActivity:ToastUtils:10.5'
|
||||
|
||||
// Android 类库
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||
implementation 'com.android.support:support-v4:28.0.0'
|
||||
api 'com.android.support:appcompat-v7:28.0.0' // 包含 AppCompatActivity
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||
implementation 'com.android.support:support-compat:28.0.0'
|
||||
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||
api 'com.android.support:support-v4:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
||||
implementation 'com.android.support:support-media-compat:28.0.0'
|
||||
api 'com.android.support:support-media-compat:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
||||
implementation 'com.android.support:support-core-utils:28.0.0'
|
||||
api 'com.android.support:support-core-utils:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
||||
implementation 'com.android.support:support-core-ui:28.0.0'
|
||||
api 'com.android.support:support-core-ui:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
||||
implementation 'com.android.support:support-fragment:28.0.0'
|
||||
api 'com.android.support:support-fragment:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
||||
implementation 'com.android.support:recyclerview-v7:28.0.0'
|
||||
api 'com.android.support:recyclerview-v7:28.0.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:02:14 GMT 2025
|
||||
#Wed Mar 26 07:23:51 GMT 2025
|
||||
stageCount=0
|
||||
libraryProject=
|
||||
baseVersion=1.0
|
||||
publishVersion=1.0.0
|
||||
buildCount=1
|
||||
baseBetaVersion=1.0.1
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=11
|
||||
baseBetaVersion=15.0.1
|
||||
|
@@ -11,7 +11,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:resizeableActivity="true"
|
||||
android:name=".GlobalApplication">
|
||||
android:name=".App">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package cc.winboll.studio.androiddemo;
|
||||
|
||||
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();
|
||||
}
|
@@ -2,14 +2,24 @@ package cc.winboll.studio.androiddemo;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
mLogView = findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
}
|
||||
}
|
@@ -4,7 +4,13 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical|center_horizontal">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -12,5 +18,20 @@
|
||||
android:text="Android Demo"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0">
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Text"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -18,6 +18,7 @@ def genVersionName(def versionName){
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
@@ -29,7 +30,7 @@ android {
|
||||
// versionName 更新后需要手动设置
|
||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "15.0"
|
||||
versionName "15.1"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon Mar 24 14:06:25 HKT 2025
|
||||
stageCount=10
|
||||
#Wed Mar 26 15:43:21 HKT 2025
|
||||
stageCount=1
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.9
|
||||
baseVersion=15.1
|
||||
publishVersion=15.1.0
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.10
|
||||
baseBetaVersion=15.1.1
|
||||
|
@@ -13,6 +13,9 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:resizeableActivity="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:taskAffinity="cc.winboll.studio.appbase.task.main"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
@@ -33,6 +36,7 @@
|
||||
|
||||
<service
|
||||
android:name=".MyTileService"
|
||||
android:exported="true"
|
||||
android:label="@string/tileservice_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
@@ -49,15 +53,18 @@
|
||||
android:name=".services.MainService"
|
||||
android:exported="true"/>
|
||||
|
||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||
<service
|
||||
android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||
android:exported="true"/>
|
||||
|
||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
||||
<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">
|
||||
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
@@ -87,7 +94,8 @@
|
||||
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".receivers.APPNewsWidgetClickListener">
|
||||
<receiver android:name=".receivers.APPNewsWidgetClickListener"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
@@ -103,6 +111,10 @@
|
||||
android:name="android.max_aspect"
|
||||
android:value="4.0"/>
|
||||
|
||||
<activity android:name=".activities.NewActivity"/>
|
||||
|
||||
<activity android:name=".activities.New2Activity"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
@@ -19,7 +19,6 @@ public class App extends GlobalApplication {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
|
||||
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction(SOS.ACTION_SOS);
|
||||
|
@@ -1,28 +1,47 @@
|
||||
package cc.winboll.studio.appbase;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.appbase.activities.NewActivity;
|
||||
import cc.winboll.studio.appbase.services.MainService;
|
||||
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
||||
import cc.winboll.studio.appbase.services.TestDemoService;
|
||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.sos.SOS;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.LogActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
public class MainActivity extends AppCompatActivity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "MainActivity";
|
||||
|
||||
LogView mLogView;
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
Toolbar mToolbar;
|
||||
//LogView mLogView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -30,19 +49,37 @@ public class MainActivity extends Activity {
|
||||
ToastUtils.show("onCreate");
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
||||
setActionBar(toolbar);
|
||||
mToolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(mToolbar);
|
||||
|
||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||
mLogView = findViewById(R.id.activitymainLogView1);
|
||||
//mLogView = findViewById(R.id.activitymainLogView1);
|
||||
|
||||
if (GlobalApplication.isDebuging()) {
|
||||
mLogView.start();
|
||||
ToastUtils.show("LogView start.");
|
||||
// if (GlobalApplication.isDebuging()) {
|
||||
// mLogView.start();
|
||||
// ToastUtils.show("LogView start.");
|
||||
// }
|
||||
}
|
||||
|
||||
@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() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||
onLogActivity();
|
||||
return true;
|
||||
}
|
||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -51,15 +88,9 @@ public class MainActivity extends Activity {
|
||||
sendBroadcast(intentAPPWidget);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
LogUtils.d(TAG, "onResume");
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
}
|
||||
|
||||
public void onSwitchDebugMode(View view) {
|
||||
GlobalApplication.setIsDebuging(this, ((CheckBox)view).isChecked());
|
||||
boolean isDebuging = ((CheckBox)view).isChecked();
|
||||
GlobalApplication.setIsDebuging(isDebuging);
|
||||
}
|
||||
|
||||
public void onStartCenter(View view) {
|
||||
@@ -140,4 +171,28 @@ public class MainActivity extends Activity {
|
||||
Intent intent = new Intent(this, TestDemoBindService.class);
|
||||
stopService(intent);
|
||||
}
|
||||
|
||||
public void onTestOpenNewActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, NewActivity.class);
|
||||
}
|
||||
|
||||
public void onLogActivity() {
|
||||
|
||||
|
||||
Intent intent = new Intent(MainActivity.this, LogActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
// Define the bounds.
|
||||
Rect bounds = new Rect(500, 300, 100, 0);
|
||||
|
||||
// Set the bounds as an activity option.
|
||||
|
||||
ActivityOptions options = ActivityOptions.makeBasic();
|
||||
|
||||
options.setLaunchBounds(bounds);
|
||||
|
||||
//Intent intent = new Intent(this, LpgActivity.class);
|
||||
|
||||
startActivity(intent, options.toBundle());
|
||||
//WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, LogActivity.class);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,58 @@
|
||||
package cc.winboll.studio.appbase.activities;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/25 11:46:40
|
||||
* @Describe 测试窗口2
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
|
||||
public class New2Activity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "New2Activity";
|
||||
|
||||
//LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_new2);
|
||||
|
||||
// mLogView = findViewById(R.id.logview);
|
||||
// mLogView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//mLogView.start();
|
||||
}
|
||||
|
||||
public void onCloseThisActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
|
||||
public void onCloseAllActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finishAll();
|
||||
}
|
||||
|
||||
public void onNewActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, NewActivity.class);
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package cc.winboll.studio.appbase.activities;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/25 05:04:22
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
|
||||
public class NewActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "NewActivity";
|
||||
|
||||
//LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_new);
|
||||
// mLogView = findViewById(R.id.logview);
|
||||
// mLogView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//mLogView.start();
|
||||
}
|
||||
|
||||
public void onCloseThisActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
|
||||
public void onCloseAllActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finishAll();
|
||||
}
|
||||
|
||||
public void onNew2Activity(View view) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, New2Activity.class);
|
||||
}
|
||||
}
|
@@ -5,10 +5,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/activitymainToolbar1"/>
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
@@ -182,6 +182,13 @@
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onTestDemoServiceSOS"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TestOpenNewActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onTestOpenNewActivity"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -192,10 +199,5 @@
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_height="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/activitymainLogView1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
43
appbase/src/main/res/layout/activity_new.xml
Normal file
43
appbase/src/main/res/layout/activity_new.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="NewActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseThisActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseThisActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseAllActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseAllActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New2Activity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onNew2Activity"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
50
appbase/src/main/res/layout/activity_new2.xml
Normal file
50
appbase/src/main/res/layout/activity_new2.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New2Activity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseThisActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseThisActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseAllActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseAllActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseAllActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseAllActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="NewActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onNewActivity"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
9
appbase/src/main/res/menu/toolbar_main.xml
Normal file
9
appbase/src/main/res/menu/toolbar_main.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/item_log"
|
||||
android:title="Log"/>
|
||||
|
||||
</menu>
|
@@ -18,7 +18,7 @@ buildscript {
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.1'
|
||||
classpath 'com.android.tools.build:gradle:7.2.1' // 对应 compileSdkVersion 32
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
|
@@ -4,12 +4,14 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
android {
|
||||
namespace 'cc.winboll.studio.libaes'
|
||||
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
buildToolsVersion "33.0.3"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@@ -17,39 +19,30 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
//api 'cc.winboll.studio:winboll-shared:1.6.5'
|
||||
|
||||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
||||
api 'com.github.getActivity:XXPermissions:18.63'
|
||||
// 下拉控件
|
||||
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
||||
// 拼音搜索
|
||||
// https://mvnrepository.com/artifact/com.github.open-android/pinyin4j
|
||||
api 'com.github.open-android:pinyin4j:2.5.0'
|
||||
// SSH
|
||||
api 'com.jcraft:jsch:0.1.55'
|
||||
// Html 解析
|
||||
api 'org.jsoup:jsoup:1.13.1'
|
||||
// 二维码类库
|
||||
api 'com.google.zxing:core:3.4.1'
|
||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
||||
// 应用介绍页类库
|
||||
api 'io.github.medyo:android-about-page:2.0.0'
|
||||
// 吐司类库
|
||||
api 'com.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'
|
||||
// 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'
|
||||
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'])
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon Mar 24 06:25:20 GMT 2025
|
||||
stageCount=0
|
||||
#Sun Jan 19 04:58:59 GMT 2025
|
||||
stageCount=3
|
||||
libraryProject=libaes
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=7
|
||||
baseBetaVersion=15.0.1
|
||||
baseVersion=7.6
|
||||
publishVersion=7.6.2
|
||||
buildCount=4
|
||||
baseBetaVersion=7.6.3
|
||||
|
@@ -16,6 +16,7 @@ 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;
|
||||
@@ -26,20 +27,18 @@ 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.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.log.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 IWinBollActivity,AdapterView.OnItemClickListener {
|
||||
public abstract class DrawerFragmentActivity extends AppCompatActivity implements 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;
|
||||
@@ -59,7 +58,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
//mContext = this;
|
||||
mContext = this;
|
||||
mThemeType = getThemeType();
|
||||
setThemeStyle();
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -73,7 +72,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
// TODO: Implement this method
|
||||
return super.getIntent();
|
||||
@@ -81,7 +80,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
public Context getContext() {
|
||||
return this.mContext;
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public MenuInflater getMenuInflater() {
|
||||
@@ -89,20 +88,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) {
|
||||
@@ -114,7 +113,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@Override
|
||||
public FragmentManager getSupportFragmentManager() {
|
||||
return super.getSupportFragmentManager();
|
||||
}
|
||||
@@ -132,7 +131,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) {
|
||||
@@ -152,7 +151,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
||||
|
||||
void setThemeStyle() {
|
||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
||||
setTheme(AESThemeUtil.getThemeTypeID(this));
|
||||
}
|
||||
|
||||
boolean checkThemeStyleChange() {
|
||||
@@ -164,7 +163,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(getApplicationContext()));
|
||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(this));
|
||||
}
|
||||
|
||||
@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.libappbase.BaseBean;
|
||||
import cc.winboll.studio.libapputils.bean.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 {
|
||||
AES("默认主题"),
|
||||
DEFAULT("默认主题"),
|
||||
DEPTH("深奥主题"),
|
||||
SKY("天空主题"),
|
||||
GOLDEN("辉煌主题"),
|
||||
@@ -42,7 +42,7 @@ public class AESThemeBean extends BaseBean {
|
||||
}
|
||||
|
||||
// 保存当前主题
|
||||
int currentThemeStyleID = getThemeStyleID(ThemeType.AES);
|
||||
int currentThemeStyleID = getThemeStyleID(ThemeType.DEFAULT);
|
||||
|
||||
public AESThemeBean() {
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class AESThemeBean extends BaseBean {
|
||||
}
|
||||
|
||||
public static int getThemeStyleID(ThemeType themeType) {
|
||||
int themeStyleID = R.style.AESTheme;
|
||||
int themeStyleID = R.style.DefaultAESTheme;
|
||||
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.AES == themeType) {
|
||||
themeStyleID = R.style.AESTheme;
|
||||
} else if (AESThemeBean.ThemeType.DEFAULT == themeType) {
|
||||
themeStyleID = R.style.DefaultAESTheme;
|
||||
}
|
||||
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
|
||||
return themeStyleID;
|
||||
}
|
||||
|
||||
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
|
||||
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.AES;
|
||||
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||
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.AESTheme == nThemeStyleID) {
|
||||
themeStyle = AESThemeBean.ThemeType.AES;
|
||||
} else if (R.style.DefaultAESTheme == nThemeStyleID) {
|
||||
themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||
}
|
||||
//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.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.Collator;
|
||||
|
@@ -0,0 +1,170 @@
|
||||
package cc.winboll.studio.libaes.unittests;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@QQ.COM
|
||||
* @Date 2024/06/14 03:43:23
|
||||
* @Describe AES类库主窗口
|
||||
*/
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Toast;
|
||||
import cc.winboll.studio.libaes.R;
|
||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
|
||||
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class LibraryActivity extends DrawerFragmentActivity {
|
||||
|
||||
public static final String TAG = "LibraryActivity";
|
||||
|
||||
TestAButtonFragment mTestAButtonFragment;
|
||||
TestViewPageFragment mTestViewPageFragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (mTestAButtonFragment == null) {
|
||||
mTestAButtonFragment = new TestAButtonFragment();
|
||||
addFragment(mTestAButtonFragment);
|
||||
}
|
||||
showFragment(mTestAButtonFragment);
|
||||
setSubtitle(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||
super.initDrawerMenuItemList(listDrawerMenu);
|
||||
LogUtils.d(TAG, "initDrawerMenuItemList");
|
||||
//listDrawerMenu.clear();
|
||||
// 添加抽屉菜单项
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||
notifyDrawerMenuDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||
super.reinitDrawerMenuItemList(listDrawerMenu);
|
||||
LogUtils.d(TAG, "reinitDrawerMenuItemList");
|
||||
//listDrawerMenu.clear();
|
||||
// 添加抽屉菜单项
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||
notifyDrawerMenuDataChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DrawerFragmentActivity.ActivityType initActivityType() {
|
||||
return DrawerFragmentActivity.ActivityType.Main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_library, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
super.onItemClick(parent, view, position, id);
|
||||
switch (position) {
|
||||
case 0 : {
|
||||
if (mTestAButtonFragment == null) {
|
||||
mTestAButtonFragment = new TestAButtonFragment();
|
||||
addFragment(mTestAButtonFragment);
|
||||
}
|
||||
showFragment(mTestAButtonFragment);
|
||||
break;
|
||||
}
|
||||
case 1 : {
|
||||
if (mTestViewPageFragment == null) {
|
||||
mTestViewPageFragment = new TestViewPageFragment();
|
||||
addFragment(mTestViewPageFragment);
|
||||
}
|
||||
showFragment(mTestViewPageFragment);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
// if (item.getItemId() == R.id.item_log) {
|
||||
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
|
||||
// } else
|
||||
if (nItemId == R.id.item_atoast) {
|
||||
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
|
||||
} else if (nItemId == R.id.item_atoolbar) {
|
||||
Intent intent = new Intent(this, TestAToolbarActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
} else if (nItemId == R.id.item_asupporttoolbar) {
|
||||
Intent intent = new Intent(this, TestASupportToolbarActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
} else if (nItemId == R.id.item_colordialog) {
|
||||
ColorPickerDialog dlg = new ColorPickerDialog(this, getResources().getColor(R.color.colorPrimary));
|
||||
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
|
||||
|
||||
@Override
|
||||
public void beforeColorChanged() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColorChanged(int color) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterColorChanged() {
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
dlg.show();
|
||||
|
||||
} else if (nItemId == R.id.item_dialogstoragepath) {
|
||||
final StoragePathDialog dialog = new StoragePathDialog(this, 0);
|
||||
dialog.setOnOKClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
|
||||
} else if (nItemId == R.id.item_localfileselectdialog) {
|
||||
final LocalFileSelectDialog dialog = new LocalFileSelectDialog(this);
|
||||
dialog.setOnOKClickListener(new LocalFileSelectDialog.OKClickListener() {
|
||||
@Override
|
||||
public void onOKClick(String sz) {
|
||||
Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
|
||||
//dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
|
||||
} else if (nItemId == R.id.item_secondarylibraryactivity) {
|
||||
Intent intent = new Intent(this, SecondaryLibraryActivity.class);
|
||||
startActivity(intent);
|
||||
} else if (nItemId == R.id.item_drawerfragmentactivity) {
|
||||
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
// else if (nItemId == R.id.item_about) {
|
||||
// Intent intent = new Intent(this, AboutActivity.class);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
@@ -6,47 +6,18 @@ 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 implements IWinBollActivity {
|
||||
public class SecondaryLibraryActivity extends DrawerFragmentActivity {
|
||||
|
||||
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);
|
||||
@@ -72,7 +43,7 @@ public class SecondaryLibraryActivity extends DrawerFragmentActivity implements
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int nItemId = item.getItemId();
|
||||
if (nItemId == R.id.item_test) {
|
||||
Toast.makeText(getApplicationContext(), "item_test", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getApplication(), "item_test", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
@@ -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.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
|
||||
public class TestAButtonFragment extends Fragment {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TestAButtonFragment extends Fragment {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
LogUtils.d(TAG, "onClick");
|
||||
ToastUtils.show("AButton");
|
||||
Toast.makeText(getActivity(), "AButton", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
});
|
||||
|
@@ -4,57 +4,26 @@ 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.libaes.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||
import java.util.ArrayList;
|
||||
|
||||
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 class TestDrawerFragmentActivity extends DrawerFragmentActivity {
|
||||
|
||||
public static final String TAG = "TestDrawerFragmentActivity";
|
||||
|
||||
TestFragment1 mTestFragment1;
|
||||
TestFragment2 mTestFragment2;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -97,7 +66,7 @@ public class TestDrawerFragmentActivity extends DrawerFragmentActivity implement
|
||||
super.onItemClick(parent, view, position, id);
|
||||
switch (position) {
|
||||
case 0 : {
|
||||
Toast.makeText(getApplicationContext(), "0", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getContext(), "0", Toast.LENGTH_SHORT).show();
|
||||
//LogUtils.d(TAG, "MenuItem 1");
|
||||
showFragment(mTestFragment1);
|
||||
break;
|
||||
|
@@ -5,7 +5,6 @@ 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;
|
||||
@@ -18,8 +17,6 @@ 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;
|
||||
|
||||
@@ -27,9 +24,6 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
||||
|
||||
public static final String TAG = "TestViewPageFragment";
|
||||
|
||||
Context mContext;
|
||||
LogView mLogView;
|
||||
|
||||
private ViewPager viewPager;
|
||||
private List<View> views; //用来存放放进ViewPager里面的布局
|
||||
//实例化存储imageView(导航原点)的集合
|
||||
@@ -42,10 +36,6 @@ 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();
|
||||
@@ -70,13 +60,12 @@ 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(mContext);
|
||||
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||
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);
|
||||
@@ -196,31 +185,14 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
||||
}
|
||||
|
||||
void initAOHPCTCSeekBar() {
|
||||
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);
|
||||
AOHPCTCSeekBar seekbar = mView.findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
||||
seekbar.setThumb(getActivity().getDrawable(R.drawable.ic_launcher));
|
||||
seekbar.setThumbOffset(10);
|
||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||
|
||||
@Override
|
||||
public void onOHPCommit() {
|
||||
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");
|
||||
Toast.makeText(getActivity(), "onOHPCommit ", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -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.AES): bean.getCurrentThemeTypeID();
|
||||
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT): 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.AES);
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||
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.AES);
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||
saveThemeStyleID(activity, nThemeStyleID);
|
||||
return true;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class AESThemeUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static <T extends AppCompatActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||
public static <T extends WinBollActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||
int nThemeStyleID;
|
||||
if (R.id.item_depththeme == item.getItemId()) {
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
||||
@@ -154,38 +154,7 @@ public class AESThemeUtil {
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||
return true;
|
||||
}
|
||||
|
@@ -6,30 +6,24 @@ 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";
|
||||
|
||||
volatile int thumbWidth = 1;
|
||||
volatile int progressBarWidth = 1;
|
||||
// 设置按钮模糊右边边缘像素
|
||||
volatile int blurRightDP = 1;
|
||||
// 是否从起点拉动的标志
|
||||
volatile boolean isStartSeek = false;
|
||||
|
||||
// 可开始拉动的起始位置(百分比值)
|
||||
static final int ENABLE_POST_PERCENT_X = 20;
|
||||
// 最小拉动值,滑块拉动值要超过这个值,确定事件才会提交。
|
||||
static final int TO_MIN_VALUE = 15;
|
||||
// 外部接口对象,确定事件提交会调用该对象的方法
|
||||
OnOHPCListener mOnOHPCListener;
|
||||
|
||||
|
||||
public void setBlurRightDP(int blurRight) {
|
||||
this.blurRightDP = blurRight;
|
||||
}
|
||||
// 是否从起点拉动的标志
|
||||
boolean mIsStartTo = false;
|
||||
// 拉动的滑动值
|
||||
int mnTo = 0;
|
||||
|
||||
public void setOnOHPCListener(OnOHPCListener listener) {
|
||||
mOnOHPCListener = listener;
|
||||
@@ -41,68 +35,83 @@ public class AOHPCTCSeekBar extends SeekBar {
|
||||
|
||||
public AOHPCTCSeekBar(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public AOHPCTCSeekBar(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
|
||||
//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();
|
||||
}
|
||||
|
||||
public AOHPCTCSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
void initView(Context context) {
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
if (thumbWidth + blurRightDP > event.getX() && event.getX() > 0) {
|
||||
getParent().requestDisallowInterceptTouchEvent(true);
|
||||
isStartSeek = true;
|
||||
//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;
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
if (isStartSeek) {
|
||||
super.dispatchTouchEvent(event);
|
||||
//LogUtils.d(TAG, "ACTION_MOVE");
|
||||
if (mIsStartTo) {
|
||||
mnTo++;
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP
|
||||
|| event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
getParent().requestDisallowInterceptTouchEvent(false);
|
||||
if (getProgress() == progressBarWidth) {
|
||||
} 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));
|
||||
mOnOHPCListener.onOHPCommit();
|
||||
//resetView();
|
||||
//return true;
|
||||
}
|
||||
resetView();
|
||||
return false;
|
||||
}
|
||||
//LogUtils.d(TAG, "dispatchTouchEvent End");
|
||||
return super.dispatchTouchEvent(event);
|
||||
}
|
||||
|
||||
// 重置控件状态
|
||||
//
|
||||
void resetView() {
|
||||
setProgress(0);
|
||||
isStartSeek = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@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);
|
||||
mnTo = 0;
|
||||
mIsStartTo = false;
|
||||
}
|
||||
}
|
||||
|
@@ -1,23 +0,0 @@
|
||||
package cc.winboll.studio.libaes.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/24 08:23:40
|
||||
* @Describe WinBoll 活动窗口通用接口
|
||||
*/
|
||||
import android.content.Context;
|
||||
import android.widget.Toolbar;
|
||||
import cc.winboll.studio.libapputils.bean.APPInfo;
|
||||
|
||||
public interface IWinBollActivity {
|
||||
|
||||
public static final String TAG = "IWinBollActivity";
|
||||
|
||||
// 获取应用资源上下文
|
||||
abstract public Context getApplicationContext();
|
||||
abstract public APPInfo getAppInfo();
|
||||
abstract public String getTag();
|
||||
abstract public Toolbar initToolBar();
|
||||
abstract public boolean isEnableDisplayHomeAsUp();
|
||||
abstract public boolean isAddWinBollToolBar();
|
||||
}
|
@@ -1,318 +0,0 @@
|
||||
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.");
|
||||
// }
|
||||
// }
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#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>
|
14
libaes/src/main/res/layout/activity_library.xml
Normal file
14
libaes/src/main/res/layout/activity_library.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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>
|
||||
|
@@ -12,6 +12,11 @@
|
||||
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"
|
||||
@@ -51,10 +56,5 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -11,25 +11,6 @@
|
||||
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,13 +32,6 @@
|
||||
<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,11 +1,9 @@
|
||||
<?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="colorText">#FFFFFB8D</color>
|
||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||
<color name="colorToastShadow">#FF000000</color>
|
||||
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||
|
@@ -1,70 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AESTheme" 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/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="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>
|
||||
</style>
|
||||
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<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>
|
||||
</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>
|
||||
@@ -86,9 +23,35 @@
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>-->
|
||||
</style>
|
||||
|
||||
<!--<style name="DepthAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
|
||||
<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">
|
||||
<item name="colorTextColor">#FF000000</item>
|
||||
<item name="colorPrimary">#FF2566FE</item>
|
||||
<item name="colorPrimaryDark">#FF1359FF</item>
|
||||
@@ -206,7 +169,7 @@
|
||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||
</style>-->
|
||||
</style>
|
||||
|
||||
<!--<style name="AToolbar">
|
||||
<item name="attrAToolbarTitleTextColor">#FF2DDA27</item>
|
||||
|
@@ -4,6 +4,7 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||
|
||||
android {
|
||||
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
@@ -22,31 +23,20 @@ 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'
|
||||
api 'com.android.support:appcompat-v7:28.0.0' // 包含 AppCompatActivity
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||
api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||
api 'com.android.support:support-v4:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-media-compat
|
||||
api 'com.android.support:support-media-compat:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-core-utils
|
||||
api 'com.android.support:support-core-utils:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-core-ui
|
||||
api 'com.android.support:support-core-ui:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/support-fragment
|
||||
api 'com.android.support:support-fragment:28.0.0'
|
||||
// https://mvnrepository.com/artifact/com.android.support/recyclerview-v7
|
||||
api 'com.android.support:recyclerview-v7:28.0.0'
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon Mar 24 14:06:10 HKT 2025
|
||||
stageCount=10
|
||||
#Wed Mar 26 15:43:05 HKT 2025
|
||||
stageCount=1
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.9
|
||||
baseVersion=15.1
|
||||
publishVersion=15.1.0
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.10
|
||||
baseBetaVersion=15.1.1
|
||||
|
@@ -21,7 +21,15 @@
|
||||
android:label="GlobalCrashActivity"
|
||||
android:launchMode="standard"/>
|
||||
|
||||
<activity android:name=".LogActivity"/>
|
||||
<activity
|
||||
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
|
||||
android:name="cc.winboll.studio.libappbase.winboll.LogActivity"
|
||||
android:resizeableActivity="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:taskAffinity="cc.winboll.studio.libappbase.task.log"
|
||||
android:exported="true">
|
||||
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".SimpleOperateSignalCenterService"
|
||||
@@ -33,7 +41,8 @@
|
||||
android:name=".services.TestService"
|
||||
android:exported="true"/>
|
||||
|
||||
<receiver android:name=".receiver.MyBroadcastReceiver">
|
||||
<receiver android:name=".receiver.MyBroadcastReceiver"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
@@ -75,7 +84,8 @@
|
||||
|
||||
<service android:name="cc.winboll.studio.libappbase.sos.SOSCenter"/>
|
||||
|
||||
<receiver android:name="cc.winboll.studio.libappbase.sos.SOSCenterServiceReceiver">
|
||||
<receiver android:name="cc.winboll.studio.libappbase.sos.SOSCenterServiceReceiver"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
|
@@ -0,0 +1,73 @@
|
||||
package cc.winboll.studio.libappbase;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/25 02:52:46
|
||||
* @Describe 基础应用数据模型
|
||||
*/
|
||||
import android.util.JsonReader;
|
||||
import android.util.JsonWriter;
|
||||
import cc.winboll.studio.libappbase.BaseBean;
|
||||
import java.io.IOException;
|
||||
|
||||
public class APPBaseModel extends BaseBean {
|
||||
|
||||
public static final String TAG = "APPBaseModel";
|
||||
|
||||
// 应用是否处于正在调试状态
|
||||
//
|
||||
boolean isDebuging = false;
|
||||
|
||||
public APPBaseModel() {
|
||||
this.isDebuging = false;
|
||||
}
|
||||
|
||||
public APPBaseModel(boolean isDebuging) {
|
||||
this.isDebuging = isDebuging;
|
||||
}
|
||||
|
||||
public void setIsDebuging(boolean isDebuging) {
|
||||
this.isDebuging = isDebuging;
|
||||
}
|
||||
|
||||
public boolean isDebuging() {
|
||||
return isDebuging;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return APPBaseModel.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
|
||||
super.writeThisToJsonWriter(jsonWriter);
|
||||
jsonWriter.name("isDebuging").value(isDebuging());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
||||
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
||||
if (name.equals("isDebuging")) {
|
||||
setIsDebuging(jsonReader.nextBoolean());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
|
||||
jsonReader.beginObject();
|
||||
while (jsonReader.hasNext()) {
|
||||
String name = jsonReader.nextName();
|
||||
if (!initObjectsFromJsonReader(jsonReader, name)) {
|
||||
jsonReader.skipValue();
|
||||
}
|
||||
}
|
||||
// 结束 JSON 对象
|
||||
jsonReader.endObject();
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -7,12 +7,13 @@ package cc.winboll.studio.libappbase;
|
||||
*/
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
import cc.winboll.studio.libappbase.winboll.MyActivityLifecycleCallbacks;
|
||||
|
||||
public class GlobalApplication extends Application {
|
||||
|
||||
@@ -21,22 +22,31 @@ public class GlobalApplication extends Application {
|
||||
final static String PREFS = GlobalApplication.class.getName() + "PREFS";
|
||||
final static String PREFS_ISDEBUGING = "PREFS_ISDEBUGING";
|
||||
|
||||
|
||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||
|
||||
volatile static GlobalApplication _GlobalApplication;
|
||||
// 是否处于调试状态
|
||||
volatile static boolean isDebuging = false;
|
||||
WinBollActivityManager mWinBollActivityManager;
|
||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||
|
||||
public static void setIsDebuging(Context context, boolean isDebuging) {
|
||||
public static void setIsDebuging(boolean isDebuging) {
|
||||
if (_GlobalApplication != null) {
|
||||
GlobalApplication.isDebuging = isDebuging;
|
||||
APPBaseModel.saveBeanToFile(getAPPBaseModelFilePath(), new APPBaseModel(isDebuging));
|
||||
// 获取SharedPreferences实例
|
||||
SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
||||
// 获取编辑器
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
// 保存数据
|
||||
editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
||||
// 提交更改
|
||||
editor.apply();
|
||||
// SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
||||
// // 获取编辑器
|
||||
// SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
// // 保存数据
|
||||
// editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
||||
// // 提交更改
|
||||
// editor.apply();
|
||||
}
|
||||
}
|
||||
|
||||
static String getAPPBaseModelFilePath() {
|
||||
return _GlobalApplication.getDataDir().getPath() + "/APPBaseModel.json";
|
||||
}
|
||||
|
||||
public static boolean isDebuging() {
|
||||
@@ -55,8 +65,16 @@ public class GlobalApplication extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//GlobalApplication.isDebuging = true;
|
||||
//GlobalApplication.setIsDebuging(this, true);
|
||||
_GlobalApplication = this;
|
||||
|
||||
// 设置应用调试标志
|
||||
APPBaseModel appBaseModel = APPBaseModel.loadBeanFromFile(getAPPBaseModelFilePath(), APPBaseModel.class);
|
||||
if (appBaseModel == null) {
|
||||
setIsDebuging(false);
|
||||
} else {
|
||||
setIsDebuging(appBaseModel.isDebuging());
|
||||
}
|
||||
|
||||
LogUtils.init(this);
|
||||
//LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
|
||||
//LogUtils.setTAGListEnable(GlobalApplication.TAG, true);
|
||||
@@ -66,16 +84,22 @@ public class GlobalApplication extends Application {
|
||||
// 设置应用异常处理窗口
|
||||
CrashHandler.init(this);
|
||||
|
||||
// 设置应用调试状态
|
||||
//SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
||||
//GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
||||
|
||||
// 初始化 Toast 框架
|
||||
ToastUtils.init(this);
|
||||
// 设置 Toast 布局样式
|
||||
//ToastUtils.setView(R.layout.toast_custom_view);
|
||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
||||
//ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
||||
|
||||
// mWinBollActivityManager = WinBollActivityManager.getInstance(this);
|
||||
// mWinBollActivityManager.setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||
// // 注册回调
|
||||
// mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(mWinBollActivityManager);
|
||||
// registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
super.onTerminate();
|
||||
// 注销回调(非必须,但建议释放资源)
|
||||
unregisterActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
}
|
||||
|
||||
public static String getAppName(Context context) {
|
||||
|
@@ -0,0 +1,18 @@
|
||||
package cc.winboll.studio.libappbase.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/24 08:23:40
|
||||
* @Describe WinBoll 活动窗口通用接口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.widget.Toolbar;
|
||||
|
||||
public interface IWinBollActivity {
|
||||
|
||||
public static final String TAG = "IWinBollActivity";
|
||||
|
||||
// 获取活动窗口
|
||||
abstract public Activity getActivity();
|
||||
abstract public String getTag();
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package cc.winboll.studio.libappbase.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/25 20:34:47
|
||||
* @Describe 应用日志窗口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
|
||||
public class LogActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "LogActivity";
|
||||
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_log);
|
||||
//ToastUtils.show("LogActivity onCreate");
|
||||
|
||||
mLogView = findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +1,12 @@
|
||||
package cc.winboll.studio.libaes.winboll;
|
||||
package cc.winboll.studio.libappbase.winboll;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/24 08:24:52
|
||||
* @Date 2025/03/25 04:29:19
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
@@ -15,9 +16,12 @@ public class MyActivityLifecycleCallbacks implements Application.ActivityLifecyc
|
||||
|
||||
public static final String TAG = "MyActivityLifecycleCallbacks";
|
||||
|
||||
WinBollActivityManager mWinBollActivityManager;
|
||||
|
||||
public String mInfo = "";
|
||||
|
||||
public MyActivityLifecycleCallbacks() {
|
||||
public MyActivityLifecycleCallbacks(WinBollActivityManager winBollActivityManager) {
|
||||
mWinBollActivityManager = winBollActivityManager;
|
||||
}
|
||||
|
||||
void createActivityeInfo(Activity activity) {
|
||||
@@ -56,6 +60,7 @@ public class MyActivityLifecycleCallbacks implements Application.ActivityLifecyc
|
||||
//System.out.println(activity.getLocalClassName() + " was created");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was created");
|
||||
createActivityeInfo(activity);
|
||||
mWinBollActivityManager.add((IWinBollActivity)activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,5 +98,6 @@ public class MyActivityLifecycleCallbacks implements Application.ActivityLifecyc
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
//System.out.println(activity.getLocalClassName() + " was destroyed");
|
||||
LogUtils.d(TAG, activity.getLocalClassName() + " was destroyed");
|
||||
mWinBollActivityManager.registeRemove((IWinBollActivity)activity);
|
||||
}
|
||||
}
|
@@ -0,0 +1,318 @@
|
||||
package cc.winboll.studio.libappbase.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.");
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,15 +2,13 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="APPBaseTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
|
||||
<style name="APPBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="themeGlobalCrashActivity">@style/GlobalCrashActivityTheme</item>
|
||||
</style>
|
||||
|
||||
|
@@ -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.mymessagemanager"
|
||||
@@ -29,7 +29,7 @@ android {
|
||||
// versionName 更新后需要手动设置
|
||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||
versionName "4.1"
|
||||
versionName "15.0"
|
||||
if(true) {
|
||||
versionName = genVersionName("${versionName}")
|
||||
}
|
||||
@@ -44,6 +44,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
api 'cc.winboll.studio:winboll-shared:1.6.4'
|
||||
api 'io.github.medyo:android-about-page:2.0.0'
|
||||
api 'com.github.getActivity:ToastUtils:10.5'
|
||||
@@ -64,6 +66,4 @@ dependencies {
|
||||
api 'com.google.android.material:material:1.0.0'
|
||||
|
||||
api 'cc.winboll.studio:libaes:7.6.0'
|
||||
|
||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Feb 25 10:52:41 GMT 2025
|
||||
stageCount=14
|
||||
#Wed Mar 26 17:54:55 HKT 2025
|
||||
stageCount=1
|
||||
libraryProject=
|
||||
baseVersion=4.1
|
||||
publishVersion=4.1.13
|
||||
buildCount=5
|
||||
baseBetaVersion=4.1.14
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.0
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.1
|
||||
|
@@ -226,6 +226,8 @@
|
||||
|
||||
<activity android:name="cc.winboll.studio.mymessagemanager.activitys.SMSRecycleActivity"/>
|
||||
|
||||
<activity android:name="cc.winboll.studio.mymessagemanager.unittest.UnitTestActivity"/>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -32,6 +32,7 @@ import java.util.ArrayList;
|
||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||
import cc.winboll.studio.libaes.views.ASupportToolbar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.mymessagemanager.unittest.UnitTestActivity;
|
||||
|
||||
public class MainActivity extends BaseActivity {
|
||||
|
||||
@@ -303,15 +304,19 @@ public class MainActivity extends BaseActivity {
|
||||
int nItemId = item.getItemId();
|
||||
if (nItemId == R.id.app_ttsrule) {
|
||||
Intent i = new Intent(MainActivity.this, TTSPlayRuleActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_smsrule) {
|
||||
Intent i = new Intent(MainActivity.this, SMSReceiveRuleActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_appsettings) {
|
||||
Intent i = new Intent(MainActivity.this, AppSettingsActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_unittest) {
|
||||
Intent i = new Intent(MainActivity.this, UnitTestActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_crashtest) {
|
||||
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
|
||||
@@ -319,11 +324,11 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
} else if (nItemId == R.id.app_about) {
|
||||
Intent i = new Intent(MainActivity.this, AboutActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
} else if (nItemId == R.id.app_smsrecycle) {
|
||||
Intent i = new Intent(MainActivity.this, SMSRecycleActivity.class);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
|
@@ -18,10 +18,10 @@ import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.SMSActivity;
|
||||
import cc.winboll.studio.mymessagemanager.adapters.SMSArrayAdapter;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.ViewUtil;
|
||||
import cc.winboll.studio.mymessagemanager.views.SMSListViewForScrollView;
|
||||
import cc.winboll.studio.mymessagemanager.views.SMSView;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class SMSActivity extends BaseActivity {
|
||||
@@ -102,7 +102,7 @@ public class SMSActivity extends BaseActivity {
|
||||
|
||||
// 初始化标题栏
|
||||
mToolbar = findViewById(R.id.activitysmsASupportToolbar1);
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_smsinphone) + " < Phone : " + mszPhoneTo + " >");
|
||||
mToolbar.setSubtitle(getString(R.string.activity_name_smsinphone) + " < Phone : " + AddressUtils.getFormattedAddress(mszPhoneTo) + " >");
|
||||
setActionBar(mToolbar);
|
||||
|
||||
// 初始化滚动窗口
|
||||
|
@@ -13,6 +13,7 @@ import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.mymessagemanager.activitys.SMSActivity;
|
||||
import cc.winboll.studio.mymessagemanager.beans.PhoneBean;
|
||||
import cc.winboll.studio.mymessagemanager.beans.SMSBean;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
|
||||
import cc.winboll.studio.mymessagemanager.utils.PhoneUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
|
||||
import cc.winboll.studio.shared.log.LogUtils;
|
||||
@@ -74,9 +75,9 @@ public class PhoneArrayAdapter extends BaseAdapter {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
String szAddress = ((SMSBean)getItem(position)).getAddress();
|
||||
final String szAddress = ((SMSBean)getItem(position)).getAddress();
|
||||
|
||||
viewHolder.tvAddress.setText(szAddress);
|
||||
viewHolder.tvAddress.setText(AddressUtils.getFormattedAddress(szAddress));
|
||||
viewHolder.tvName.setText(getName(szAddress));
|
||||
|
||||
//Drawable drawableFrame = AppCompatResources.getDrawable(mContext, R.drawable.bg_frame);
|
||||
@@ -87,7 +88,7 @@ public class PhoneArrayAdapter extends BaseAdapter {
|
||||
|
||||
//Toast.makeText(mContext, tv.getText(), Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(mContext, SMSActivity.class);
|
||||
intent.putExtra(SMSActivity.EXTRA_PHONE, viewHolder.tvAddress.getText());
|
||||
intent.putExtra(SMSActivity.EXTRA_PHONE, szAddress);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
|
@@ -34,6 +34,7 @@ import cc.winboll.studio.mymessagemanager.views.DateAgoTextView;
|
||||
import cc.winboll.studio.mymessagemanager.views.SMSView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import java.util.ArrayList;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
|
||||
|
||||
public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
@@ -154,7 +155,7 @@ public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
final SMSRecycleBean item = mDataList.get(position);
|
||||
if (holder.getItemViewType() == 0) {
|
||||
SimpleViewHolder viewHolder = (SimpleViewHolder) holder;
|
||||
viewHolder.mtvAddress.setText(item.getAddress());
|
||||
viewHolder.mtvAddress.setText(AddressUtils.getFormattedAddress(item.getAddress()));
|
||||
viewHolder.mbtnViewBody.setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -179,7 +180,7 @@ public class SMSRecycleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
viewHolder.mvRight.setVisibility(View.GONE);
|
||||
viewHolder.mSMSView.setSMSType(SMSView.SMSType.SEND);
|
||||
}
|
||||
viewHolder.mtvAddress.setText(item.getAddress());
|
||||
viewHolder.mtvAddress.setText(AddressUtils.getFormattedAddress(item.getAddress()));
|
||||
viewHolder.mdatvDeleteDate.setDate(item.getDeleteDate());
|
||||
viewHolder.mdatvDate.setDate(item.getDate());
|
||||
if(mAppConfigUtil.mAppConfigBean.isSMSRecycleProtectMode()) {
|
||||
|
@@ -15,6 +15,7 @@ import cc.winboll.studio.mymessagemanager.utils.SMSRecycleUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.TTSPlayRuleUtil;
|
||||
import cc.winboll.studio.mymessagemanager.utils.RegexPPiUtils;
|
||||
import cc.winboll.studio.shared.log.LogUtils;
|
||||
|
||||
public class SMSRecevier extends BroadcastReceiver {
|
||||
|
||||
@@ -39,25 +40,11 @@ public class SMSRecevier extends BroadcastReceiver {
|
||||
//LogUtils.d(TAG, "ACTION_SMS_RECEIVED");
|
||||
String szSmsBody = SMSUtil.getSmsBody(intent);
|
||||
String szSmsAddress = SMSUtil.getSmsAddress(intent);
|
||||
PhoneUtil phoneUtil = new PhoneUtil(context);
|
||||
boolean isPhoneInContacts = phoneUtil.isPhoneInContacts(szSmsAddress);
|
||||
AppConfigUtil configUtil = AppConfigUtil.getInstance(context);
|
||||
boolean isOnlyReceiveContacts = configUtil.mAppConfigBean.isEnableOnlyReceiveContacts();
|
||||
boolean isEnableTTS = configUtil.mAppConfigBean.isEnableTTS();
|
||||
boolean isEnableTTSAnalyzeMode = configUtil.mAppConfigBean.isEnableTTSRuleMode();
|
||||
boolean isInSMSAcceptRule = SMSReceiveRuleUtil.getInstance(context, false).checkIsSMSAcceptInRule(context, szSmsBody);
|
||||
//LogUtils.d(TAG, "isInSMSAcceptRule is : " + Boolean.toString(isInSMSAcceptRule));
|
||||
|
||||
if (!isPhoneInContacts) {
|
||||
GlobalApplication.showApplicationMessage(" The phone number " + szSmsAddress + " is not in contacts.");
|
||||
if (isOnlyReceiveContacts) {
|
||||
GlobalApplication.showApplicationMessage("Close the \"Only Receive Contacts\" switch will be receive The " + szSmsAddress + "'s message in future.");
|
||||
}
|
||||
}
|
||||
|
||||
if ((!isOnlyReceiveContacts)
|
||||
|| isPhoneInContacts
|
||||
|| isInSMSAcceptRule) {
|
||||
if (checkIsSMSOK(context, szSmsBody, szSmsAddress)) {
|
||||
int nResultId = SMSUtil.saveReceiveSms(context, szSmsAddress, szSmsBody, "0", System.currentTimeMillis(), "inbox");
|
||||
if (nResultId >= 0) {
|
||||
NotificationUtil nu = new NotificationUtil();
|
||||
@@ -81,12 +68,41 @@ public class SMSRecevier extends BroadcastReceiver {
|
||||
SMSRecycleUtil.addSMSRecycleItem(context, bean);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// 检查短信是否在接收设定规则内
|
||||
//
|
||||
public static boolean checkIsSMSOK(Context context, String szSmsBody, String szSmsAddress) {
|
||||
PhoneUtil phoneUtil = new PhoneUtil(context);
|
||||
boolean isPhoneInContacts = phoneUtil.isPhoneInContacts(szSmsAddress);
|
||||
LogUtils.d(TAG, String.format("isPhoneInContacts %s", isPhoneInContacts));
|
||||
|
||||
boolean isPhoneByDigit = phoneUtil.isPhoneByDigit(szSmsAddress);
|
||||
LogUtils.d(TAG, String.format("isPhoneByDigit %s", isPhoneByDigit));
|
||||
|
||||
AppConfigUtil configUtil = AppConfigUtil.getInstance(context);
|
||||
boolean isOnlyReceiveContacts = configUtil.mAppConfigBean.isEnableOnlyReceiveContacts();
|
||||
LogUtils.d(TAG, String.format("isOnlyReceiveContacts %s", isOnlyReceiveContacts));
|
||||
|
||||
boolean isInSMSAcceptRule = SMSReceiveRuleUtil.getInstance(context, false).checkIsSMSAcceptInRule(context, szSmsBody);
|
||||
LogUtils.d(TAG, String.format("isInSMSAcceptRule %s", isInSMSAcceptRule));
|
||||
|
||||
// 启用了只接受通讯录,通讯录里有记录
|
||||
if (isOnlyReceiveContacts && isPhoneInContacts) {
|
||||
return true;
|
||||
}
|
||||
// 如果不是数字通讯地址,但是在通讯录内
|
||||
if (!isPhoneByDigit && isPhoneInContacts) {
|
||||
return true;
|
||||
}
|
||||
// 通讯地址是数字,并且在短信接收规则内。
|
||||
if (isPhoneByDigit && isInSMSAcceptRule) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package cc.winboll.studio.mymessagemanager.unittest;
|
||||
import cc.winboll.studio.shared.log.LogUtils;
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.mymessagemanager.utils.AddressUtils;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/01 13:07:32
|
||||
* @Describe AddressUtils Test
|
||||
*/
|
||||
public class AddressUtils_Test {
|
||||
|
||||
public static final String TAG = "AddressUtils_Test";
|
||||
|
||||
public static void main(Context context) {
|
||||
String szSmsBody = "无影无迹";
|
||||
String szSmsAddress = "无名小辈";
|
||||
LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress)));
|
||||
szSmsAddress = "13172887736";
|
||||
LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress)));
|
||||
szSmsAddress = "+8613172887736";
|
||||
LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress)));
|
||||
szSmsAddress = "8613172887736";
|
||||
LogUtils.d(TAG, String.format("szSmsAddress %s\n getFormattedAddress : %s", szSmsAddress, AddressUtils.getFormattedAddress(szSmsAddress)));
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
package cc.winboll.studio.mymessagemanager.unittest;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/02/25 19:02:15
|
||||
* @Describe SMSRecevier 测试类
|
||||
*/
|
||||
import cc.winboll.studio.mymessagemanager.utils.SMSReceiveRuleUtil;
|
||||
import android.content.Context;
|
||||
import cc.winboll.studio.shared.log.LogUtils;
|
||||
import cc.winboll.studio.mymessagemanager.receivers.SMSRecevier;
|
||||
|
||||
public class SMSRecevier_Test {
|
||||
|
||||
public static final String TAG = "SMSRecevier_Test";
|
||||
|
||||
public static void main(Context context) {
|
||||
String szSmsBody = "无影无迹";
|
||||
String szSmsAddress = "无名小辈";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "无影无迹";
|
||||
szSmsAddress = "淘宝物流";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "无影无迹";
|
||||
szSmsAddress = "1?0";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "无影无迹";
|
||||
szSmsAddress = "10000";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "【UC】无影无迹";
|
||||
szSmsAddress = "无名小辈";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "【UC】无影无迹";
|
||||
szSmsAddress = "10000";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "【UC】无影无迹";
|
||||
szSmsAddress = "13172887736";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
szSmsBody = "【UC】无影无迹";
|
||||
szSmsAddress = "+8613172887736";
|
||||
test1(context, szSmsBody, szSmsAddress);
|
||||
|
||||
}
|
||||
|
||||
public static void test1(Context context, String szSmsBody, String szSmsAddress) {
|
||||
|
||||
boolean isSMSOK = SMSRecevier.checkIsSMSOK(context, szSmsBody, szSmsAddress);
|
||||
LogUtils.d(TAG, String.format("szSmsBody : %s\nszSmsAddress : %s\nisSMSOK : %s", szSmsBody, szSmsAddress, isSMSOK));
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package cc.winboll.studio.mymessagemanager.unittest;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/02/25 19:00:10
|
||||
* @Describe 应用单元测试窗口
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.mymessagemanager.R;
|
||||
import cc.winboll.studio.shared.log.LogUtils;
|
||||
import cc.winboll.studio.shared.log.LogView;
|
||||
|
||||
public class UnitTestActivity extends Activity {
|
||||
|
||||
public static final String TAG = "UnitTestActivity";
|
||||
|
||||
LogView mLogView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_unittest);
|
||||
|
||||
mLogView = findViewById(R.id.logview);
|
||||
mLogView.start();
|
||||
}
|
||||
|
||||
public void onMain(View view) {
|
||||
LogUtils.d(TAG, "SMSRecevier_Test");
|
||||
SMSRecevier_Test.main(this);
|
||||
LogUtils.d(TAG, "AddressUtils_Test");
|
||||
AddressUtils_Test.main(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package cc.winboll.studio.mymessagemanager.utils;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/01 13:03:16
|
||||
* @Describe 通信录地址工具
|
||||
*/
|
||||
public class AddressUtils {
|
||||
|
||||
public static final String TAG = "AddressUtils";
|
||||
|
||||
public static String getFormattedAddress(String address) {
|
||||
if (address != null && address.matches("[+]?\\d+")) {
|
||||
return address;
|
||||
} else {
|
||||
return "【" + address + "】";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -15,6 +15,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.Matcher;
|
||||
import cc.winboll.studio.shared.log.LogUtils;
|
||||
|
||||
public class PhoneUtil {
|
||||
|
||||
@@ -67,4 +70,23 @@ public class PhoneUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// 检验电话号码是否是数字
|
||||
//
|
||||
public static boolean isPhoneByDigit(String szPhone) {
|
||||
if(!RegexPPiUtils.isPPiOK(szPhone)) {
|
||||
return false;
|
||||
}
|
||||
//String text = "这里是一些任意的文本内容";
|
||||
String regex = "[+]?\\d+";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(szPhone);
|
||||
LogUtils.d(TAG, String.format("matcher.matches() : %s", matcher.matches()));
|
||||
/*if (matcher.matches()) {
|
||||
System.out.println("文本满足该正则表达式模式");
|
||||
} else {
|
||||
System.out.println("文本不满足该正则表达式模式");
|
||||
}*/
|
||||
return matcher.matches();
|
||||
}
|
||||
}
|
||||
|
@@ -194,9 +194,9 @@ public class SMSReceiveRuleUtil {
|
||||
public ArrayList<SMSAcceptRuleBean> loadConfigData() {
|
||||
ArrayList<SMSAcceptRuleBean> list = new ArrayList<SMSAcceptRuleBean>();
|
||||
SMSAcceptRuleBean.loadBeanList(mContext, list, SMSAcceptRuleBean.class);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
LogUtils.d(TAG, "loadConfigData isEnable : " + Boolean.toString(list.get(i).isEnable()));
|
||||
}
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// LogUtils.d(TAG, "loadConfigData isEnable : " + Boolean.toString(list.get(i).isEnable()));
|
||||
// }
|
||||
mDataList.clear();
|
||||
mDataList.addAll(list);
|
||||
return mDataList;
|
||||
|
44
mymessagemanager/src/main/res/layout/activity_unittest.xml
Normal file
44
mymessagemanager/src/main/res/layout/activity_unittest.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<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:text="Test Main"
|
||||
android:onClick="onMain"
|
||||
android:textAllCaps="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<cc.winboll.studio.shared.log.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -19,6 +19,9 @@
|
||||
android:title="@string/text_smsrule"/>
|
||||
<item android:title="@string/app_developoptions">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/app_unittest"
|
||||
android:title="@string/app_unittest"/>
|
||||
<item
|
||||
android:id="@+id/app_crashtest"
|
||||
android:title="@string/app_crashtest"/>
|
||||
|
@@ -9,6 +9,7 @@
|
||||
<string name="app_goldentheme">辉煌历程主题</string>
|
||||
<string name="app_developoptions">开发选项</string>
|
||||
<string name="app_default_app_settings">默认应用设置</string>
|
||||
<string name="app_unittest">单元测试</string>
|
||||
<string name="app_crashtest">应用异常崩溃处理测试</string>
|
||||
<string name="app_about">关于应用</string>
|
||||
<string name="app_smsrecycle">短信回收站</string>
|
||||
|
@@ -9,6 +9,7 @@
|
||||
<string name="app_goldentheme">Golden Theme</string>
|
||||
<string name="app_developoptions">Develop Options</string>
|
||||
<string name="app_default_app_settings">Default App Settings</string>
|
||||
<string name="app_unittest">Unit Test</string>
|
||||
<string name="app_crashtest">Crash Test</string>
|
||||
<string name="app_about">About APP</string>
|
||||
<string name="app_smsrecycle">SMS Recycle</string>
|
||||
|
Reference in New Issue
Block a user