Compare commits
43 Commits
aes-v15.0.
...
appbase-v1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d9b99ee371 | ||
![]() |
6f7414b576 | ||
![]() |
2f6e297bab | ||
![]() |
e35a6b9a7f | ||
![]() |
e71e5a852d | ||
![]() |
4ea48a051d | ||
![]() |
ae680b5b48 | ||
![]() |
80767ca5b5 | ||
![]() |
be5ed936df | ||
![]() |
b3075f778d | ||
![]() |
ce05d69132 | ||
![]() |
6a9434b194 | ||
![]() |
6ca7b210a6 | ||
![]() |
d83d460342 | ||
![]() |
9a53d04050 | ||
![]() |
ada664f4ab | ||
![]() |
92a9bbb455 | ||
![]() |
211eef7232 | ||
![]() |
31bad8a279 | ||
![]() |
bc0eb69edf | ||
![]() |
08f990de65 | ||
![]() |
e2b6fadd43 | ||
![]() |
2074f68ef3 | ||
![]() |
56a13b4a40 | ||
![]() |
8bdd42ce68 | ||
![]() |
d4986c6ba4 | ||
![]() |
529f420668 | ||
![]() |
b3439aa36a | ||
![]() |
7488fa7af2 | ||
![]() |
d4e4541bfd | ||
![]() |
ac627e53b1 | ||
![]() |
42a2e6d559 | ||
![]() |
0d44734c0b | ||
![]() |
e89873046b | ||
![]() |
f3ef7226d8 | ||
![]() |
9706a39f41 | ||
![]() |
e85cbd803e | ||
![]() |
00a9ec1d66 | ||
![]() |
64051bb9fe | ||
![]() |
dd7600d617 | ||
![]() |
75c2f6304c | ||
![]() |
ec6926f629 | ||
![]() |
3fe1ea7ff2 |
@@ -19,17 +19,17 @@ def genVersionName(def versionName){
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.aes"
|
applicationId "cc.winboll.studio.aes"
|
||||||
minSdkVersion 26
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
// 项目模块目录的 build.gradle 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.0"
|
versionName "7.6"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -41,9 +41,29 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':libaes')
|
api project(':libaes')
|
||||||
|
|
||||||
|
//api 'cc.winboll.studio:winboll-shared:1.6.5'
|
||||||
|
api 'io.github.medyo:android-about-page:2.0.0'
|
||||||
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
api 'com.jcraft:jsch:0.1.55'
|
||||||
|
api 'org.jsoup:jsoup:1.13.1'
|
||||||
|
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
|
|
||||||
|
api 'androidx.appcompat:appcompat:1.0.0'
|
||||||
|
api 'androidx.fragment:fragment:1.0.0'
|
||||||
|
api 'com.google.android.material:material:1.0.0'
|
||||||
|
|
||||||
|
api 'cc.winboll.studio:libapputils:9.2.1'
|
||||||
|
api 'cc.winboll.studio:libappbase:1.0.3'
|
||||||
|
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 24 20:00:06 HKT 2025
|
#Sun Jan 19 04:58:59 GMT 2025
|
||||||
stageCount=6
|
stageCount=3
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.0
|
baseVersion=7.6
|
||||||
publishVersion=15.0.5
|
publishVersion=7.6.2
|
||||||
buildCount=0
|
buildCount=4
|
||||||
baseBetaVersion=15.0.6
|
baseBetaVersion=7.6.3
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/MyAESTheme"
|
android:theme="@style/WinBoll.SupportThemeNoActionBar"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="true">
|
android:supportsRtl="true">
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ public class App extends GlobalApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
//setIsDebug(BuildConfig.DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,225 +5,12 @@ package cc.winboll.studio.aes;
|
|||||||
* @Date 2024/06/13 19:05:52
|
* @Date 2024/06/13 19:05:52
|
||||||
* @Describe 应用主窗口
|
* @Describe 应用主窗口
|
||||||
*/
|
*/
|
||||||
import android.content.Intent;
|
import cc.winboll.studio.libaes.unittests.LibraryActivity;
|
||||||
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.APPInfo;
|
|
||||||
import cc.winboll.studio.libaes.winboll.AboutActivityFactory;
|
|
||||||
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
|
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
|
||||||
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class MainActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
|
||||||
|
|
||||||
|
|
||||||
|
public class MainActivity extends LibraryActivity {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
|
|
||||||
TestAButtonFragment mTestAButtonFragment;
|
|
||||||
TestViewPageFragment mTestViewPageFragment;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AppCompatActivity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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) {
|
|
||||||
onAbout();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onAbout() {
|
|
||||||
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");
|
|
||||||
AboutActivityFactory.showAboutActivity(this, appInfo);
|
|
||||||
//ToastUtils.show("onAbout");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="colorPrimary">#FF00B322</color>
|
|
||||||
<color name="colorPrimaryDark">#FF005C12</color>
|
|
||||||
<color name="colorAccent">#FF8DFFA2</color>
|
|
||||||
<color name="colorText">#FFFFFB8D</color>
|
|
||||||
</resources>
|
|
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="MyAESTheme" parent="AESTheme">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -18,15 +18,8 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
productFlavors {
|
compileSdkVersion 32
|
||||||
beta {
|
buildToolsVersion "32.0.0"
|
||||||
}
|
|
||||||
stage {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileSdkVersion 30
|
|
||||||
buildToolsVersion "30.0.3"
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.androiddemo"
|
applicationId "cc.winboll.studio.androiddemo"
|
||||||
@@ -36,7 +29,7 @@ android {
|
|||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "1.0"
|
versionName "15.0"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
@@ -54,21 +47,25 @@ dependencies {
|
|||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
// 吐司类库
|
// 吐司类库
|
||||||
implementation 'com.github.getActivity:ToastUtils:10.5'
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
|
||||||
// Android 类库
|
// Android 类库
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
api 'com.android.support:appcompat-v7:28.0.0' // 包含 AppCompatActivity
|
||||||
implementation 'com.android.support:support-v4:28.0.0'
|
|
||||||
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
// 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
|
// 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
|
// 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
|
// 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
|
// 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
|
// 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
|
#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
|
stageCount=0
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=1.0
|
baseVersion=15.0
|
||||||
publishVersion=1.0.0
|
publishVersion=15.0.0
|
||||||
buildCount=1
|
buildCount=11
|
||||||
baseBetaVersion=1.0.1
|
baseBetaVersion=15.0.1
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:name=".GlobalApplication">
|
android:name=".App">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
package cc.winboll.studio.androiddemo;
|
package cc.winboll.studio.androiddemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -22,6 +21,7 @@ import android.widget.HorizontalScrollView;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
@@ -39,15 +39,15 @@ import java.util.Date;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
public class GlobalApplication extends Application {
|
public class App extends GlobalApplication {
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
CrashHandler.getInstance().registerGlobal(this);
|
//CrashHandler.getInstance().registerGlobal(this);
|
||||||
CrashHandler.getInstance().registerPart(this);
|
//CrashHandler.getInstance().registerPart(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(InputStream input, OutputStream output) throws IOException {
|
public static void write(InputStream input, OutputStream output) throws IOException {
|
||||||
@@ -252,7 +252,7 @@ public class GlobalApplication extends Application {
|
|||||||
|
|
||||||
private static String getKernel() {
|
private static String getKernel() {
|
||||||
try {
|
try {
|
||||||
return GlobalApplication.toString(new FileInputStream("/proc/version")).trim();
|
return App.toString(new FileInputStream("/proc/version")).trim();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
return e.getMessage();
|
return e.getMessage();
|
||||||
}
|
}
|
||||||
@@ -331,4 +331,4 @@ public class GlobalApplication extends Application {
|
|||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,15 +1,25 @@
|
|||||||
package cc.winboll.studio.androiddemo;
|
package cc.winboll.studio.androiddemo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
public class MainActivity extends Activity {
|
|
||||||
|
public class MainActivity extends Activity {
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
LogView mLogView;
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_main);
|
@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,13 +4,34 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical|center_horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:text="Android Demo"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Android Demo"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libappbase.LogView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Text"
|
||||||
|
android:id="@+id/logview"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -18,18 +18,19 @@ def genVersionName(def versionName){
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "32.0.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cc.winboll.studio.appbase"
|
applicationId "cc.winboll.studio.appbase"
|
||||||
minSdkVersion 26
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 1
|
versionCode 1
|
||||||
// versionName 更新后需要手动设置
|
// versionName 更新后需要手动设置
|
||||||
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
// .winboll/winbollBuildProps.properties 文件的 stageCount=0
|
||||||
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
// Gradle编译环境下合起来的 versionName 就是 "${versionName}.0"
|
||||||
versionName "15.0"
|
versionName "15.1"
|
||||||
if(true) {
|
if(true) {
|
||||||
versionName = genVersionName("${versionName}")
|
versionName = genVersionName("${versionName}")
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 24 14:06:25 HKT 2025
|
#Fri Mar 28 18:20:22 HKT 2025
|
||||||
stageCount=10
|
stageCount=4
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.0
|
baseVersion=15.1
|
||||||
publishVersion=15.0.9
|
publishVersion=15.1.3
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.0.10
|
baseBetaVersion=15.1.4
|
||||||
|
@@ -8,12 +8,15 @@
|
|||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/MyAPPBaseTheme"
|
android:theme="@style/MyAPPBaseTheme"
|
||||||
android:resizeableActivity="true">
|
android:resizeableActivity="true"
|
||||||
|
android:process=":App">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:exported="true">
|
android:exported="true"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -29,10 +32,22 @@
|
|||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".GlobalApplication$CrashActivity"/>
|
<activity
|
||||||
|
android:name=".activities.NewActivity"
|
||||||
|
android:label="NewActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
|
||||||
|
|
||||||
|
<activity android:name=".activities.New2Activity"
|
||||||
|
android:label="New2Activity"
|
||||||
|
android:exported="true"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".MyTileService"
|
android:name=".MyTileService"
|
||||||
|
android:exported="true"
|
||||||
android:label="@string/tileservice_name"
|
android:label="@string/tileservice_name"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||||
@@ -49,15 +64,18 @@
|
|||||||
android:name=".services.MainService"
|
android:name=".services.MainService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
<service
|
||||||
|
android:name="cc.winboll.studio.appbase.services.TestDemoBindService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<service android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
<service
|
||||||
|
android:name="cc.winboll.studio.appbase.services.TestDemoService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<service android:name=".services.AssistantService"/>
|
<service android:name=".services.AssistantService"/>
|
||||||
|
|
||||||
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver">
|
<receiver android:name="cc.winboll.studio.appbase.receivers.MainReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -87,7 +105,8 @@
|
|||||||
|
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".receivers.APPNewsWidgetClickListener">
|
<receiver android:name=".receivers.APPNewsWidgetClickListener"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -103,6 +122,7 @@
|
|||||||
android:name="android.max_aspect"
|
android:name="android.max_aspect"
|
||||||
android:value="4.0"/>
|
android:value="4.0"/>
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -19,7 +19,6 @@ public class App extends GlobalApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
GlobalApplication.setIsDebuging(this, BuildConfig.DEBUG);
|
|
||||||
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
mSOSCenterServiceReceiver = new SOSCenterServiceReceiver();
|
||||||
IntentFilter intentFilter = new IntentFilter();
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
intentFilter.addAction(SOS.ACTION_SOS);
|
intentFilter.addAction(SOS.ACTION_SOS);
|
||||||
|
@@ -4,25 +4,42 @@ import android.app.Activity;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.Toolbar;
|
|
||||||
import cc.winboll.studio.appbase.R;
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.appbase.activities.NewActivity;
|
||||||
import cc.winboll.studio.appbase.services.MainService;
|
import cc.winboll.studio.appbase.services.MainService;
|
||||||
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
import cc.winboll.studio.appbase.services.TestDemoBindService;
|
||||||
import cc.winboll.studio.appbase.services.TestDemoService;
|
import cc.winboll.studio.appbase.services.TestDemoService;
|
||||||
|
import cc.winboll.studio.libappbase.CrashHandler;
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalCrashActivity;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
|
||||||
import cc.winboll.studio.libappbase.sos.SOS;
|
import cc.winboll.studio.libappbase.sos.SOS;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends WinBollActivityBase implements IWinBollActivity {
|
||||||
|
|
||||||
public static final String TAG = "MainActivity";
|
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
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -30,19 +47,34 @@ public class MainActivity extends Activity {
|
|||||||
ToastUtils.show("onCreate");
|
ToastUtils.show("onCreate");
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.activitymainToolbar1);
|
mToolbar = findViewById(R.id.toolbar);
|
||||||
setActionBar(toolbar);
|
setSupportActionBar(mToolbar);
|
||||||
|
|
||||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||||
mLogView = findViewById(R.id.activitymainLogView1);
|
//mLogView = findViewById(R.id.activitymainLogView1);
|
||||||
|
|
||||||
if (GlobalApplication.isDebuging()) {
|
// if (GlobalApplication.isDebuging()) {
|
||||||
mLogView.start();
|
// mLogView.start();
|
||||||
ToastUtils.show("LogView start.");
|
// ToastUtils.show("LogView start.");
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@@ -51,15 +83,15 @@ public class MainActivity extends Activity {
|
|||||||
sendBroadcast(intentAPPWidget);
|
sendBroadcast(intentAPPWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
LogUtils.d(TAG, "onResume");
|
|
||||||
super.onResume();
|
|
||||||
mLogView.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSwitchDebugMode(View view) {
|
public void onSwitchDebugMode(View view) {
|
||||||
GlobalApplication.setIsDebuging(this, ((CheckBox)view).isChecked());
|
boolean isDebuging = ((CheckBox)view).isChecked();
|
||||||
|
GlobalApplication.setIsDebuging(isDebuging);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onPreviewGlobalCrashActivity(View view) {
|
||||||
|
Intent intent = new Intent(this, GlobalCrashActivity.class);
|
||||||
|
intent.putExtra(CrashHandler.EXTRA_CRASH_INFO, "Demo log...");
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartCenter(View view) {
|
public void onStartCenter(View view) {
|
||||||
@@ -105,6 +137,8 @@ public class MainActivity extends Activity {
|
|||||||
startService(intent);
|
startService(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onStopTestDemoService(View view) {
|
public void onStopTestDemoService(View view) {
|
||||||
Intent intent = new Intent(this, TestDemoService.class);
|
Intent intent = new Intent(this, TestDemoService.class);
|
||||||
@@ -140,4 +174,10 @@ public class MainActivity extends Activity {
|
|||||||
Intent intent = new Intent(this, TestDemoBindService.class);
|
Intent intent = new Intent(this, TestDemoBindService.class);
|
||||||
stopService(intent);
|
stopService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onTestOpenNewActivity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, NewActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,82 @@
|
|||||||
|
package cc.winboll.studio.appbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/28 15:34:16
|
||||||
|
* @Describe 应用活动窗口基类
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.PersistableBundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import cc.winboll.studio.appbase.App;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||||
|
|
||||||
|
public class WinBollActivityBase extends AppCompatActivity implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "WinBollActivityBase";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
WinBollActivityManager getWinBollActivityManager() {
|
||||||
|
return WinBollActivityManager.getInstance(GlobalApplication.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
getWinBollActivityManager().add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPostCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
|
||||||
|
super.onPostCreate(savedInstanceState, persistentState);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||||
|
return true;
|
||||||
|
} else if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_minimal) {
|
||||||
|
//moveTaskToBack(true);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void exit() {
|
||||||
|
YesNoAlertDialog.show(this, "Exit " + getString(R.string.app_name), "Close all activity and exit?", new YesNoAlertDialog.OnDialogResultListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onYes() {
|
||||||
|
App.getWinBollActivityManager().finishAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNo() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
getWinBollActivityManager().registeRemove(this);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,83 @@
|
|||||||
|
package cc.winboll.studio.appbase.activities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 11:46:40
|
||||||
|
* @Describe 测试窗口2
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.appbase.WinBollActivityBase;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
|
||||||
|
public class New2Activity extends WinBollActivityBase implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "New2Activity";
|
||||||
|
|
||||||
|
Toolbar mToolbar;
|
||||||
|
//LogView mLogView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_new2);
|
||||||
|
|
||||||
|
// mLogView = findViewById(R.id.logview);
|
||||||
|
// mLogView.start();
|
||||||
|
mToolbar = findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(mToolbar);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseThisActivity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().finish(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseAllActivity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().finishAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onNewActivity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, NewActivity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,81 @@
|
|||||||
|
package cc.winboll.studio.appbase.activities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/25 05:04:22
|
||||||
|
*/
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.appbase.WinBollActivityBase;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
|
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||||
|
|
||||||
|
public class NewActivity extends WinBollActivityBase implements IWinBollActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "NewActivity";
|
||||||
|
|
||||||
|
Toolbar mToolbar;
|
||||||
|
//LogView mLogView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Activity getActivity() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_new);
|
||||||
|
// mLogView = findViewById(R.id.logview);
|
||||||
|
// mLogView.start();
|
||||||
|
mToolbar = findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(mToolbar);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//mLogView.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseThisActivity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().finish(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCloseAllActivity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().finishAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onNew2Activity(View view) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startWinBollActivity(this, New2Activity.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_appbase, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||||
|
GlobalApplication.getWinBollActivityManager().startLogActivity(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
@@ -5,10 +5,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/activitymainToolbar1"/>
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -39,28 +39,41 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Android版本10的代号是“Q”,API级别是29。 Android 10开始谷歌不再公开使用甜品作为版本代号,但内部仍保留了大量与“Q”相关的元素。Android 10本身并没有严格对应某个特定的Java版本,但在开发Android 10应用时,通常可以使用Java 8或更高版本。 Java 8为Android开发带来了诸如Lambda表达式、方法引用等新特性,能提高开发效率和代码可读性,与Android 10开发适配良好。Java 9及更高版本也可用于Android 10开发,能使用一些新的语言特性和API,但可能需要注意兼容性和配置问题。"/>
|
android:text="Android版本10的代号是“Q”,API级别是29。 Android 10开始谷歌不再公开使用甜品作为版本代号,但内部仍保留了大量与“Q”相关的元素。Android 10本身并没有严格对应某个特定的Java版本,但在开发Android 10应用时,通常可以使用Java 8或更高版本。 Java 8为Android开发带来了诸如Lambda表达式、方法引用等新特性,能提高开发效率和代码可读性,与Android 10开发适配良好。Java 9及更高版本也可用于Android 10开发,能使用一些新的语言特性和API,但可能需要注意兼容性和配置问题。"/>
|
||||||
|
|
||||||
<LinearLayout
|
<HorizontalScrollView
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:gravity="right|center_vertical">
|
|
||||||
|
|
||||||
<CheckBox
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:orientation="horizontal"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Debug Mode"
|
android:gravity="right|center_vertical"
|
||||||
android:layout_weight="1.0"
|
android:layout_width="wrap_content">
|
||||||
android:onClick="onSwitchDebugMode"
|
|
||||||
android:id="@+id/activitymainCheckBox1"/>
|
|
||||||
|
|
||||||
<Button
|
<CheckBox
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Test Application CrashReport"
|
android:text="Debug Mode"
|
||||||
android:textAllCaps="false"
|
android:layout_weight="1.0"
|
||||||
android:onClick="onTestApplicationCrashReport"/>
|
android:onClick="onSwitchDebugMode"
|
||||||
|
android:id="@+id/activitymainCheckBox1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Test Application CrashReport"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onTestApplicationCrashReport"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="PreviewGlobalCrashActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onPreviewGlobalCrashActivity"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -72,26 +85,27 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="right">
|
android:gravity="right">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="StartCenter"
|
android:text="StartCenter"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onStartCenter"/>
|
android:onClick="onStartCenter"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="StopCenter"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onStopCenter"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="StopCenter"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:onClick="onStopCenter"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
@@ -160,7 +174,6 @@
|
|||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -182,6 +195,13 @@
|
|||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:onClick="onTestDemoServiceSOS"/>
|
android:onClick="onTestDemoServiceSOS"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="TestOpenNewActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onTestOpenNewActivity"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
@@ -192,10 +212,5 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
|
||||||
android:layout_height="300dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:id="@+id/activitymainLogView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</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.support.v7.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="NewActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseThisActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseThisActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseAllActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseAllActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New2Activity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onNew2Activity"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
43
appbase/src/main/res/layout/activity_new2.xml
Normal file
43
appbase/src/main/res/layout/activity_new2.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.support.v7.widget.Toolbar
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/toolbar"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New2Activity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseThisActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseThisActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CloseAllActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onCloseAllActivity"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="NewActivity"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:onClick="onNewActivity"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
6
appbase/src/main/res/menu/toolbar_main.xml
Normal file
6
appbase/src/main/res/menu/toolbar_main.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
|
||||||
|
</menu>
|
@@ -18,7 +18,7 @@ buildscript {
|
|||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
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
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// 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'
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
namespace 'cc.winboll.studio.libaes'
|
||||||
|
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "33.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 26
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
@@ -17,37 +19,30 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
//api 'cc.winboll.studio:winboll-shared:1.6.5'
|
||||||
|
|
||||||
// 权限请求框架:https://github.com/getActivity/XXPermissions
|
|
||||||
api 'com.github.getActivity:XXPermissions:18.63'
|
|
||||||
// 下拉控件
|
|
||||||
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
|
||||||
// 拼音搜索
|
|
||||||
// https://mvnrepository.com/artifact/com.github.open-android/pinyin4j
|
|
||||||
api 'com.github.open-android:pinyin4j:2.5.0'
|
|
||||||
// SSH
|
|
||||||
api 'com.jcraft:jsch:0.1.55'
|
|
||||||
// Html 解析
|
|
||||||
api 'org.jsoup:jsoup:1.13.1'
|
|
||||||
// 二维码类库
|
|
||||||
api 'com.google.zxing:core:3.4.1'
|
|
||||||
api 'com.journeyapps:zxing-android-embedded:3.6.0'
|
|
||||||
// 应用介绍页类库
|
|
||||||
api 'io.github.medyo:android-about-page:2.0.0'
|
api 'io.github.medyo:android-about-page:2.0.0'
|
||||||
// 网络连接类库
|
api 'com.github.getActivity:ToastUtils:10.5'
|
||||||
|
api 'com.jcraft:jsch:0.1.55'
|
||||||
|
api 'org.jsoup:jsoup:1.13.1'
|
||||||
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
api 'com.squareup.okhttp3:okhttp:4.4.1'
|
||||||
// AndroidX 类库
|
|
||||||
api 'androidx.appcompat:appcompat:1.1.0'
|
|
||||||
api 'com.google.android.material:material:1.4.0'
|
|
||||||
//api 'androidx.viewpager:viewpager:1.0.0'
|
|
||||||
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
|
|
||||||
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
|
||||||
//api 'androidx.fragment:fragment:1.1.0'
|
|
||||||
|
|
||||||
api 'cc.winboll.studio:libappbase:15.0.9'
|
api 'androidx.appcompat:appcompat:1.0.0'
|
||||||
api 'cc.winboll.studio:libapputils:15.0.15'
|
api 'androidx.fragment:fragment:1.0.0'
|
||||||
|
api 'com.google.android.material:material:1.0.0'
|
||||||
|
|
||||||
|
// https://github.com/baoyongzhang/android-PullRefreshLayout
|
||||||
|
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
|
||||||
|
|
||||||
|
api 'cc.winboll.studio:libapputils:9.2.1'
|
||||||
|
api 'cc.winboll.studio:libappbase:1.0.3'
|
||||||
|
|
||||||
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 24 20:00:06 HKT 2025
|
#Sun Jan 19 04:58:59 GMT 2025
|
||||||
stageCount=6
|
stageCount=3
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.0
|
baseVersion=7.6
|
||||||
publishVersion=15.0.5
|
publishVersion=7.6.2
|
||||||
buildCount=0
|
buildCount=4
|
||||||
baseBetaVersion=15.0.6
|
baseBetaVersion=7.6.3
|
||||||
|
@@ -7,14 +7,14 @@
|
|||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity"/>
|
<activity android:name="cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity"/>
|
||||||
|
|
||||||
|
<activity android:name="cc.winboll.studio.libaes.activitys.AboutActivity"/>
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"/>
|
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"/>
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"/>
|
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"/>
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity"/>
|
<activity android:name="cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity"/>
|
||||||
|
|
||||||
<activity android:name="cc.winboll.studio.libaes.winboll.AboutActivity"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -16,6 +16,7 @@ import android.view.View;
|
|||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.drawerlayout.widget.DrawerLayout;
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
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.beans.DrawerMenuBean;
|
||||||
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
import cc.winboll.studio.libaes.utils.AESThemeUtil;
|
||||||
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import com.baoyz.widget.PullRefreshLayout;
|
import com.baoyz.widget.PullRefreshLayout;
|
||||||
import java.util.ArrayList;
|
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";
|
public static final String TAG = "DrawerFragmentActivity";
|
||||||
|
|
||||||
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
|
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
|
||||||
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
|
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
|
||||||
|
|
||||||
//protected Context mContext;
|
protected Context mContext;
|
||||||
ActivityType mActivityType;
|
ActivityType mActivityType;
|
||||||
ActionBarDrawerToggle mActionBarDrawerToggle;
|
ActionBarDrawerToggle mActionBarDrawerToggle;
|
||||||
DrawerLayout mDrawerLayout;
|
DrawerLayout mDrawerLayout;
|
||||||
@@ -59,7 +58,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
//mContext = this;
|
mContext = this;
|
||||||
mThemeType = getThemeType();
|
mThemeType = getThemeType();
|
||||||
setThemeStyle();
|
setThemeStyle();
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -73,7 +72,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public Intent getIntent() {
|
public Intent getIntent() {
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
return super.getIntent();
|
return super.getIntent();
|
||||||
@@ -81,7 +80,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
|
|
||||||
public Context getContext() {
|
public Context getContext() {
|
||||||
return this.mContext;
|
return this.mContext;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MenuInflater getMenuInflater() {
|
public MenuInflater getMenuInflater() {
|
||||||
@@ -89,20 +88,20 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
return super.getMenuInflater();
|
return super.getMenuInflater();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public void setSubtitle(CharSequence context) {
|
public void setSubtitle(CharSequence context) {
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
getSupportActionBar().setSubtitle(context);
|
getSupportActionBar().setSubtitle(context);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void recreate() {
|
public void recreate() {
|
||||||
super.recreate();
|
super.recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public boolean moveTaskToBack(boolean nonRoot) {
|
public boolean moveTaskToBack(boolean nonRoot) {
|
||||||
return super.moveTaskToBack(nonRoot);
|
return super.moveTaskToBack(nonRoot);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startActivity(Intent intent) {
|
public void startActivity(Intent intent) {
|
||||||
@@ -114,7 +113,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
super.startActivityForResult(intent, requestCode, options);
|
super.startActivityForResult(intent, requestCode, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public FragmentManager getSupportFragmentManager() {
|
public FragmentManager getSupportFragmentManager() {
|
||||||
return super.getSupportFragmentManager();
|
return super.getSupportFragmentManager();
|
||||||
}
|
}
|
||||||
@@ -132,7 +131,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
public void setTitle(int resId) {
|
public void setTitle(int resId) {
|
||||||
// TODO: Implement this method
|
// TODO: Implement this method
|
||||||
getSupportActionBar().setTitle(resId);
|
getSupportActionBar().setTitle(resId);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||||
@@ -152,7 +151,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
|
|
||||||
void setThemeStyle() {
|
void setThemeStyle() {
|
||||||
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
|
||||||
setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
setTheme(AESThemeUtil.getThemeTypeID(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean checkThemeStyleChange() {
|
boolean checkThemeStyleChange() {
|
||||||
@@ -164,7 +163,7 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement
|
|||||||
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
|
||||||
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
|
||||||
*/
|
*/
|
||||||
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext()));
|
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -8,7 +8,7 @@ package cc.winboll.studio.libaes.beans;
|
|||||||
import android.util.JsonReader;
|
import android.util.JsonReader;
|
||||||
import android.util.JsonWriter;
|
import android.util.JsonWriter;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libappbase.BaseBean;
|
import cc.winboll.studio.libapputils.bean.BaseBean;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class AESThemeBean extends BaseBean {
|
public class AESThemeBean extends BaseBean {
|
||||||
@@ -16,7 +16,7 @@ public class AESThemeBean extends BaseBean {
|
|||||||
public static final String TAG = "AESThemeBean";
|
public static final String TAG = "AESThemeBean";
|
||||||
|
|
||||||
public enum ThemeType {
|
public enum ThemeType {
|
||||||
AES("默认主题"),
|
DEFAULT("默认主题"),
|
||||||
DEPTH("深奥主题"),
|
DEPTH("深奥主题"),
|
||||||
SKY("天空主题"),
|
SKY("天空主题"),
|
||||||
GOLDEN("辉煌主题"),
|
GOLDEN("辉煌主题"),
|
||||||
@@ -42,7 +42,7 @@ public class AESThemeBean extends BaseBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 保存当前主题
|
// 保存当前主题
|
||||||
int currentThemeStyleID = getThemeStyleID(ThemeType.AES);
|
int currentThemeStyleID = getThemeStyleID(ThemeType.DEFAULT);
|
||||||
|
|
||||||
public AESThemeBean() {
|
public AESThemeBean() {
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ public class AESThemeBean extends BaseBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getThemeStyleID(ThemeType themeType) {
|
public static int getThemeStyleID(ThemeType themeType) {
|
||||||
int themeStyleID = R.style.AESTheme;
|
int themeStyleID = R.style.DefaultAESTheme;
|
||||||
if (AESThemeBean.ThemeType.DEPTH == themeType) {
|
if (AESThemeBean.ThemeType.DEPTH == themeType) {
|
||||||
themeStyleID = R.style.DepthAESTheme;
|
themeStyleID = R.style.DepthAESTheme;
|
||||||
} else if (AESThemeBean.ThemeType.SKY == themeType) {
|
} else if (AESThemeBean.ThemeType.SKY == themeType) {
|
||||||
@@ -110,15 +110,15 @@ public class AESThemeBean extends BaseBean {
|
|||||||
themeStyleID = R.style.MemorAESTheme;
|
themeStyleID = R.style.MemorAESTheme;
|
||||||
} else if (AESThemeBean.ThemeType.TAO == themeType) {
|
} else if (AESThemeBean.ThemeType.TAO == themeType) {
|
||||||
themeStyleID = R.style.TaoAESTheme;
|
themeStyleID = R.style.TaoAESTheme;
|
||||||
} else if (AESThemeBean.ThemeType.AES == themeType) {
|
} else if (AESThemeBean.ThemeType.DEFAULT == themeType) {
|
||||||
themeStyleID = R.style.AESTheme;
|
themeStyleID = R.style.DefaultAESTheme;
|
||||||
}
|
}
|
||||||
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
|
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
|
||||||
return themeStyleID;
|
return themeStyleID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
|
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
|
||||||
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.AES;
|
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||||
if (R.style.DepthAESTheme == nThemeStyleID) {
|
if (R.style.DepthAESTheme == nThemeStyleID) {
|
||||||
themeStyle = AESThemeBean.ThemeType.DEPTH ;
|
themeStyle = AESThemeBean.ThemeType.DEPTH ;
|
||||||
} else if (R.style.SkyAESTheme == nThemeStyleID) {
|
} else if (R.style.SkyAESTheme == nThemeStyleID) {
|
||||||
@@ -129,8 +129,8 @@ public class AESThemeBean extends BaseBean {
|
|||||||
themeStyle = AESThemeBean.ThemeType.MEMOR ;
|
themeStyle = AESThemeBean.ThemeType.MEMOR ;
|
||||||
} else if (R.style.TaoAESTheme == nThemeStyleID) {
|
} else if (R.style.TaoAESTheme == nThemeStyleID) {
|
||||||
themeStyle = AESThemeBean.ThemeType.TAO ;
|
themeStyle = AESThemeBean.ThemeType.TAO ;
|
||||||
} else if (R.style.AESTheme == nThemeStyleID) {
|
} else if (R.style.DefaultAESTheme == nThemeStyleID) {
|
||||||
themeStyle = AESThemeBean.ThemeType.AES;
|
themeStyle = AESThemeBean.ThemeType.DEFAULT;
|
||||||
}
|
}
|
||||||
//LogUtils.d(TAG, "themeStyle " + Integer.toString(themeStyle.ordinal()));
|
//LogUtils.d(TAG, "themeStyle " + Integer.toString(themeStyle.ordinal()));
|
||||||
return themeStyle;
|
return themeStyle;
|
||||||
|
@@ -5,7 +5,7 @@ import android.content.DialogInterface;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
|
@@ -0,0 +1,170 @@
|
|||||||
|
package cc.winboll.studio.libaes.unittests;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@QQ.COM
|
||||||
|
* @Date 2024/06/14 03:43:23
|
||||||
|
* @Describe AES类库主窗口
|
||||||
|
*/
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import cc.winboll.studio.libaes.R;
|
||||||
|
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||||
|
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||||
|
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
|
||||||
|
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
|
||||||
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
|
import com.a4455jkjh.colorpicker.ColorPickerDialog;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class LibraryActivity extends DrawerFragmentActivity {
|
||||||
|
|
||||||
|
public static final String TAG = "LibraryActivity";
|
||||||
|
|
||||||
|
TestAButtonFragment mTestAButtonFragment;
|
||||||
|
TestViewPageFragment mTestViewPageFragment;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (mTestAButtonFragment == null) {
|
||||||
|
mTestAButtonFragment = new TestAButtonFragment();
|
||||||
|
addFragment(mTestAButtonFragment);
|
||||||
|
}
|
||||||
|
showFragment(mTestAButtonFragment);
|
||||||
|
setSubtitle(TAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||||
|
super.initDrawerMenuItemList(listDrawerMenu);
|
||||||
|
LogUtils.d(TAG, "initDrawerMenuItemList");
|
||||||
|
//listDrawerMenu.clear();
|
||||||
|
// 添加抽屉菜单项
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||||
|
notifyDrawerMenuDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
|
||||||
|
super.reinitDrawerMenuItemList(listDrawerMenu);
|
||||||
|
LogUtils.d(TAG, "reinitDrawerMenuItemList");
|
||||||
|
//listDrawerMenu.clear();
|
||||||
|
// 添加抽屉菜单项
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
|
||||||
|
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
|
||||||
|
notifyDrawerMenuDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DrawerFragmentActivity.ActivityType initActivityType() {
|
||||||
|
return DrawerFragmentActivity.ActivityType.Main;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.toolbar_library, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
super.onItemClick(parent, view, position, id);
|
||||||
|
switch (position) {
|
||||||
|
case 0 : {
|
||||||
|
if (mTestAButtonFragment == null) {
|
||||||
|
mTestAButtonFragment = new TestAButtonFragment();
|
||||||
|
addFragment(mTestAButtonFragment);
|
||||||
|
}
|
||||||
|
showFragment(mTestAButtonFragment);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1 : {
|
||||||
|
if (mTestViewPageFragment == null) {
|
||||||
|
mTestViewPageFragment = new TestViewPageFragment();
|
||||||
|
addFragment(mTestViewPageFragment);
|
||||||
|
}
|
||||||
|
showFragment(mTestViewPageFragment);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int nItemId = item.getItemId();
|
||||||
|
// if (item.getItemId() == R.id.item_log) {
|
||||||
|
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
|
||||||
|
// } else
|
||||||
|
if (nItemId == R.id.item_atoast) {
|
||||||
|
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (nItemId == R.id.item_atoolbar) {
|
||||||
|
Intent intent = new Intent(this, TestAToolbarActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_asupporttoolbar) {
|
||||||
|
Intent intent = new Intent(this, TestASupportToolbarActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_colordialog) {
|
||||||
|
ColorPickerDialog dlg = new ColorPickerDialog(this, getResources().getColor(R.color.colorPrimary));
|
||||||
|
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeColorChanged() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onColorChanged(int color) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterColorChanged() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
dlg.show();
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_dialogstoragepath) {
|
||||||
|
final StoragePathDialog dialog = new StoragePathDialog(this, 0);
|
||||||
|
dialog.setOnOKClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_localfileselectdialog) {
|
||||||
|
final LocalFileSelectDialog dialog = new LocalFileSelectDialog(this);
|
||||||
|
dialog.setOnOKClickListener(new LocalFileSelectDialog.OKClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onOKClick(String sz) {
|
||||||
|
Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
|
||||||
|
//dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
|
||||||
|
} else if (nItemId == R.id.item_secondarylibraryactivity) {
|
||||||
|
Intent intent = new Intent(this, SecondaryLibraryActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
} else if (nItemId == R.id.item_drawerfragmentactivity) {
|
||||||
|
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
// else if (nItemId == R.id.item_about) {
|
||||||
|
// Intent intent = new Intent(this, AboutActivity.class);
|
||||||
|
// startActivity(intent);
|
||||||
|
// }
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
@@ -4,49 +4,20 @@ import android.os.Bundle;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||||
import cc.winboll.studio.libaes.winboll.APPInfo;
|
|
||||||
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@QQ.COM
|
* @Author ZhanGSKen@QQ.COM
|
||||||
* @Date 2024/06/15 00:58:10
|
* @Date 2024/06/15 00:58:10
|
||||||
* @Describe 第二级窗口
|
* @Describe 第二级窗口
|
||||||
*/
|
*/
|
||||||
public class SecondaryLibraryActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
public class SecondaryLibraryActivity extends DrawerFragmentActivity {
|
||||||
|
|
||||||
public static final String TAG = "SecondaryLibraryActivity";
|
public static final String TAG = "SecondaryLibraryActivity";
|
||||||
|
|
||||||
SecondaryLibraryFragment mSecondaryLibraryFragment;
|
SecondaryLibraryFragment mSecondaryLibraryFragment;
|
||||||
|
|
||||||
@Override
|
|
||||||
public AppCompatActivity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -72,7 +43,7 @@ public class SecondaryLibraryActivity extends DrawerFragmentActivity implements
|
|||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int nItemId = item.getItemId();
|
int nItemId = item.getItemId();
|
||||||
if (nItemId == R.id.item_test) {
|
if (nItemId == R.id.item_test) {
|
||||||
Toast.makeText(getApplicationContext(), "item_test", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplication(), "item_test", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
@@ -9,11 +9,11 @@ import android.os.Bundle;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.views.AButton;
|
import cc.winboll.studio.libaes.views.AButton;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
|
||||||
|
|
||||||
public class TestAButtonFragment extends Fragment {
|
public class TestAButtonFragment extends Fragment {
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ public class TestAButtonFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
LogUtils.d(TAG, "onClick");
|
LogUtils.d(TAG, "onClick");
|
||||||
ToastUtils.show("AButton");
|
Toast.makeText(getActivity(), "AButton", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -10,50 +10,20 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.widget.Toolbar;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
||||||
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
|
||||||
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
|
import cc.winboll.studio.libapputils.log.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class TestDrawerFragmentActivity extends DrawerFragmentActivity implements IWinBollActivity {
|
public class TestDrawerFragmentActivity extends DrawerFragmentActivity {
|
||||||
|
|
||||||
@Override
|
|
||||||
public AppCompatActivity getActivity() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTag() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Toolbar initToolBar() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isAddWinBollToolBar() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isEnableDisplayHomeAsUp() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static final String TAG = "TestDrawerFragmentActivity";
|
public static final String TAG = "TestDrawerFragmentActivity";
|
||||||
|
|
||||||
TestFragment1 mTestFragment1;
|
TestFragment1 mTestFragment1;
|
||||||
TestFragment2 mTestFragment2;
|
TestFragment2 mTestFragment2;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -96,7 +66,7 @@ public class TestDrawerFragmentActivity extends DrawerFragmentActivity implement
|
|||||||
super.onItemClick(parent, view, position, id);
|
super.onItemClick(parent, view, position, id);
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0 : {
|
case 0 : {
|
||||||
Toast.makeText(getApplicationContext(), "0", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "0", Toast.LENGTH_SHORT).show();
|
||||||
//LogUtils.d(TAG, "MenuItem 1");
|
//LogUtils.d(TAG, "MenuItem 1");
|
||||||
showFragment(mTestFragment1);
|
showFragment(mTestFragment1);
|
||||||
break;
|
break;
|
||||||
|
@@ -5,7 +5,6 @@ package cc.winboll.studio.libaes.unittests;
|
|||||||
* @Date 2024/07/16 01:35:56
|
* @Date 2024/07/16 01:35:56
|
||||||
* @Describe TestViewPageFragment
|
* @Describe TestViewPageFragment
|
||||||
*/
|
*/
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -18,17 +17,12 @@ import androidx.viewpager.widget.ViewPager;
|
|||||||
import cc.winboll.studio.libaes.ImagePagerAdapter;
|
import cc.winboll.studio.libaes.ImagePagerAdapter;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TestViewPageFragment extends Fragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
|
public class TestViewPageFragment extends Fragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
|
||||||
|
|
||||||
public static final String TAG = "TestViewPageFragment";
|
public static final String TAG = "TestViewPageFragment";
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
LogView mLogView;
|
|
||||||
|
|
||||||
private ViewPager viewPager;
|
private ViewPager viewPager;
|
||||||
private List<View> views; //用来存放放进ViewPager里面的布局
|
private List<View> views; //用来存放放进ViewPager里面的布局
|
||||||
@@ -42,10 +36,6 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
mView = inflater.inflate(R.layout.fragment_viewpage, container, false);
|
mView = inflater.inflate(R.layout.fragment_viewpage, container, false);
|
||||||
mContext = getActivity();
|
|
||||||
|
|
||||||
mLogView = mView.findViewById(R.id.logview);
|
|
||||||
mLogView.start();
|
|
||||||
|
|
||||||
//viewPager = findViewById(R.id.activitymainViewPager1);
|
//viewPager = findViewById(R.id.activitymainViewPager1);
|
||||||
initData();
|
initData();
|
||||||
@@ -70,13 +60,12 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
|||||||
initPoint();//初始化页面下方的点
|
initPoint();//初始化页面下方的点
|
||||||
viewPager.setOnPageChangeListener(this);
|
viewPager.setOnPageChangeListener(this);
|
||||||
initAOHPCTCSeekBar();
|
initAOHPCTCSeekBar();
|
||||||
initAOHPCTCSeekBar2();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化所要显示的布局
|
//初始化所要显示的布局
|
||||||
void initData() {
|
void initData() {
|
||||||
ViewPager viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
|
ViewPager viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
View view1 = inflater.inflate(R.layout.viewpage_atickprogressbar, viewPager, false);
|
View view1 = inflater.inflate(R.layout.viewpage_atickprogressbar, viewPager, false);
|
||||||
View view2 = inflater.inflate(R.layout.viewpage_acard, viewPager, false);
|
View view2 = inflater.inflate(R.layout.viewpage_acard, viewPager, false);
|
||||||
View view3 = inflater.inflate(R.layout.viewpage_aohpctccard, viewPager, false);
|
View view3 = inflater.inflate(R.layout.viewpage_aohpctccard, viewPager, false);
|
||||||
@@ -196,31 +185,14 @@ public class TestViewPageFragment extends Fragment implements ViewPager.OnPageCh
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initAOHPCTCSeekBar() {
|
void initAOHPCTCSeekBar() {
|
||||||
AOHPCTCSeekBar seekbar = views.get(3).findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
AOHPCTCSeekBar seekbar = mView.findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
|
||||||
seekbar.setThumb(mContext.getDrawable(R.drawable.ic_launcher));
|
seekbar.setThumb(getActivity().getDrawable(R.drawable.ic_launcher));
|
||||||
//seekbar.setThumbOffset(200);
|
seekbar.setThumbOffset(10);
|
||||||
//seekbar.setThumbOffset(1);
|
|
||||||
seekbar.setBlurRightDP(50);
|
|
||||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOHPCommit() {
|
public void onOHPCommit() {
|
||||||
ToastUtils.show("onOHPCommit");
|
Toast.makeText(getActivity(), "onOHPCommit ", Toast.LENGTH_SHORT).show();
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void initAOHPCTCSeekBar2() {
|
|
||||||
AOHPCTCSeekBar seekbar = views.get(3).findViewById(R.id.fragmentviewpageAOHPCTCSeekBar2);
|
|
||||||
seekbar.setThumb(mContext.getDrawable(R.drawable.ic_call));
|
|
||||||
//seekbar.setThumbOffset(200);
|
|
||||||
//seekbar.setThumbOffset(1);
|
|
||||||
seekbar.setBlurRightDP(50);
|
|
||||||
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOHPCommit() {
|
|
||||||
ToastUtils.show("onOHPCommit 2");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,8 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import cc.winboll.studio.libaes.R;
|
import cc.winboll.studio.libaes.R;
|
||||||
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
|
|
||||||
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
import cc.winboll.studio.libaes.beans.AESThemeBean;
|
||||||
|
import cc.winboll.studio.libapputils.app.WinBollActivity;
|
||||||
|
|
||||||
public class AESThemeUtil {
|
public class AESThemeUtil {
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public class AESThemeUtil {
|
|||||||
|
|
||||||
public static <T extends Context> int getThemeTypeID(T context) {
|
public static <T extends Context> int getThemeTypeID(T context) {
|
||||||
AESThemeBean bean = AESThemeBean.loadBean(context, AESThemeBean.class);
|
AESThemeBean bean = AESThemeBean.loadBean(context, AESThemeBean.class);
|
||||||
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES): bean.getCurrentThemeTypeID();
|
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT): bean.getCurrentThemeTypeID();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends Context> void saveThemeStyleID(T context, int nThemeTypeID) {
|
public static <T extends Context> void saveThemeStyleID(T context, int nThemeTypeID) {
|
||||||
@@ -41,9 +41,9 @@ public class AESThemeUtil {
|
|||||||
activity.setTheme(getThemeTypeID(activity));
|
activity.setTheme(getThemeTypeID(activity));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
|
public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
|
||||||
activity.setTheme(getThemeTypeID(activity.getApplicationContext()));
|
activity.setTheme(getThemeTypeID(activity.getApplicationContext()));
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static <T extends Activity> void applyAppTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
public static <T extends Activity> void applyAppTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||||
@@ -53,9 +53,9 @@ public class AESThemeUtil {
|
|||||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
|
||||||
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static <T extends Activity> void inflateMenu(T activity, Menu menu) {
|
public static <T extends Activity> void inflateMenu(T activity, Menu menu) {
|
||||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||||
@@ -65,9 +65,9 @@ public class AESThemeUtil {
|
|||||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
|
public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
|
||||||
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static <T extends Activity> boolean onAppThemeItemSelected(T activity, MenuItem item) {
|
public static <T extends Activity> boolean onAppThemeItemSelected(T activity, MenuItem item) {
|
||||||
int nThemeStyleID;
|
int nThemeStyleID;
|
||||||
@@ -92,7 +92,7 @@ public class AESThemeUtil {
|
|||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public class AESThemeUtil {
|
|||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||||
saveThemeStyleID(activity, nThemeStyleID);
|
saveThemeStyleID(activity, nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public class AESThemeUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends AppCompatActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
public static <T extends WinBollActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
||||||
int nThemeStyleID;
|
int nThemeStyleID;
|
||||||
if (R.id.item_depththeme == item.getItemId()) {
|
if (R.id.item_depththeme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
||||||
@@ -154,38 +154,7 @@ public class AESThemeUtil {
|
|||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T extends DrawerFragmentActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
|
|
||||||
int nThemeStyleID;
|
|
||||||
if (R.id.item_depththeme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_skytheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_goldentheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_memortheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.MEMOR);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_taotheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
|
||||||
return true;
|
|
||||||
} else if (R.id.item_defaulttheme == item.getItemId()) {
|
|
||||||
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.AES);
|
|
||||||
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -6,30 +6,24 @@ package cc.winboll.studio.libaes.views;
|
|||||||
* @Describe AOneHundredPercantClickToCommitSeekBar
|
* @Describe AOneHundredPercantClickToCommitSeekBar
|
||||||
*/
|
*/
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
|
||||||
|
|
||||||
public class AOHPCTCSeekBar extends SeekBar {
|
public class AOHPCTCSeekBar extends SeekBar {
|
||||||
|
|
||||||
public static final String TAG = "AOHPCTCSeekBar";
|
public static final String TAG = "AOHPCTCSeekBar";
|
||||||
|
|
||||||
volatile int thumbWidth = 1;
|
// 可开始拉动的起始位置(百分比值)
|
||||||
volatile int progressBarWidth = 1;
|
static final int ENABLE_POST_PERCENT_X = 20;
|
||||||
// 设置按钮模糊右边边缘像素
|
// 最小拉动值,滑块拉动值要超过这个值,确定事件才会提交。
|
||||||
volatile int blurRightDP = 1;
|
static final int TO_MIN_VALUE = 15;
|
||||||
// 是否从起点拉动的标志
|
|
||||||
volatile boolean isStartSeek = false;
|
|
||||||
|
|
||||||
// 外部接口对象,确定事件提交会调用该对象的方法
|
// 外部接口对象,确定事件提交会调用该对象的方法
|
||||||
OnOHPCListener mOnOHPCListener;
|
OnOHPCListener mOnOHPCListener;
|
||||||
|
// 是否从起点拉动的标志
|
||||||
|
boolean mIsStartTo = false;
|
||||||
public void setBlurRightDP(int blurRight) {
|
// 拉动的滑动值
|
||||||
this.blurRightDP = blurRight;
|
int mnTo = 0;
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnOHPCListener(OnOHPCListener listener) {
|
public void setOnOHPCListener(OnOHPCListener listener) {
|
||||||
mOnOHPCListener = listener;
|
mOnOHPCListener = listener;
|
||||||
@@ -41,68 +35,83 @@ public class AOHPCTCSeekBar extends SeekBar {
|
|||||||
|
|
||||||
public AOHPCTCSeekBar(Context context) {
|
public AOHPCTCSeekBar(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
initView(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AOHPCTCSeekBar(Context context, AttributeSet attrs) {
|
public AOHPCTCSeekBar(Context context, AttributeSet attrs) {
|
||||||
super(context, 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) {
|
public AOHPCTCSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
initView(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void initView(Context context) {
|
@Override
|
||||||
|
protected void onFinishInflate() {
|
||||||
|
super.onFinishInflate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||||
if (thumbWidth + blurRightDP > event.getX() && event.getX() > 0) {
|
//LogUtils.d(TAG, "ACTION_DOWN");
|
||||||
getParent().requestDisallowInterceptTouchEvent(true);
|
// 有效的拖动起始位置(ENABLE_POST_PERCENT_X)%
|
||||||
isStartSeek = true;
|
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) {
|
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||||
if (isStartSeek) {
|
//LogUtils.d(TAG, "ACTION_MOVE");
|
||||||
super.dispatchTouchEvent(event);
|
if (mIsStartTo) {
|
||||||
|
mnTo++;
|
||||||
}
|
}
|
||||||
} else if (event.getAction() == MotionEvent.ACTION_UP
|
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||||
|| event.getAction() == MotionEvent.ACTION_CANCEL) {
|
//LogUtils.d(TAG, Integer.toString(getProgress()));
|
||||||
getParent().requestDisallowInterceptTouchEvent(false);
|
// 提交100%确定事件
|
||||||
if (getProgress() == progressBarWidth) {
|
if ((getProgress() == 100) && (mnTo > TO_MIN_VALUE)) {
|
||||||
|
//LogUtils.d(TAG, "Commit mnTo is " + Integer.toString(mnTo));
|
||||||
mOnOHPCListener.onOHPCommit();
|
mOnOHPCListener.onOHPCommit();
|
||||||
|
//resetView();
|
||||||
|
//return true;
|
||||||
}
|
}
|
||||||
// 重置控件状态
|
resetView();
|
||||||
setProgress(0);
|
return false;
|
||||||
isStartSeek = false;
|
|
||||||
}
|
}
|
||||||
return true;
|
//LogUtils.d(TAG, "dispatchTouchEvent End");
|
||||||
|
return super.dispatchTouchEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// 重置控件状态
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
//
|
||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
void resetView() {
|
||||||
int width = MeasureSpec.getSize(widthMeasureSpec);
|
setProgress(0);
|
||||||
//int height = MeasureSpec.getSize(heightMeasureSpec);
|
mnTo = 0;
|
||||||
//LogUtils.d(TAG, String.format("width %d height %d", width, height));
|
mIsStartTo = false;
|
||||||
|
|
||||||
// 获取SeekBar的图标宽度
|
|
||||||
Drawable thumbDrawable = getThumb();
|
|
||||||
if (thumbDrawable != null) {
|
|
||||||
// 获取图标宽度
|
|
||||||
thumbWidth = thumbDrawable.getIntrinsicWidth();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取进度条宽度
|
|
||||||
progressBarWidth = width;
|
|
||||||
|
|
||||||
//LogUtils.d(TAG, String.format("thumbWidth %d progressBarWidth %d", thumbWidth, progressBarWidth));
|
|
||||||
|
|
||||||
// 设置图标位置
|
|
||||||
setThumbOffset(0);
|
|
||||||
// 设置进度条刻度
|
|
||||||
setMax(progressBarWidth);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,142 +0,0 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/01/20 14:19:02
|
|
||||||
* @Describe 应用信息类
|
|
||||||
*/
|
|
||||||
import cc.winboll.studio.libaes.R;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class APPInfo implements Serializable {
|
|
||||||
|
|
||||||
public static final String TAG = "APPInfo";
|
|
||||||
|
|
||||||
// 应用名称
|
|
||||||
String appName;
|
|
||||||
// 应用图标
|
|
||||||
int appIcon;
|
|
||||||
// 应用描述
|
|
||||||
String appDescription;
|
|
||||||
// 应用Git仓库地址
|
|
||||||
String appGitName;
|
|
||||||
// 应用Git仓库拥有者
|
|
||||||
String appGitOwner;
|
|
||||||
// 应用Git仓库分支
|
|
||||||
String appGitAPPBranch;
|
|
||||||
// 应用Git仓库子项目文件夹
|
|
||||||
String appGitAPPSubProjectFolder;
|
|
||||||
// 应用主页
|
|
||||||
String appHomePage;
|
|
||||||
// 应用包名称
|
|
||||||
String appAPKName;
|
|
||||||
// 应用包存储文件夹名称
|
|
||||||
String appAPKFolderName;
|
|
||||||
|
|
||||||
public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitOwner, String appGitAPPBranch, String appGitAPPSubProjectFolder, String appHomePage, String appAPKName, String appAPKFolderName) {
|
|
||||||
this.appName = appName;
|
|
||||||
this.appIcon = appIcon;
|
|
||||||
this.appDescription = appDescription;
|
|
||||||
this.appGitName = appGitName;
|
|
||||||
this.appGitOwner = appGitOwner;
|
|
||||||
this.appGitAPPBranch = appGitAPPBranch;
|
|
||||||
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
|
||||||
this.appHomePage = appHomePage;
|
|
||||||
this.appAPKName = appAPKName;
|
|
||||||
this.appAPKFolderName = appAPKFolderName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public APPInfo() {
|
|
||||||
this.appName = "WinBoll-APP";
|
|
||||||
this.appIcon = R.drawable.ic_launcher;
|
|
||||||
this.appDescription = "WinBoll APP";
|
|
||||||
this.appGitName = "APP";
|
|
||||||
this.appGitOwner = "Studio";
|
|
||||||
this.appGitAPPBranch = "app";
|
|
||||||
this.appGitAPPSubProjectFolder = "app";
|
|
||||||
this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP";
|
|
||||||
this.appAPKName = "APP";
|
|
||||||
this.appAPKFolderName = "APP";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppGitOwner(String appGitOwner) {
|
|
||||||
this.appGitOwner = appGitOwner;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppGitOwner() {
|
|
||||||
return appGitOwner;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppGitAPPBranch(String appGitAPPBranch) {
|
|
||||||
this.appGitAPPBranch = appGitAPPBranch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppGitAPPBranch() {
|
|
||||||
return appGitAPPBranch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppGitAPPSubProjectFolder(String appGitAPPSubProjectFolder) {
|
|
||||||
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppGitAPPSubProjectFolder() {
|
|
||||||
return appGitAPPSubProjectFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppIcon(int appIcon) {
|
|
||||||
this.appIcon = appIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAppIcon() {
|
|
||||||
return appIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppDescription(String appDescription) {
|
|
||||||
this.appDescription = appDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppDescription() {
|
|
||||||
return appDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppAPKFolderName(String appAPKFolderName) {
|
|
||||||
this.appAPKFolderName = appAPKFolderName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppAPKFolderName() {
|
|
||||||
return appAPKFolderName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppName(String appName) {
|
|
||||||
this.appName = appName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppName() {
|
|
||||||
return appName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppGitName(String appGitName) {
|
|
||||||
this.appGitName = appGitName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppGitName() {
|
|
||||||
return appGitName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppHomePage(String appHomePage) {
|
|
||||||
this.appHomePage = appHomePage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppHomePage() {
|
|
||||||
return appHomePage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppAPKName(String appAPKName) {
|
|
||||||
this.appAPKName = appAPKName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppAPKName() {
|
|
||||||
return appAPKName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@@ -1,62 +0,0 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/24 16:39:29
|
|
||||||
* @Describe WinBoll Android 应用介绍窗口
|
|
||||||
*/
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import cc.winboll.studio.libaes.R;
|
|
||||||
|
|
||||||
final public class AboutActivity extends Activity {
|
|
||||||
|
|
||||||
public static final String TAG = "AboutActivity";
|
|
||||||
|
|
||||||
public static final String EXTRA_APPINFO = "EXTRA_APPINFO";
|
|
||||||
|
|
||||||
APPInfo mAPPInfo;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Context getApplicationContext() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_about);
|
|
||||||
Intent intent = getIntent();
|
|
||||||
if (intent != null) {
|
|
||||||
mAPPInfo = (APPInfo)intent.getSerializableExtra(EXTRA_APPINFO);
|
|
||||||
}
|
|
||||||
if (mAPPInfo == null) {
|
|
||||||
mAPPInfo = new APPInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
AboutView aboutView = new AboutView(this, mAPPInfo);
|
|
||||||
LinearLayout llMain = findViewById(R.id.aboutroot_ll);
|
|
||||||
llMain.addView(aboutView);
|
|
||||||
|
|
||||||
//ToastUtils.show(TAG);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.toolbar_winboll_shared_about, menu);
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
// if (item.getItemId() == R.id.item_help) {
|
|
||||||
// WinBollActivityManager.getInstance(this).startWinBollActivity(this, AssetsHtmlActivity.class);
|
|
||||||
// }
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,55 +0,0 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/02/06 08:45:23
|
|
||||||
* @Describe 关于活动窗口的介绍窗口工厂
|
|
||||||
*/
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import cc.winboll.studio.libaes.R;
|
|
||||||
import cc.winboll.studio.libaes.winboll.AboutActivityFactory;
|
|
||||||
|
|
||||||
public class AboutActivityFactory {
|
|
||||||
|
|
||||||
public static final String TAG = "AboutActivityFactory";
|
|
||||||
|
|
||||||
public static APPInfo buildDefaultAPPInfo() {
|
|
||||||
String szBranchName = "";
|
|
||||||
|
|
||||||
APPInfo appInfo = new APPInfo();
|
|
||||||
appInfo.setAppName("APP");
|
|
||||||
appInfo.setAppIcon(R.drawable.ic_winboll);
|
|
||||||
appInfo.setAppDescription("APP Description");
|
|
||||||
appInfo.setAppGitName("APP");
|
|
||||||
appInfo.setAppGitOwner("Studio");
|
|
||||||
appInfo.setAppGitAPPBranch(szBranchName);
|
|
||||||
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
|
|
||||||
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=APP");
|
|
||||||
appInfo.setAppAPKName("APP");
|
|
||||||
appInfo.setAppAPKFolderName("APP");
|
|
||||||
return appInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void showAboutActivity(Context context, APPInfo appInfo) {
|
|
||||||
/*String szPN = ((IWinBollActivity)context).getActivityPackageName();
|
|
||||||
//String szPN = context.getPackageName();
|
|
||||||
String szBranchName = "";
|
|
||||||
if (szPN != null) {
|
|
||||||
//String szPN = "cc.winboll.studio.apputils.beta";
|
|
||||||
String regex = "cc\\.winboll\\.studio\\.([^.]+)\\.*";
|
|
||||||
Pattern pattern = Pattern.compile(regex);
|
|
||||||
Matcher matcher = pattern.matcher(szPN);
|
|
||||||
if (matcher.find()) {
|
|
||||||
szBranchName = matcher.group(1);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
//ToastUtils.show(szPN);
|
|
||||||
|
|
||||||
Intent intent = new Intent(context, AboutActivity.class);
|
|
||||||
intent.putExtra(AboutActivity.EXTRA_APPINFO, (appInfo == null) ? AboutActivityFactory.buildDefaultAPPInfo():appInfo);
|
|
||||||
context.startActivity(intent);
|
|
||||||
//WinBollActivityManager.getInstance(context).startWinBollActivity(context, intent, AboutActivity.class);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,393 +0,0 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/24 15:08:52
|
|
||||||
* @Describe WinBoll应用介绍视图
|
|
||||||
*/
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import cc.winboll.studio.libaes.R;
|
|
||||||
import cc.winboll.studio.libaes.beans.AESModel;
|
|
||||||
import cc.winboll.studio.libappbase.GlobalApplication;
|
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
|
||||||
import cc.winboll.studio.libapputils.app.AppVersionUtils;
|
|
||||||
import cc.winboll.studio.libapputils.util.PrefUtils;
|
|
||||||
import cc.winboll.studio.libapputils.view.WinBollServiceStatusView;
|
|
||||||
import cc.winboll.studio.libapputils.view.YesNoAlertDialog;
|
|
||||||
import java.io.IOException;
|
|
||||||
import mehdi.sakout.aboutpage.AboutPage;
|
|
||||||
import mehdi.sakout.aboutpage.Element;
|
|
||||||
import okhttp3.Call;
|
|
||||||
import okhttp3.Callback;
|
|
||||||
import okhttp3.Credentials;
|
|
||||||
import okhttp3.OkHttpClient;
|
|
||||||
import okhttp3.Request;
|
|
||||||
import okhttp3.Response;
|
|
||||||
|
|
||||||
public class AboutView extends LinearLayout {
|
|
||||||
|
|
||||||
public static final String TAG = "AboutView";
|
|
||||||
|
|
||||||
public static final int MSG_APPUPDATE_CHECKED = 0;
|
|
||||||
|
|
||||||
Context mContext;
|
|
||||||
APPInfo mAPPInfo;
|
|
||||||
|
|
||||||
WinBollServiceStatusView mWinBollServiceStatusView;
|
|
||||||
OnRequestDevUserInfoAutofillListener mOnRequestDevUserInfoAutofillListener;
|
|
||||||
String mszAppName = "";
|
|
||||||
String mszAppAPKFolderName = "";
|
|
||||||
String mszAppAPKName = "";
|
|
||||||
String mszAppGitName = "";
|
|
||||||
String mszAppVersionName = "";
|
|
||||||
String mszCurrentAppPackageName = "";
|
|
||||||
volatile String mszNewestAppPackageName = "";
|
|
||||||
String mszAppDescription = "";
|
|
||||||
String mszHomePage = "";
|
|
||||||
String mszGitea = "";
|
|
||||||
int mnAppIcon = 0;
|
|
||||||
String mszWinBollServerHost;
|
|
||||||
String mszReleaseAPKName;
|
|
||||||
EditText metDevUserName;
|
|
||||||
EditText metDevUserPassword;
|
|
||||||
|
|
||||||
public AboutView(Context context, APPInfo appInfo) {
|
|
||||||
super(context);
|
|
||||||
mContext = context;
|
|
||||||
|
|
||||||
setAPPInfo(appInfo);
|
|
||||||
initView(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AboutView(Context context, AttributeSet attrs) {
|
|
||||||
super(context, attrs);
|
|
||||||
mContext = context;
|
|
||||||
|
|
||||||
initView(context, attrs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAPPInfo(APPInfo appInfo) {
|
|
||||||
mAPPInfo = appInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
APPInfo createAppInfo(Context context, AttributeSet attrs) {
|
|
||||||
APPInfo appInfo = new APPInfo();
|
|
||||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.AboutView);
|
|
||||||
appInfo.setAppName(typedArray.getString(R.styleable.AboutView_app_name));
|
|
||||||
appInfo.setAppAPKFolderName(typedArray.getString(R.styleable.AboutView_app_apkfoldername));
|
|
||||||
appInfo.setAppAPKName(typedArray.getString(R.styleable.AboutView_app_apkname));
|
|
||||||
appInfo.setAppGitName(typedArray.getString(R.styleable.AboutView_app_gitname));
|
|
||||||
appInfo.setAppGitOwner(typedArray.getString(R.styleable.AboutView_app_gitowner));
|
|
||||||
appInfo.setAppGitAPPBranch(typedArray.getString(R.styleable.AboutView_app_gitappbranch));
|
|
||||||
appInfo.setAppGitAPPSubProjectFolder(typedArray.getString(R.styleable.AboutView_app_gitappsubprojectfolder));
|
|
||||||
appInfo.setAppDescription(typedArray.getString(R.styleable.AboutView_appdescription));
|
|
||||||
appInfo.setAppIcon(typedArray.getResourceId(R.styleable.AboutView_appicon, R.drawable.ic_winboll));
|
|
||||||
// 返回一个绑定资源结束的信号给资源
|
|
||||||
typedArray.recycle();
|
|
||||||
return appInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
void initView(Context context) {
|
|
||||||
mszAppName = mAPPInfo.getAppName();
|
|
||||||
mszAppAPKFolderName = mAPPInfo.getAppAPKFolderName();
|
|
||||||
mszAppAPKName = mAPPInfo.getAppAPKName();
|
|
||||||
mszAppGitName = mAPPInfo.getAppGitName();
|
|
||||||
mszAppDescription = mAPPInfo.getAppDescription();
|
|
||||||
mnAppIcon = mAPPInfo.getAppIcon();
|
|
||||||
|
|
||||||
mszWinBollServerHost = GlobalApplication.isDebuging() ? "https://dev.winboll.cc": "https://www.winboll.cc";
|
|
||||||
|
|
||||||
try {
|
|
||||||
mszAppVersionName = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
|
||||||
mszCurrentAppPackageName = mszAppAPKName + "_" + mszAppVersionName + ".apk";
|
|
||||||
mszHomePage = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
|
|
||||||
if (mAPPInfo.getAppGitAPPBranch().equals("")) {
|
|
||||||
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName;
|
|
||||||
} else {
|
|
||||||
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName + "/src/branch/" + mAPPInfo.getAppGitAPPBranch() + "/" + mAPPInfo.getAppGitAPPSubProjectFolder();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GlobalApplication.isDebuging()) {
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
|
||||||
View addedView = inflater.inflate(R.layout.view_about_dev, this, false);
|
|
||||||
LinearLayout llMain = addedView.findViewById(R.id.viewaboutdevLinearLayout1);
|
|
||||||
metDevUserName = addedView.findViewById(R.id.viewaboutdevEditText1);
|
|
||||||
metDevUserPassword = addedView.findViewById(R.id.viewaboutdevEditText2);
|
|
||||||
metDevUserName.setText(PrefUtils.getString(mContext, "metDevUserName", ""));
|
|
||||||
metDevUserPassword.setText(PrefUtils.getString(mContext, "metDevUserPassword", ""));
|
|
||||||
//mDevelopHostConnectionStatusView = new DevelopHostConnectionStatusView(context);
|
|
||||||
mWinBollServiceStatusView = addedView.findViewById(R.id.viewaboutdevWinBollServiceStatusView1);
|
|
||||||
mWinBollServiceStatusView.setServerHost(mszWinBollServerHost);
|
|
||||||
mWinBollServiceStatusView.setAuthInfo(metDevUserName.getText().toString(), metDevUserPassword.getText().toString());
|
|
||||||
//llMain.addView(mDevelopHostConnectionStatusView);
|
|
||||||
llMain.addView(createAboutPage());
|
|
||||||
addView(addedView);
|
|
||||||
} else {
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
|
||||||
View addedView = inflater.inflate(R.layout.view_about_www, this, false);
|
|
||||||
LinearLayout llMain = addedView.findViewById(R.id.viewaboutwwwLinearLayout1);
|
|
||||||
//mDevelopHostConnectionStatusView = new DevelopHostConnectionStatusView(context);
|
|
||||||
mWinBollServiceStatusView = addedView.findViewById(R.id.viewaboutwwwWinBollServiceStatusView1);
|
|
||||||
mWinBollServiceStatusView.setServerHost(mszWinBollServerHost);
|
|
||||||
mWinBollServiceStatusView.setAuthInfo("", "");
|
|
||||||
//llMain.addView(mDevelopHostConnectionStatusView);
|
|
||||||
llMain.addView(createAboutPage());
|
|
||||||
addView(addedView);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化标题栏
|
|
||||||
//setSubtitle(getContext().getString(R.string.text_about));
|
|
||||||
|
|
||||||
// LinearLayout llMain = findViewById(R.id.viewaboutLinearLayout1);
|
|
||||||
// llMain.addView(createAboutPage());
|
|
||||||
|
|
||||||
// 就读取正式版应用包版本号,设置 Release 应用包文件名
|
|
||||||
String szReleaseAppVersionName = "";
|
|
||||||
try {
|
|
||||||
//LogUtils.d(TAG, String.format("mContext.getPackageName() %s", mContext.getPackageName()));
|
|
||||||
String szSubBetaSuffix = subBetaSuffix(mContext.getPackageName());
|
|
||||||
//LogUtils.d(TAG, String.format("szSubBetaSuffix : %s", szSubBetaSuffix));
|
|
||||||
szReleaseAppVersionName = mContext.getPackageManager().getPackageInfo(szSubBetaSuffix, 0).versionName;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
|
||||||
mszReleaseAPKName = mszAppAPKName + "_" + szReleaseAppVersionName + ".apk";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void initView(Context context, AttributeSet attrs) {
|
|
||||||
mAPPInfo = createAppInfo(context, attrs);
|
|
||||||
initView(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String subBetaSuffix(String input) {
|
|
||||||
if (input.endsWith(".beta")) {
|
|
||||||
return input.substring(0, input.length() - ".beta".length());
|
|
||||||
}
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
android.os.Handler mHandler = new android.os.Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg) {
|
|
||||||
super.handleMessage(msg);
|
|
||||||
switch (msg.what) {
|
|
||||||
case MSG_APPUPDATE_CHECKED : {
|
|
||||||
/*//检查当前应用包文件名是否是测试版,如果是就忽略检查
|
|
||||||
if(mszCurrentAppPackageName.matches(".*_\\d+\\.\\d+\\.\\d+-beta.*\\.apk")) {
|
|
||||||
ToastUtils.show("APP is the beta Version. Version check ignore.");
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// if (!AppVersionUtils.isHasNewStageReleaseVersion(mszReleaseAPKName, mszNewestAppPackageName)) {
|
|
||||||
// ToastUtils.delayedShow("Current app is the newest.", 5000);
|
|
||||||
// }
|
|
||||||
if (!AppVersionUtils.isHasNewVersion2(mszCurrentAppPackageName, mszNewestAppPackageName)) {
|
|
||||||
ToastUtils.show("Current app is the newest.");
|
|
||||||
} else {
|
|
||||||
String szMsg = "Current app is :\n[ " + mszCurrentAppPackageName
|
|
||||||
+ " ]\nThe last app is :\n[ " + mszNewestAppPackageName
|
|
||||||
+ " ]\nIs download the last app?";
|
|
||||||
YesNoAlertDialog.show(mContext, "Application Update Prompt", szMsg, mIsDownlaodUpdateListener);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
protected View createAboutPage() {
|
|
||||||
// 定义应用调试按钮
|
|
||||||
//
|
|
||||||
Element elementAppMode;
|
|
||||||
if (GlobalApplication.isDebuging()) {
|
|
||||||
elementAppMode = new Element(mContext.getString(R.string.app_normal), R.drawable.ic_winboll);
|
|
||||||
elementAppMode.setOnClickListener(mAppNormalOnClickListener);
|
|
||||||
} else {
|
|
||||||
elementAppMode = new Element(mContext.getString(R.string.app_debug), R.drawable.ic_winboll);
|
|
||||||
elementAppMode.setOnClickListener(mAppDebugOnClickListener);
|
|
||||||
}
|
|
||||||
// 定义 GitWeb 按钮
|
|
||||||
//
|
|
||||||
Element elementGitWeb = new Element(mContext.getString(R.string.gitea_home), R.drawable.ic_winboll);
|
|
||||||
elementGitWeb.setOnClickListener(mGitWebOnClickListener);
|
|
||||||
// 定义检查更新按钮
|
|
||||||
//
|
|
||||||
Element elementAppUpdate = new Element(mContext.getString(R.string.app_update), R.drawable.ic_winboll);
|
|
||||||
elementAppUpdate.setOnClickListener(mAppUpdateOnClickListener);
|
|
||||||
|
|
||||||
String szAppInfo = "";
|
|
||||||
try {
|
|
||||||
szAppInfo = mszAppName + " "
|
|
||||||
+ mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName
|
|
||||||
+ "\n" + mszAppDescription;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
|
||||||
View aboutPage = new AboutPage(mContext)
|
|
||||||
.setDescription(szAppInfo)
|
|
||||||
//.isRTL(false)
|
|
||||||
//.setCustomFont(String) // or Typeface
|
|
||||||
.setImage(mnAppIcon)
|
|
||||||
//.addItem(versionElement)
|
|
||||||
//.addItem(adsElement)
|
|
||||||
//.addGroup("Connect with us")
|
|
||||||
.addEmail("ZhanGSKen@AliYun.Com")
|
|
||||||
.addWebsite(mszHomePage)
|
|
||||||
.addItem(elementAppMode)
|
|
||||||
.addItem(elementGitWeb)
|
|
||||||
.addItem(elementAppUpdate)
|
|
||||||
//.addFacebook("the.medy")
|
|
||||||
//.addTwitter("medyo80")
|
|
||||||
//.addYoutube("UCdPQtdWIsg7_pi4mrRu46vA")
|
|
||||||
//.addPlayStore("com.ideashower.readitlater.pro")
|
|
||||||
//.addGitHub("medyo")
|
|
||||||
//.addInstagram("medyo80")
|
|
||||||
.create();
|
|
||||||
return aboutPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
View.OnClickListener mAppDebugOnClickListener = new View.OnClickListener(){
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
setApp2DebugMode(mContext);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
View.OnClickListener mAppNormalOnClickListener = new View.OnClickListener(){
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
setApp2NormalMode(mContext);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void setApp2DebugMode(Context context) {
|
|
||||||
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
|
|
||||||
if (intent != null) {
|
|
||||||
intent.setAction(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
GlobalApplication.setIsDebuging(context, true);
|
|
||||||
AESModel.saveBean(context, new AESModel(true));
|
|
||||||
|
|
||||||
WinBollActivityManager.getInstance(context).finishAll();
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setApp2NormalMode(Context context) {
|
|
||||||
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
|
|
||||||
if (intent != null) {
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
GlobalApplication.setIsDebuging(context, false);
|
|
||||||
AESModel.saveBean(context, new AESModel(false));
|
|
||||||
|
|
||||||
WinBollActivityManager.getInstance(context).finishAll();
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
View.OnClickListener mGitWebOnClickListener = new View.OnClickListener(){
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(mszGitea));
|
|
||||||
mContext.startActivity(browserIntent);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
View.OnClickListener mAppUpdateOnClickListener = new View.OnClickListener(){
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
ToastUtils.show("Start app update checking.");
|
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
String szUrl = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
|
|
||||||
// 构建包含认证信息的请求
|
|
||||||
String credential = "";
|
|
||||||
if (GlobalApplication.isDebuging()) {
|
|
||||||
credential = Credentials.basic(metDevUserName.getText().toString(), metDevUserPassword.getText().toString());
|
|
||||||
PrefUtils.saveString(mContext, "metDevUserName", metDevUserName.getText().toString());
|
|
||||||
PrefUtils.saveString(mContext, "metDevUserPassword", metDevUserPassword.getText().toString());
|
|
||||||
} else {
|
|
||||||
credential = Credentials.basic("WinBoll", "WinBollPowerByZhanGSKen");
|
|
||||||
}
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
|
||||||
Request request = new Request.Builder()
|
|
||||||
.url(szUrl)
|
|
||||||
.header("Accept", "text/plain") // 设置正确的Content-Type头
|
|
||||||
.header("Authorization", credential)
|
|
||||||
.build();
|
|
||||||
Call call = client.newCall(request);
|
|
||||||
call.enqueue(new Callback() {
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call call, IOException e) {
|
|
||||||
// 处理网络请求失败
|
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call call, Response response) throws IOException {
|
|
||||||
if (!response.isSuccessful()) {
|
|
||||||
LogUtils.d(TAG, "Unexpected code " + response, Thread.currentThread().getStackTrace());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 读取响应体作为字符串,注意这里可能需要解码
|
|
||||||
String text = response.body().string();
|
|
||||||
org.jsoup.nodes.Document doc = org.jsoup.Jsoup.parse(text);
|
|
||||||
LogUtils.v(TAG, doc.text());
|
|
||||||
|
|
||||||
// 使用id选择器找到具有特定id的元素
|
|
||||||
org.jsoup.nodes.Element elementWithId = doc.select("#LastRelease").first(); // 获取第一个匹配的元素
|
|
||||||
|
|
||||||
// 提取并打印元素的文本内容
|
|
||||||
mszNewestAppPackageName = elementWithId.text();
|
|
||||||
//ToastUtils.delayedShow(text + "\n" + mszNewestAppPackageName, 5000);
|
|
||||||
|
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_APPUPDATE_CHECKED));
|
|
||||||
} catch (Exception e) {
|
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
YesNoAlertDialog.OnDialogResultListener mIsDownlaodUpdateListener = new YesNoAlertDialog.OnDialogResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onYes() {
|
|
||||||
String szUrl = mszWinBollServerHost + "/studio/download.php?appname=" + mszAppAPKFolderName + "&apkname=" + mszNewestAppPackageName;
|
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(szUrl));
|
|
||||||
mContext.startActivity(browserIntent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNo() {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public interface OnRequestDevUserInfoAutofillListener {
|
|
||||||
void requestAutofill(EditText etDevUserName, EditText etDevUserPassword);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnRequestDevUserInfoAutofillListener(OnRequestDevUserInfoAutofillListener l) {
|
|
||||||
mOnRequestDevUserInfoAutofillListener = l;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,21 +0,0 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
|
||||||
* @Date 2025/03/24 08:23:40
|
|
||||||
* @Describe WinBoll 活动窗口通用接口
|
|
||||||
*/
|
|
||||||
import android.widget.Toolbar;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
public interface IWinBollActivity {
|
|
||||||
|
|
||||||
public static final String TAG = "IWinBollActivity";
|
|
||||||
|
|
||||||
// 获取应用资源上下文
|
|
||||||
abstract public AppCompatActivity getActivity();
|
|
||||||
abstract public String getTag();
|
|
||||||
abstract public Toolbar initToolBar();
|
|
||||||
abstract public boolean isEnableDisplayHomeAsUp();
|
|
||||||
abstract public boolean isAddWinBollToolBar();
|
|
||||||
}
|
|
@@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
||||||
<!-- 阴影部分 -->
|
|
||||||
<!-- 个人觉得更形象的表达:top代表下边的阴影高度,left代表右边的阴影宽度。其实也就是相对应的offset,solid中的颜色是阴影的颜色,也可以设置角度等等 -->
|
|
||||||
<item
|
|
||||||
android:left="2dp"
|
|
||||||
android:top="2dp"
|
|
||||||
android:right="2dp"
|
|
||||||
android:bottom="2dp">
|
|
||||||
<shape android:shape="rectangle" >
|
|
||||||
<gradient
|
|
||||||
android:angle="270"
|
|
||||||
android:endColor="#0F000000"
|
|
||||||
android:startColor="#0F000000" />
|
|
||||||
<corners
|
|
||||||
android:bottomLeftRadius="6dip"
|
|
||||||
android:bottomRightRadius="6dip"
|
|
||||||
android:topLeftRadius="6dip"
|
|
||||||
android:topRightRadius="6dip" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<!-- 背景部分 -->
|
|
||||||
<!-- 形象的表达:bottom代表背景部分在上边缘超出阴影的高度,right代表背景部分在左边超出阴影的宽度(相对应的offset) -->
|
|
||||||
<item
|
|
||||||
android:left="3dp"
|
|
||||||
android:top="3dp"
|
|
||||||
android:right="3dp"
|
|
||||||
android:bottom="5dp">
|
|
||||||
<shape android:shape="rectangle" >
|
|
||||||
<gradient
|
|
||||||
android:angle="270"
|
|
||||||
android:endColor="@color/colorAccent"
|
|
||||||
android:startColor="@color/colorAccent" />
|
|
||||||
<corners
|
|
||||||
android:bottomLeftRadius="6dip"
|
|
||||||
android:bottomRightRadius="6dip"
|
|
||||||
android:topLeftRadius="6dip"
|
|
||||||
android:topRightRadius="6dip" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
</layer-list>
|
|
@@ -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>
|
|
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:clickable="true">
|
|
||||||
<item
|
|
||||||
android:width="256dp"
|
|
||||||
android:height="256dp"
|
|
||||||
android:left="0dp"
|
|
||||||
android:top="0dp"
|
|
||||||
android:right="0dp"
|
|
||||||
android:bottom="0dp"
|
|
||||||
android:drawable="@drawable/winboll_logo">
|
|
||||||
</item>
|
|
||||||
</layer-list>
|
|
@@ -1,170 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="108dp"
|
|
||||||
android:height="108dp"
|
|
||||||
android:viewportWidth="108"
|
|
||||||
android:viewportHeight="108">
|
|
||||||
<path
|
|
||||||
android:fillColor="@color/colorPrimary"
|
|
||||||
android:pathData="M0,0h108v108h-108z" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M9,0L9,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,0L19,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,0L29,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,0L39,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,0L49,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,0L59,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,0L69,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,0L79,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M89,0L89,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M99,0L99,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,9L108,9"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,19L108,19"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,29L108,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,39L108,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,49L108,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,59L108,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,69L108,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,79L108,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,89L108,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,99L108,99"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,29L89,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,39L89,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,49L89,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,59L89,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,69L89,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,79L89,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,19L29,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,19L39,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,19L49,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,19L59,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,19L69,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,19L79,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
</vector>
|
|
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportHeight="24"
|
|
||||||
android:viewportWidth="24">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FFFFFFFF"
|
|
||||||
android:pathData="M16.61,15.15C16.15,15.15 15.77,14.78 15.77,14.32S16.15,13.5 16.61,13.5H16.61C17.07,13.5 17.45,13.86 17.45,14.32C17.45,14.78 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,14.78 6.57,14.32C6.57,13.86 6.95,13.5 7.41,13.5H7.41C7.87,13.5 8.24,13.86 8.24,14.32C8.24,14.78 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14H16.91Z"/>
|
|
||||||
</vector>
|
|
@@ -1,11 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:id="@+id/aboutroot_ll">
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/activitylibraryFrameLayout1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@@ -2,7 +2,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
@@ -12,49 +12,49 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="AOHPCTCSeekBar"/>
|
android:text="AOHPCTCSeekBar"/>
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="300dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1.0"
|
android:id="@+id/fragmentviewpageAOHPCTCSeekBar1"/>
|
||||||
android:id="@+id/fragmentviewpageViewPager1"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="0dp"
|
||||||
android:orientation="horizontal"
|
android:layout_weight="1.0"
|
||||||
android:gravity="center"
|
android:id="@+id/fragmentviewpageViewPager1"/>
|
||||||
android:id="@+id/fragmentviewpageLinearLayout1">
|
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="60dp"
|
||||||
android:layout_margin="5dp"
|
android:orientation="horizontal"
|
||||||
tools:ignore="ContentDescription"/>
|
android:gravity="center"
|
||||||
|
android:id="@+id/fragmentviewpageLinearLayout1">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
tools:ignore="ContentDescription"/>
|
tools:ignore="ContentDescription"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
tools:ignore="ContentDescription"/>
|
tools:ignore="ContentDescription"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
tools:ignore="ContentDescription"/>
|
tools:ignore="ContentDescription"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
tools:ignore="ContentDescription"/>
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -1,64 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/viewaboutdevLinearLayout1">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="180dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="DevelopUserName :"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/viewaboutdevEditText1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="180dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="DevelopUserPassword :"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ems="10"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/viewaboutdevEditText2"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libapputils.view.WinBollServiceStatusView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/viewaboutdevWinBollServiceStatusView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:id="@+id/viewaboutwwwLinearLayout1">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_horizontal">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libapputils.view.WinBollServiceStatusView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/viewaboutwwwWinBollServiceStatusView1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -11,25 +11,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="AOHPCTCSeekBar"/>
|
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>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/item_localfileselectdialog"
|
android:id="@+id/item_localfileselectdialog"
|
||||||
android:title="LocalFileSelectDialog"/>
|
android:title="LocalFileSelectDialog"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/item_atoolbar"
|
android:id="@+id/item_atoolbar"
|
||||||
android:title="Test AToolbar"/>
|
android:title="Test AToolbar"/>
|
@@ -32,13 +32,6 @@
|
|||||||
<attr name="attrASupportToolbarEndColor"/>
|
<attr name="attrASupportToolbarEndColor"/>
|
||||||
</declare-styleable>
|
</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"/>
|
<attr name="ActionSheetList" format="reference"/>
|
||||||
<!--<declare-styleable name="AToolbarStyle">
|
<!--<declare-styleable name="AToolbarStyle">
|
||||||
<attr name="attrAToolbarStartColor" format="color" />
|
<attr name="attrAToolbarStartColor" format="color" />
|
||||||
|
@@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- 默认方案 -->
|
<!-- 默认方案 -->
|
||||||
<color name="colorPrimary">#FF03AB4E</color>
|
<color name="colorPrimary">#FF03AB4E</color>
|
||||||
<color name="colorPrimaryDark">#FF027C39</color>
|
<color name="colorPrimaryDark">#FF027C39</color>
|
||||||
<color name="colorAccent">#FF3DDC84</color>
|
<color name="colorAccent">#FF3DDC84</color>
|
||||||
<color name="colorText">#FFFFFB8D</color>
|
<color name="colorToastFrame">#FFA9A9A9</color>
|
||||||
<color name="colorToastFrame">#FFA9A9A9</color>
|
|
||||||
<color name="colorToastShadow">#FF000000</color>
|
<color name="colorToastShadow">#FF000000</color>
|
||||||
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
<color name="colorToastBackgroung">#FFFFFFFF</color>
|
||||||
<color name="colorAToolbarStartColor">#FF7D3F12</color>
|
<color name="colorAToolbarStartColor">#FF7D3F12</color>
|
||||||
@@ -16,16 +14,16 @@
|
|||||||
<color name="colorACardShadow">@color/colorPrimaryDark</color>
|
<color name="colorACardShadow">@color/colorPrimaryDark</color>
|
||||||
<color name="colorACardFrame">@color/colorPrimary</color>
|
<color name="colorACardFrame">@color/colorPrimary</color>
|
||||||
<color name="colorACardBackgroung">@color/colorAccent</color>
|
<color name="colorACardBackgroung">@color/colorAccent</color>
|
||||||
|
|
||||||
<color name="colorATickProgressBarBackgroung">@color/colorAccent</color>
|
<color name="colorATickProgressBarBackgroung">@color/colorAccent</color>
|
||||||
<color name="colorATickProgressBarProgress">@color/colorPrimary</color>
|
<color name="colorATickProgressBarProgress">@color/colorPrimary</color>
|
||||||
|
|
||||||
<color name="colorOHPCTSBackground">@color/colorAccent</color>
|
<color name="colorOHPCTSBackground">@color/colorAccent</color>
|
||||||
<color name="colorOHPCTSSecondaryProgress">@color/colorPrimary</color>
|
<color name="colorOHPCTSSecondaryProgress">@color/colorPrimary</color>
|
||||||
<color name="colorOHPCTSProgress">@color/colorPrimaryDark</color>
|
<color name="colorOHPCTSProgress">@color/colorPrimaryDark</color>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<!-- 调试方案
|
<!-- 调试方案
|
||||||
<color name="colorPrimary">#FF727272</color>
|
<color name="colorPrimary">#FF727272</color>
|
||||||
<color name="colorPrimaryDark">#FF444444</color>
|
<color name="colorPrimaryDark">#FF444444</color>
|
||||||
@@ -41,5 +39,5 @@
|
|||||||
|
|
||||||
<color name="colorATickProgressBarBackgroung">#FF6DC4E2</color>
|
<color name="colorATickProgressBarBackgroung">#FF6DC4E2</color>
|
||||||
<color name="colorATickProgressBarProgress">#FF22B0E1</color>
|
<color name="colorATickProgressBarProgress">#FF22B0E1</color>
|
||||||
-->
|
-->
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="AESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="colorTextColor">#FF000000</item>
|
<item name="colorTextColor">#FF000000</item>
|
||||||
<item name="colorPrimary">#FF03AB4E</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">#FF027C39</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">#FF3DDC84</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
<item name="android:textColor">#FF000000</item>
|
<item name="android:textColor">#FF000000</item>
|
||||||
<item name="aToolbar">@style/AESAToolbar</item>
|
<item name="aToolbar">@style/AESAToolbar</item>
|
||||||
<item name="aSupportToolbar">@style/AESASupportToolbar</item>
|
<item name="aSupportToolbar">@style/AESASupportToolbar</item>
|
||||||
@@ -23,196 +24,158 @@
|
|||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<style name="DepthAESTheme" parent="AESTheme">
|
<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="colorTextColor">#FF000000</item>
|
||||||
<item name="colorPrimary">#FF2566FE</item>
|
<item name="colorPrimary">#FF2566FE</item>
|
||||||
<item name="colorPrimaryDark">#FF1359FF</item>
|
<item name="colorPrimaryDark">#FF1359FF</item>
|
||||||
<item name="colorAccent">#FF8BAEFF</item>
|
<item name="colorAccent">#FF8BAEFF</item>
|
||||||
<item name="android:textColor">#FF000000</item>
|
<item name="android:textColor">#FF000000</item>
|
||||||
|
<item name="aToolbar">@style/DepthAToolbar</item>
|
||||||
|
<item name="aSupportToolbar">@style/DepthASupportToolbar</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="SkyAESTheme" parent="AESTheme">
|
<style name="DepthAToolbar">
|
||||||
|
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="DepthASupportToolbar">
|
||||||
|
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="SkyAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="colorTextColor">#FF000000</item>
|
<item name="colorTextColor">#FF000000</item>
|
||||||
<item name="colorPrimary">#FF1E98D4</item>
|
<item name="colorPrimary">#FF1E98D4</item>
|
||||||
<item name="colorPrimaryDark">#FF046A9C</item>
|
<item name="colorPrimaryDark">#FF046A9C</item>
|
||||||
<item name="colorAccent">#FF8CD9FF</item>
|
<item name="colorAccent">#FF8CD9FF</item>
|
||||||
<item name="android:textColor">#FF000000</item>
|
<item name="android:textColor">#FF000000</item>
|
||||||
|
<item name="aToolbar">@style/SkyAToolbar</item>
|
||||||
|
<item name="aSupportToolbar">@style/SkyASupportToolbar</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="GoldenAESTheme" parent="AESTheme">
|
<style name="SkyAToolbar">
|
||||||
|
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="SkyASupportToolbar">
|
||||||
|
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="GoldenAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="colorTextColor">#FF000000</item>
|
<item name="colorTextColor">#FF000000</item>
|
||||||
<item name="colorPrimary">#FFFFE22A</item>
|
<item name="colorPrimary">#FFFFE22A</item>
|
||||||
<item name="colorPrimaryDark">#FFAE9600</item>
|
<item name="colorPrimaryDark">#FFAE9600</item>
|
||||||
<item name="colorAccent">#FFFFED78</item>
|
<item name="colorAccent">#FFFFED78</item>
|
||||||
<item name="android:textColor">#FF000000</item>
|
<item name="android:textColor">#FF000000</item>
|
||||||
|
<item name="aToolbar">@style/GoldenAToolbar</item>
|
||||||
|
<item name="aSupportToolbar">@style/GoldenASupportToolbar</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="MemorAESTheme" parent="AESTheme">
|
<style name="GoldenAToolbar">
|
||||||
|
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="GoldenASupportToolbar">
|
||||||
|
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MemorAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="colorTextColor">#FF000000</item>
|
<item name="colorTextColor">#FF000000</item>
|
||||||
<item name="colorPrimary">#FFCE1ED4</item>
|
<item name="colorPrimary">#FFCE1ED4</item>
|
||||||
<item name="colorPrimaryDark">#FFB500BC</item>
|
<item name="colorPrimaryDark">#FFB500BC</item>
|
||||||
<item name="colorAccent">#FFE653EB</item>
|
<item name="colorAccent">#FFE653EB</item>
|
||||||
<item name="android:textColor">#FF000000</item>
|
<item name="android:textColor">#FF000000</item>
|
||||||
|
<item name="aToolbar">@style/MemorAToolbar</item>
|
||||||
|
<item name="aSupportToolbar">@style/MemorASupportToolbar</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TaoAESTheme" parent="AESTheme">
|
<style name="MemorAToolbar">
|
||||||
|
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MemorASupportToolbar">
|
||||||
|
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
|
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
|
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
|
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TaoAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="colorTextColor">#FF000000</item>
|
<item name="colorTextColor">#FF000000</item>
|
||||||
<item name="colorPrimary">#FF9F9F9F</item>
|
<item name="colorPrimary">#FF9F9F9F</item>
|
||||||
<item name="colorPrimaryDark">#FF5E5E5E</item>
|
<item name="colorPrimaryDark">#FF5E5E5E</item>
|
||||||
<item name="colorAccent">#FFD9D9D9</item>
|
<item name="colorAccent">#FFD9D9D9</item>
|
||||||
<item name="android:textColor">#FF000000</item>
|
<item name="android:textColor">#FF000000</item>
|
||||||
</style>
|
<item name="aToolbar">@style/TaoAToolbar</item>
|
||||||
|
<item name="aSupportToolbar">@style/TaoASupportToolbar</item>
|
||||||
<!--<style name="AESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="colorTextColor">#FF000000</item>
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
|
||||||
<item name="android:textColor">#FF000000</item>
|
|
||||||
<item name="aToolbar">@style/AESAToolbar</item>
|
|
||||||
<item name="aSupportToolbar">@style/AESASupportToolbar</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AESAToolbar">
|
|
||||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="AESASupportToolbar">
|
|
||||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>-->
|
|
||||||
|
|
||||||
<!--<style name="DepthAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="colorTextColor">#FF000000</item>
|
|
||||||
<item name="colorPrimary">#FF2566FE</item>
|
|
||||||
<item name="colorPrimaryDark">#FF1359FF</item>
|
|
||||||
<item name="colorAccent">#FF8BAEFF</item>
|
|
||||||
<item name="android:textColor">#FF000000</item>
|
|
||||||
<item name="aToolbar">@style/DepthAToolbar</item>
|
|
||||||
<item name="aSupportToolbar">@style/DepthASupportToolbar</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="DepthAToolbar">
|
|
||||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="DepthASupportToolbar">
|
|
||||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SkyAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="colorTextColor">#FF000000</item>
|
|
||||||
<item name="colorPrimary">#FF1E98D4</item>
|
|
||||||
<item name="colorPrimaryDark">#FF046A9C</item>
|
|
||||||
<item name="colorAccent">#FF8CD9FF</item>
|
|
||||||
<item name="android:textColor">#FF000000</item>
|
|
||||||
<item name="aToolbar">@style/SkyAToolbar</item>
|
|
||||||
<item name="aSupportToolbar">@style/SkyASupportToolbar</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SkyAToolbar">
|
|
||||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="SkyASupportToolbar">
|
|
||||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="GoldenAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="colorTextColor">#FF000000</item>
|
|
||||||
<item name="colorPrimary">#FFFFE22A</item>
|
|
||||||
<item name="colorPrimaryDark">#FFAE9600</item>
|
|
||||||
<item name="colorAccent">#FFFFED78</item>
|
|
||||||
<item name="android:textColor">#FF000000</item>
|
|
||||||
<item name="aToolbar">@style/GoldenAToolbar</item>
|
|
||||||
<item name="aSupportToolbar">@style/GoldenASupportToolbar</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="GoldenAToolbar">
|
|
||||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="GoldenASupportToolbar">
|
|
||||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="MemorAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="colorTextColor">#FF000000</item>
|
|
||||||
<item name="colorPrimary">#FFCE1ED4</item>
|
|
||||||
<item name="colorPrimaryDark">#FFB500BC</item>
|
|
||||||
<item name="colorAccent">#FFE653EB</item>
|
|
||||||
<item name="android:textColor">#FF000000</item>
|
|
||||||
<item name="aToolbar">@style/MemorAToolbar</item>
|
|
||||||
<item name="aSupportToolbar">@style/MemorASupportToolbar</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="MemorAToolbar">
|
|
||||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="MemorASupportToolbar">
|
|
||||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
|
||||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
|
||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TaoAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="colorTextColor">#FF000000</item>
|
|
||||||
<item name="colorPrimary">#FF9F9F9F</item>
|
|
||||||
<item name="colorPrimaryDark">#FF5E5E5E</item>
|
|
||||||
<item name="colorAccent">#FFD9D9D9</item>
|
|
||||||
<item name="android:textColor">#FF000000</item>
|
|
||||||
<item name="aToolbar">@style/TaoAToolbar</item>
|
|
||||||
<item name="aSupportToolbar">@style/TaoASupportToolbar</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TaoAToolbar">
|
<style name="TaoAToolbar">
|
||||||
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TaoASupportToolbar">
|
<style name="TaoASupportToolbar">
|
||||||
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
|
||||||
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
|
||||||
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
|
||||||
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
|
||||||
</style>-->
|
</style>
|
||||||
|
|
||||||
<!--<style name="AToolbar">
|
<!--<style name="AToolbar">
|
||||||
<item name="attrAToolbarTitleTextColor">#FF2DDA27</item>
|
<item name="attrAToolbarTitleTextColor">#FF2DDA27</item>
|
||||||
<item name="attrAToolbarStartColor">#FF2DDA27</item>
|
<item name="attrAToolbarStartColor">#FF2DDA27</item>
|
||||||
<item name="attrAToolbarCenterColor">#FF2DDA27</item>
|
<item name="attrAToolbarCenterColor">#FF2DDA27</item>
|
||||||
<item name="attrAToolbarEndColor">#FF2DDA27</item>
|
<item name="attrAToolbarEndColor">#FF2DDA27</item>
|
||||||
</style>-->
|
</style>-->
|
||||||
|
|
||||||
<!--对话框的样式-->
|
<!--对话框的样式-->
|
||||||
|
@@ -4,11 +4,12 @@ apply from: '../.winboll/winboll_lib_build.gradle'
|
|||||||
apply from: '../.winboll/winboll_lint_build.gradle'
|
apply from: '../.winboll/winboll_lint_build.gradle'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
compileSdkVersion 32
|
compileSdkVersion 32
|
||||||
buildToolsVersion "32.0.0"
|
buildToolsVersion "32.0.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 26
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -22,31 +23,24 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
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 类库
|
// Android 类库
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
//api 'com.android.support:appcompat-v7:28.0.0'
|
||||||
implementation 'androidx.viewpager:viewpager:1.0.0'
|
api('com.android.support:appcompat-v7:28.0.0'){
|
||||||
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
//exclude group: "com.android.support", module: "support-vector-drawable"
|
||||||
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
|
exclude group: "com.android.support:animated-vector-drawable:28.0.0"
|
||||||
implementation 'androidx.fragment:fragment:1.1.0'
|
}
|
||||||
implementation 'com.google.android.material:material:1.0.0'
|
// https://mvnrepository.com/artifact/com.android.support/support-compat
|
||||||
|
//api 'com.android.support:support-compat:28.0.0' // 保留原有依赖(可选)
|
||||||
implementation 'cc.winboll.studio:libappbase:15.0.5'
|
// https://mvnrepository.com/artifact/com.android.support/support-v4
|
||||||
implementation 'cc.winboll.studio:libapputils:15.0.2'
|
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
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Mar 24 14:06:10 HKT 2025
|
#Fri Mar 28 18:20:22 HKT 2025
|
||||||
stageCount=10
|
stageCount=4
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.0
|
baseVersion=15.1
|
||||||
publishVersion=15.0.9
|
publishVersion=15.1.3
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.0.10
|
baseBetaVersion=15.1.4
|
||||||
|
@@ -9,19 +9,33 @@
|
|||||||
<!-- 发送持久广播 -->
|
<!-- 发送持久广播 -->
|
||||||
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
|
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
|
||||||
|
|
||||||
|
<!-- 对正在运行的应用重新排序 -->
|
||||||
|
<uses-permission android:name="android.permission.REORDER_TASKS"/>
|
||||||
|
|
||||||
<application>
|
<application>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".CrashHandler$CrashActivity"
|
android:name=".CrashHandler$CrashActivity"
|
||||||
android:label="CrashActivity"
|
android:label="CrashActivity"
|
||||||
android:launchMode="standard"/>
|
android:launchMode="singleInstance"
|
||||||
|
android:process=":CrashActivity"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".GlobalCrashActivity"
|
android:name=".GlobalCrashActivity"
|
||||||
android:label="GlobalCrashActivity"
|
android:label="GlobalCrashActivity"
|
||||||
android:launchMode="standard"/>
|
android:launchMode="singleInstance"
|
||||||
|
android:process=":GlobalCrashActivity"/>
|
||||||
|
|
||||||
<activity android:name=".LogActivity"/>
|
<activity
|
||||||
|
android:name=".winboll.LogActivity"
|
||||||
|
android:label="LogActivity"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
|
||||||
|
android:exported="true"
|
||||||
|
android:launchMode="singleInstance"
|
||||||
|
android:process=":LogActivity">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".SimpleOperateSignalCenterService"
|
android:name=".SimpleOperateSignalCenterService"
|
||||||
@@ -33,7 +47,9 @@
|
|||||||
android:name=".services.TestService"
|
android:name=".services.TestService"
|
||||||
android:exported="true"/>
|
android:exported="true"/>
|
||||||
|
|
||||||
<receiver android:name=".receiver.MyBroadcastReceiver">
|
<receiver
|
||||||
|
android:name=".receiver.MyBroadcastReceiver"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -75,7 +91,9 @@
|
|||||||
|
|
||||||
<service android:name="cc.winboll.studio.libappbase.sos.SOSCenter"/>
|
<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>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -87,4 +105,4 @@
|
|||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -1,53 +1,55 @@
|
|||||||
package cc.winboll.studio.libaes.beans;
|
package cc.winboll.studio.libappbase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
* @Date 2025/03/24 15:27:16
|
* @Date 2025/03/25 02:52:46
|
||||||
* @Describe AES数据实例化模型
|
* @Describe 基础应用数据模型
|
||||||
*/
|
*/
|
||||||
import cc.winboll.studio.libappbase.BaseBean;
|
|
||||||
import android.util.JsonWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import android.util.JsonReader;
|
import android.util.JsonReader;
|
||||||
|
import android.util.JsonWriter;
|
||||||
|
import cc.winboll.studio.libappbase.BaseBean;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class AESModel extends BaseBean {
|
public class APPBaseModel extends BaseBean {
|
||||||
|
|
||||||
public static final String TAG = "AESModel";
|
public static final String TAG = "APPBaseModel";
|
||||||
|
|
||||||
boolean isInDebugMode;
|
// 应用是否处于正在调试状态
|
||||||
|
//
|
||||||
|
boolean isDebuging = false;
|
||||||
|
|
||||||
public AESModel() {
|
public APPBaseModel() {
|
||||||
this.isInDebugMode = false;
|
this.isDebuging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AESModel(boolean isInDebugMode) {
|
public APPBaseModel(boolean isDebuging) {
|
||||||
this.isInDebugMode = isInDebugMode;
|
this.isDebuging = isDebuging;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsInDebugMode(boolean isInDebugMode) {
|
public void setIsDebuging(boolean isDebuging) {
|
||||||
this.isInDebugMode = isInDebugMode;
|
this.isDebuging = isDebuging;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInDebugMode() {
|
public boolean isDebuging() {
|
||||||
return isInDebugMode;
|
return isDebuging;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return AESModel.class.getName();
|
return APPBaseModel.class.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
|
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
|
||||||
super.writeThisToJsonWriter(jsonWriter);
|
super.writeThisToJsonWriter(jsonWriter);
|
||||||
jsonWriter.name("isInDebugMode").value(isInDebugMode());
|
jsonWriter.name("isDebuging").value(isDebuging());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
|
||||||
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
|
||||||
if (name.equals("isInDebugMode")) {
|
if (name.equals("isDebuging")) {
|
||||||
setIsInDebugMode(jsonReader.nextBoolean());
|
setIsDebuging(jsonReader.nextBoolean());
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
@@ -339,6 +339,7 @@ public final class CrashHandler {
|
|||||||
int padding = dp2px(16);
|
int padding = dp2px(16);
|
||||||
message.setPadding(padding, padding, padding, padding);
|
message.setPadding(padding, padding, padding, padding);
|
||||||
message.setText(mLog);
|
message.setText(mLog);
|
||||||
|
message.setTextColor(Color.BLACK);
|
||||||
message.setTextIsSelectable(true);
|
message.setTextIsSelectable(true);
|
||||||
}
|
}
|
||||||
hw.addView(message);
|
hw.addView(message);
|
||||||
|
@@ -7,75 +7,84 @@ package cc.winboll.studio.libappbase;
|
|||||||
*/
|
*/
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
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 {
|
public class GlobalApplication extends Application {
|
||||||
|
|
||||||
public static final String TAG = "GlobalApplication";
|
public static final String TAG = "GlobalApplication";
|
||||||
|
|
||||||
final static String PREFS = GlobalApplication.class.getName() + "PREFS";
|
volatile static GlobalApplication _GlobalApplication;
|
||||||
final static String PREFS_ISDEBUGING = "PREFS_ISDEBUGING";
|
|
||||||
|
|
||||||
|
|
||||||
private static Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
|
|
||||||
|
|
||||||
// 是否处于调试状态
|
// 是否处于调试状态
|
||||||
volatile static boolean isDebuging = false;
|
volatile static boolean isDebuging = false;
|
||||||
|
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
||||||
|
|
||||||
public static void setIsDebuging(Context context, boolean isDebuging) {
|
public static void setIsDebuging(boolean isDebuging) {
|
||||||
GlobalApplication.isDebuging = isDebuging;
|
if (_GlobalApplication != null) {
|
||||||
// 获取SharedPreferences实例
|
GlobalApplication.isDebuging = isDebuging;
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
APPBaseModel.saveBeanToFile(getAPPBaseModelFilePath(), new APPBaseModel(isDebuging));
|
||||||
// 获取编辑器
|
}
|
||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
}
|
||||||
// 保存数据
|
|
||||||
editor.putBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
public static GlobalApplication getInstance() {
|
||||||
// 提交更改
|
return _GlobalApplication;
|
||||||
editor.apply();
|
}
|
||||||
|
|
||||||
|
static String getAPPBaseModelFilePath() {
|
||||||
|
return _GlobalApplication.getDataDir().getPath() + "/APPBaseModel.json";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDebuging() {
|
public static boolean isDebuging() {
|
||||||
return isDebuging;
|
return isDebuging;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public static WinBollActivityManager getWinBollActivityManager() {
|
||||||
public Context getApplicationContext() {
|
return WinBollActivityManager.getInstance(_GlobalApplication);
|
||||||
return super.getApplicationContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Application getApplication() {
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
//GlobalApplication.isDebuging = true;
|
// 保存初始实例
|
||||||
//GlobalApplication.setIsDebuging(this, true);
|
_GlobalApplication = this;
|
||||||
|
|
||||||
|
setIsDebuging(true);
|
||||||
|
// 添加日志模块
|
||||||
LogUtils.init(this);
|
LogUtils.init(this);
|
||||||
//LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
|
//LogUtils.setLogLevel(LogUtils.LOG_LEVEL.Debug);
|
||||||
//LogUtils.setTAGListEnable(GlobalApplication.TAG, true);
|
//LogUtils.setTAGListEnable(GlobalApplication.TAG, true);
|
||||||
//LogUtils.setALlTAGListEnable(true);
|
//LogUtils.setALlTAGListEnable(true);
|
||||||
//LogUtils.d(TAG, "LogUtils init");
|
//LogUtils.d(TAG, "LogUtils init");
|
||||||
|
|
||||||
// 设置应用异常处理窗口
|
// 设置应用异常处理窗口
|
||||||
CrashHandler.init(this);
|
CrashHandler.init(this);
|
||||||
|
|
||||||
// 设置应用调试状态
|
|
||||||
//SharedPreferences sharedPreferences = getSharedPreferences(PREFS, Context.MODE_PRIVATE);
|
|
||||||
//GlobalApplication.isDebuging = sharedPreferences.getBoolean(PREFS_ISDEBUGING, GlobalApplication.isDebuging);
|
|
||||||
|
|
||||||
// 初始化 Toast 框架
|
// 初始化 Toast 框架
|
||||||
ToastUtils.init(this);
|
ToastUtils.init(this);
|
||||||
// 设置 Toast 布局样式
|
|
||||||
//ToastUtils.setView(R.layout.toast_custom_view);
|
// 应用保存的调试标志
|
||||||
//ToastUtils.setStyle(new WhiteToastStyle());
|
APPBaseModel appBaseModel = APPBaseModel.loadBeanFromFile(getAPPBaseModelFilePath(), APPBaseModel.class);
|
||||||
//ToastUtils.setGravity(Gravity.BOTTOM, 0, 200);
|
if (appBaseModel == null) {
|
||||||
|
setIsDebuging(false);
|
||||||
|
} else {
|
||||||
|
setIsDebuging(appBaseModel.isDebuging());
|
||||||
|
}
|
||||||
|
|
||||||
|
getWinBollActivityManager().setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||||
|
// 注册窗口回调监听
|
||||||
|
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks();
|
||||||
|
registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTerminate() {
|
||||||
|
super.onTerminate();
|
||||||
|
// 注销回调(非必须,但建议释放资源)
|
||||||
|
unregisterActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getAppName(Context context) {
|
public static String getAppName(Context context) {
|
||||||
|
@@ -4,26 +4,20 @@ package cc.winboll.studio.libappbase;
|
|||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
* @Date 2025/02/11 00:14:05
|
* @Date 2025/02/11 00:14:05
|
||||||
*/
|
*/
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.text.style.ForegroundColorSpan;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import cc.winboll.studio.libappbase.R;
|
import cc.winboll.studio.libappbase.R;
|
||||||
|
|
||||||
public final class GlobalCrashActivity extends Activity implements MenuItem.OnMenuItemClickListener {
|
public final class GlobalCrashActivity extends AppCompatActivity implements MenuItem.OnMenuItemClickListener {
|
||||||
|
|
||||||
private static final int MENUITEM_COPY = 0;
|
private static final int MENUITEM_COPY = 0;
|
||||||
private static final int MENUITEM_RESTART = 1;
|
private static final int MENUITEM_RESTART = 1;
|
||||||
@@ -45,10 +39,10 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe
|
|||||||
setContentView(R.layout.activity_globalcrash);
|
setContentView(R.layout.activity_globalcrash);
|
||||||
mGlobalCrashReportView = findViewById(R.id.activityglobalcrashGlobalCrashReportView1);
|
mGlobalCrashReportView = findViewById(R.id.activityglobalcrashGlobalCrashReportView1);
|
||||||
mGlobalCrashReportView.setReport(mLog);
|
mGlobalCrashReportView.setReport(mLog);
|
||||||
setActionBar(mGlobalCrashReportView.getToolbar());
|
setSupportActionBar(mGlobalCrashReportView.getToolbar());
|
||||||
|
|
||||||
getActionBar().setTitle(CrashHandler.TITTLE);
|
getSupportActionBar().setTitle(CrashHandler.TITTLE);
|
||||||
getActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()));
|
getSupportActionBar().setSubtitle(GlobalApplication.getAppName(getApplicationContext()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -98,20 +92,4 @@ public final class GlobalCrashActivity extends Activity implements MenuItem.OnMe
|
|||||||
mGlobalCrashReportView.updateMenuStyle();
|
mGlobalCrashReportView.updateMenuStyle();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void joinQQGroup(String key) {
|
|
||||||
// 创建Intent
|
|
||||||
Intent intent = new Intent();
|
|
||||||
// 设置动作
|
|
||||||
intent.setAction("android.intent.action.VIEW");
|
|
||||||
// 设置数据为网址的URI
|
|
||||||
Uri content_url = Uri.parse("https://www.winboll.cc");
|
|
||||||
intent.setData(content_url);
|
|
||||||
// 添加标志
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
// 设置类名和活动名
|
|
||||||
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
|
|
||||||
// 启动Activity
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@ package cc.winboll.studio.libappbase;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@@ -16,7 +17,6 @@ import android.view.MenuItem;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import cc.winboll.studio.libappbase.R;
|
import cc.winboll.studio.libappbase.R;
|
||||||
import android.widget.Toolbar;
|
|
||||||
|
|
||||||
public class GlobalCrashReportView extends LinearLayout {
|
public class GlobalCrashReportView extends LinearLayout {
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -18,6 +20,8 @@ import android.widget.AdapterView;
|
|||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.HorizontalScrollView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
@@ -42,6 +46,7 @@ public class LogView extends RelativeLayout {
|
|||||||
Context mContext;
|
Context mContext;
|
||||||
ScrollView mScrollView;
|
ScrollView mScrollView;
|
||||||
TextView mTextView;
|
TextView mTextView;
|
||||||
|
EditText metTagSearch;
|
||||||
CheckBox mSelectableCheckBox;
|
CheckBox mSelectableCheckBox;
|
||||||
CheckBox mSelectAllTAGCheckBox;
|
CheckBox mSelectAllTAGCheckBox;
|
||||||
TAGListAdapter mTAGListAdapter;
|
TAGListAdapter mTAGListAdapter;
|
||||||
@@ -107,9 +112,41 @@ public class LogView extends RelativeLayout {
|
|||||||
//
|
//
|
||||||
mScrollView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogScrollViewLog);
|
mScrollView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogScrollViewLog);
|
||||||
mTextView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogTextViewLog);
|
mTextView = findViewById(cc.winboll.studio.libappbase.R.id.viewlogTextViewLog);
|
||||||
|
metTagSearch = findViewById(cc.winboll.studio.libappbase.R.id.tagsearch_et);
|
||||||
// 获取Log Level spinner实例
|
// 获取Log Level spinner实例
|
||||||
mLogLevelSpinner = findViewById(cc.winboll.studio.libappbase.R.id.viewlogSpinner1);
|
mLogLevelSpinner = findViewById(cc.winboll.studio.libappbase.R.id.viewlogSpinner1);
|
||||||
|
|
||||||
|
metTagSearch.addTextChangedListener(new TextWatcher() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable editable) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence charSequence, int p, int p1, int p2) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
LogUtils.d(TAG, s.toString());
|
||||||
|
if (s.length() > 0) {
|
||||||
|
scrollToTag(s.toString());
|
||||||
|
} else {
|
||||||
|
HorizontalScrollView hsRoot = findViewById(R.id.viewlogHorizontalScrollView1);
|
||||||
|
hsRoot.smoothScrollTo(0, 0);
|
||||||
|
mListViewTags.resetScrollToStart();
|
||||||
|
}
|
||||||
|
// mListViewTags.postDelayed(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// mListViewTags.scrollToItem(5);
|
||||||
|
// }
|
||||||
|
// }, 100);
|
||||||
|
}
|
||||||
|
// 其他方法留空或按需实现
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
(findViewById(cc.winboll.studio.libappbase.R.id.viewlogButtonClean)).setOnClickListener(new View.OnClickListener(){
|
(findViewById(cc.winboll.studio.libappbase.R.id.viewlogButtonClean)).setOnClickListener(new View.OnClickListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -233,6 +270,60 @@ public class LogView extends RelativeLayout {
|
|||||||
scrollLogUp();
|
scrollLogUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void scrollToTag(final String prefix) {
|
||||||
|
if (mTAGListAdapter == null || prefix == null || prefix.length() == 0) {
|
||||||
|
LogUtils.d(TAG, "参数为空,无法滚动");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<TAGItemModel> itemList = mTAGListAdapter.getItemList();
|
||||||
|
|
||||||
|
mListViewTags.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// 查找匹配的标签位置
|
||||||
|
int targetPosition = -1;
|
||||||
|
|
||||||
|
for (int i = 0; i < itemList.size(); i++) {
|
||||||
|
String tag = itemList.get(i).getTag();
|
||||||
|
if (tag != null && tag.toLowerCase().startsWith(prefix.toLowerCase())) {
|
||||||
|
targetPosition = i;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetPosition != -1) {
|
||||||
|
// 优化滚动逻辑
|
||||||
|
//mListViewTags.setSelection(targetPosition);
|
||||||
|
//mListViewTags.invalidateViews(); // 强制刷新所有可见项
|
||||||
|
|
||||||
|
// 单独刷新目标视图
|
||||||
|
// View targetView = mListViewTags.getChildAt(targetPosition);
|
||||||
|
// if (targetView != null) {
|
||||||
|
// targetView.requestLayout();
|
||||||
|
// targetView.requestFocus();
|
||||||
|
// }
|
||||||
|
|
||||||
|
final int scrollPosition = targetPosition;
|
||||||
|
|
||||||
|
// 延迟滚动确保布局完成
|
||||||
|
mListViewTags.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
LogUtils.d(TAG, String.format("scrollPosition %d", scrollPosition));
|
||||||
|
mListViewTags.scrollToItem(scrollPosition);
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "未找到匹配的标签前缀:" + prefix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class LogViewHandler extends Handler {
|
class LogViewHandler extends Handler {
|
||||||
|
|
||||||
final static int MSG_LOGVIEW_UPDATE = 0;
|
final static int MSG_LOGVIEW_UPDATE = 0;
|
||||||
@@ -300,6 +391,30 @@ public class LogView extends RelativeLayout {
|
|||||||
public void setChecked(boolean checked) {
|
public void setChecked(boolean checked) {
|
||||||
isChecked = checked;
|
isChecked = checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// getter/setter...
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TAGItemModel that = (TAGItemModel) o;
|
||||||
|
// 手动处理空值比较(Java 6 不支持 Objects.equals)
|
||||||
|
if (tag == null) {
|
||||||
|
return that.tag == null;
|
||||||
|
} else {
|
||||||
|
return tag.equals(that.tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return tag == null ? 0 : tag.hashCode(); // 手动处理空值
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -314,7 +429,11 @@ public class LogView extends RelativeLayout {
|
|||||||
mapOrigin = map;
|
mapOrigin = map;
|
||||||
loadMap(mapOrigin);
|
loadMap(mapOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<TAGItemModel> getItemList() {
|
||||||
|
return itemList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return itemList.size();
|
return itemList.size();
|
||||||
@@ -344,7 +463,7 @@ public class LogView extends RelativeLayout {
|
|||||||
loadMap(mapOrigin);
|
loadMap(mapOrigin);
|
||||||
super.notifyDataSetChanged();
|
super.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
ViewHolder holder;
|
ViewHolder holder;
|
||||||
|
@@ -0,0 +1,60 @@
|
|||||||
|
package cc.winboll.studio.libappbase.dialogs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
|
* @Date 2025/03/28 17:40:47
|
||||||
|
* @Date 2024/08/12 14:46:25
|
||||||
|
* @Describe 询问用户确定与否的选择框
|
||||||
|
*/
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
|
||||||
|
public class YesNoAlertDialog {
|
||||||
|
|
||||||
|
public static final String TAG = "YesNoAlertDialog";
|
||||||
|
|
||||||
|
public static void show(Context context, String szTitle, String szMessage, final OnDialogResultListener listener) {
|
||||||
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
|
context);
|
||||||
|
|
||||||
|
// set title
|
||||||
|
alertDialogBuilder.setTitle(szTitle);
|
||||||
|
|
||||||
|
// set dialog message
|
||||||
|
alertDialogBuilder
|
||||||
|
.setMessage(szMessage)
|
||||||
|
.setCancelable(true)
|
||||||
|
.setOnCancelListener(new DialogInterface.OnCancelListener(){
|
||||||
|
@Override
|
||||||
|
public void onCancel(DialogInterface dialog) {
|
||||||
|
listener.onNo();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setPositiveButton("YES", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
// if this button is clicked, close
|
||||||
|
// current activity
|
||||||
|
listener.onYes();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("NO", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
// if this button is clicked, just close
|
||||||
|
// the dialog box and do nothing
|
||||||
|
dialog.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// create alert dialog
|
||||||
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
|
||||||
|
// show it
|
||||||
|
alertDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnDialogResultListener {
|
||||||
|
abstract void onYes();
|
||||||
|
abstract void onNo();
|
||||||
|
}
|
||||||
|
}
|
@@ -9,23 +9,34 @@ import android.content.Context;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.Scroller;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
|
||||||
public class HorizontalListView extends ListView {
|
public class HorizontalListView extends ListView {
|
||||||
|
|
||||||
public static final String TAG = "HorizontalListView";
|
public static final String TAG = "HorizontalListView";
|
||||||
int verticalOffset = 0;
|
private int verticalOffset = 0;
|
||||||
|
private Scroller scroller;
|
||||||
|
private int totalWidth;
|
||||||
|
|
||||||
public HorizontalListView(Context context) {
|
public HorizontalListView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HorizontalListView(Context context, AttributeSet attrs) {
|
public HorizontalListView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
public HorizontalListView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
scroller = new Scroller(getContext());
|
||||||
|
setHorizontalScrollBarEnabled(true);
|
||||||
|
setVerticalScrollBarEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVerticalOffset(int verticalOffset) {
|
public void setVerticalOffset(int verticalOffset) {
|
||||||
@@ -38,28 +49,81 @@ public class HorizontalListView extends ListView {
|
|||||||
int childCount = getChildCount();
|
int childCount = getChildCount();
|
||||||
int left = getPaddingLeft();
|
int left = getPaddingLeft();
|
||||||
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
int viewHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||||
LogUtils.d(TAG, String.format("HorizontalListView的高度 %d", viewHeight));
|
totalWidth = left;
|
||||||
|
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
View child = getChildAt(i);
|
View child = getChildAt(i);
|
||||||
// 计算每个子视图的宽度和高度
|
|
||||||
int width = child.getMeasuredWidth();
|
int width = child.getMeasuredWidth();
|
||||||
int height = child.getMeasuredHeight();
|
int height = child.getMeasuredHeight();
|
||||||
//LogUtils.d(TAG, String.format("child : width %d , height %d", width, height));
|
|
||||||
// 设置子视图的位置,实现水平布局
|
|
||||||
|
|
||||||
child.layout(left, verticalOffset, left + width, verticalOffset + height);
|
child.layout(left, verticalOffset, left + width, verticalOffset + height);
|
||||||
left += width;
|
left += width;
|
||||||
}
|
}
|
||||||
|
totalWidth = left + getPaddingRight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
int newHeightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||||
//super.onMeasure(widthMeasureSpec, newHeightMeasureSpec);
|
|
||||||
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
int newWidthMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
|
||||||
//LogUtils.d(TAG, String.format("newWidthMeasureSpec %d, newHeightMeasureSpec %d", newWidthMeasureSpec, newHeightMeasureSpec));
|
|
||||||
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void computeScroll() {
|
||||||
|
if (scroller.computeScrollOffset()) {
|
||||||
|
scrollTo(scroller.getCurrX(), scroller.getCurrY());
|
||||||
|
postInvalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void smoothScrollTo(int x, int y) {
|
||||||
|
int dx = x - getScrollX();
|
||||||
|
int dy = y - getScrollY();
|
||||||
|
scroller.startScroll(getScrollX(), getScrollY(), dx, dy, 300); // 300ms平滑动画
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int computeHorizontalScrollRange() {
|
||||||
|
return totalWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int computeHorizontalScrollOffset() {
|
||||||
|
return getScrollX();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int computeHorizontalScrollExtent() {
|
||||||
|
return getWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void scrollToItem(int position) {
|
||||||
|
if (position < 0 || position >= getChildCount()) {
|
||||||
|
LogUtils.d(TAG, "无效的position: " + position);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
View targetView = getChildAt(position);
|
||||||
|
int targetLeft = targetView.getLeft();
|
||||||
|
int scrollX = targetLeft - getPaddingLeft();
|
||||||
|
|
||||||
|
// 修正最大滚动范围计算
|
||||||
|
int maxScrollX = totalWidth;
|
||||||
|
scrollX = Math.max(0, Math.min(scrollX, maxScrollX));
|
||||||
|
|
||||||
|
// 强制重新布局和绘制
|
||||||
|
requestLayout();
|
||||||
|
invalidateViews();
|
||||||
|
smoothScrollTo(scrollX, 0);
|
||||||
|
LogUtils.d(TAG, String.format("滚动到position: %d, scrollX: %d computeHorizontalScrollRange() %d", position, scrollX, computeHorizontalScrollRange()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetScrollToStart() {
|
||||||
|
// 强制重新布局和绘制
|
||||||
|
requestLayout();
|
||||||
|
invalidateViews();
|
||||||
|
smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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,8 +1,8 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
package cc.winboll.studio.libappbase.winboll;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @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.Activity;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
@@ -18,6 +18,7 @@ public class MyActivityLifecycleCallbacks implements Application.ActivityLifecyc
|
|||||||
public String mInfo = "";
|
public String mInfo = "";
|
||||||
|
|
||||||
public MyActivityLifecycleCallbacks() {
|
public MyActivityLifecycleCallbacks() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void createActivityeInfo(Activity activity) {
|
void createActivityeInfo(Activity activity) {
|
@@ -1,4 +1,4 @@
|
|||||||
package cc.winboll.studio.libaes.winboll;
|
package cc.winboll.studio.libappbase.winboll;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@@ -12,7 +12,9 @@ import android.app.ActivityManager;
|
|||||||
import android.app.TaskStackBuilder;
|
import android.app.TaskStackBuilder;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
|
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -28,27 +30,25 @@ public class WinBollActivityManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 应用类型标志
|
// 应用类型标志
|
||||||
volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
static volatile WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
|
||||||
|
|
||||||
Context mContext;
|
GlobalApplication mGlobalApplication;
|
||||||
MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
|
static volatile WinBollActivityManager _Instance;
|
||||||
static WinBollActivityManager _mWinBollActivityManager;
|
static volatile Map<String, IWinBollActivity> _mapIWinBollList;
|
||||||
static Map<String, IWinBollActivity> _mapIWinBollList;
|
volatile IWinBollActivity mFirstIWinBollActivity;
|
||||||
IWinBollActivity firstIWinBollActivity;
|
|
||||||
|
|
||||||
public WinBollActivityManager(Context context) {
|
WinBollActivityManager(GlobalApplication application) {
|
||||||
mContext = context;
|
mGlobalApplication = application;
|
||||||
LogUtils.d(TAG, "WinBollActivityManager()");
|
|
||||||
_mapIWinBollList = new HashMap<String, IWinBollActivity>();
|
_mapIWinBollList = new HashMap<String, IWinBollActivity>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized WinBollActivityManager getInstance(Context context) {
|
public static synchronized WinBollActivityManager getInstance(GlobalApplication application) {
|
||||||
LogUtils.d(TAG, "getInstance");
|
LogUtils.d(TAG, "getInstance");
|
||||||
if (_mWinBollActivityManager == null) {
|
if (_Instance == null) {
|
||||||
LogUtils.d(TAG, "_mWinBollActivityManager == null");
|
LogUtils.d(TAG, "_Instance == null");
|
||||||
_mWinBollActivityManager = new WinBollActivityManager(context);
|
_Instance = new WinBollActivityManager(application);
|
||||||
}
|
}
|
||||||
return _mWinBollActivityManager;
|
return _Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -69,12 +69,15 @@ public class WinBollActivityManager {
|
|||||||
// 把Activity添加到管理中
|
// 把Activity添加到管理中
|
||||||
//
|
//
|
||||||
public <T extends IWinBollActivity> void add(T iWinBoll) {
|
public <T extends IWinBollActivity> void add(T iWinBoll) {
|
||||||
if (isActive(iWinBoll.getTag())) {
|
String tag = ((IWinBollActivity)iWinBoll).getTag();
|
||||||
LogUtils.d(TAG, String.format("add(...) %s is active.", iWinBoll.getTag()));
|
LogUtils.d(TAG, String.format("add(T iWinBoll) tag is %s", tag));
|
||||||
|
if (isActive(tag)) {
|
||||||
|
LogUtils.d(TAG, String.format("isActive(tag) is true, tag : %s.", tag));
|
||||||
} else {
|
} else {
|
||||||
// 设置起始活动窗口,以便最后退出时提问
|
// 设置起始活动窗口,以便最后退出时提问
|
||||||
if (firstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
|
if (mFirstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
|
||||||
firstIWinBollActivity = iWinBoll;
|
LogUtils.d(TAG, "Set firstIWinBollActivity, iWinBoll.getTag() is %s" + iWinBoll.getTag());
|
||||||
|
mFirstIWinBollActivity = iWinBoll;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加到活动窗口列表
|
// 添加到活动窗口列表
|
||||||
@@ -93,11 +96,13 @@ public class WinBollActivityManager {
|
|||||||
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
|
||||||
try {
|
try {
|
||||||
// 如果窗口已存在就重启窗口
|
// 如果窗口已存在就重启窗口
|
||||||
String tag = clazz.newInstance().getTag();
|
String tag = ((IWinBollActivity)clazz.newInstance()).getTag();
|
||||||
|
LogUtils.d(TAG, String.format("startWinBollActivity(Context context, Class<T> clazz) tag is %s", tag));
|
||||||
if (isActive(tag)) {
|
if (isActive(tag)) {
|
||||||
resumeActivity(context, tag);
|
resumeActivity(context, tag);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ToastUtils.show("startWinBollActivity(Context context, Class<T> clazz)");
|
||||||
|
|
||||||
// 新建一个任务窗口
|
// 新建一个任务窗口
|
||||||
Intent intent = new Intent(context, clazz);
|
Intent intent = new Intent(context, clazz);
|
||||||
@@ -106,7 +111,7 @@ public class WinBollActivityManager {
|
|||||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intent.putExtra(EXTRA_TAG, tag);
|
intent.putExtra(EXTRA_TAG, tag);
|
||||||
mContext.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} catch (InstantiationException | IllegalAccessException e) {
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
}
|
}
|
||||||
@@ -115,7 +120,8 @@ public class WinBollActivityManager {
|
|||||||
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
|
||||||
try {
|
try {
|
||||||
// 如果窗口已存在就重启窗口
|
// 如果窗口已存在就重启窗口
|
||||||
String tag = clazz.newInstance().getTag();
|
String tag = ((IWinBollActivity)clazz.newInstance()).getTag();
|
||||||
|
LogUtils.d(TAG, String.format("startWinBollActivity(Context context, Intent intent, Class<T> clazz) tag is %s", tag));
|
||||||
if (isActive(tag)) {
|
if (isActive(tag)) {
|
||||||
resumeActivity(context, tag);
|
resumeActivity(context, tag);
|
||||||
return;
|
return;
|
||||||
@@ -128,24 +134,52 @@ public class WinBollActivityManager {
|
|||||||
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intent.putExtra(EXTRA_TAG, tag);
|
intent.putExtra(EXTRA_TAG, tag);
|
||||||
mContext.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} catch (InstantiationException | IllegalAccessException e) {
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T extends IWinBollActivity> void startLogActivity(Context context) {
|
||||||
|
// 如果窗口已存在就重启窗口
|
||||||
|
String tag = LogActivity.TAG;
|
||||||
|
if (isActive(tag)) {
|
||||||
|
resumeActivity(context, tag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新建一个任务窗口
|
||||||
|
Intent intent = new Intent(context, LogActivity.class);
|
||||||
|
//打开多任务窗口 flags
|
||||||
|
// Define the bounds.
|
||||||
|
// Rect bounds = new Rect(0, 0, 800, 200);
|
||||||
|
// // Set the bounds as an activity option.
|
||||||
|
// ActivityOptions options = ActivityOptions.makeBasic();
|
||||||
|
// options.setLaunchBounds(bounds);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
|
|
||||||
|
intent.putExtra(EXTRA_TAG, tag);
|
||||||
|
|
||||||
|
//context.startActivity(intent, options.toBundle());
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
|
public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
|
||||||
return firstIWinBollActivity != null && firstIWinBollActivity == iWinBollActivity;
|
return mFirstIWinBollActivity != null && mFirstIWinBollActivity == iWinBollActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// 判断 tag绑定的 MyActivity是否存在
|
// 判断 tag绑定的 MyActivity是否存在
|
||||||
//
|
//
|
||||||
public boolean isActive(String tag) {
|
public boolean isActive(String tag) {
|
||||||
//printAvtivityListInfo();
|
LogUtils.d(TAG, String.format("isActive(String tag) tag is %s", tag));
|
||||||
|
//printIWinBollListInfo();
|
||||||
IWinBollActivity iWinBoll = getIWinBoll(tag);
|
IWinBollActivity iWinBoll = getIWinBoll(tag);
|
||||||
if (iWinBoll != null) {
|
if (iWinBoll != null) {
|
||||||
LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
|
//LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
|
||||||
//ToastUtils.show("activity != null tag " + tag);
|
//ToastUtils.show("activity != null tag " + tag);
|
||||||
//判断是否为 BaseActivity,如果已经销毁,则移除
|
//判断是否为 BaseActivity,如果已经销毁,则移除
|
||||||
if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
|
if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
|
||||||
@@ -158,12 +192,13 @@ public class WinBollActivityManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LogUtils.d(TAG, String.format("isActive(...) activity == null\ntag : %s", tag));
|
LogUtils.d(TAG, String.format("isActive(...) iWinBoll is null tag by %s", tag));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static IWinBollActivity getIWinBoll(String tag) {
|
static IWinBollActivity getIWinBoll(String tag) {
|
||||||
|
LogUtils.d(TAG, String.format("getIWinBoll(String tag) %s", tag));
|
||||||
return _mapIWinBollList.get(tag);
|
return _mapIWinBollList.get(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,8 +206,9 @@ public class WinBollActivityManager {
|
|||||||
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||||
//
|
//
|
||||||
public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
|
public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
|
||||||
LogUtils.d(TAG, "resumeActivty");
|
LogUtils.d(TAG, "resumeActivity(Context context, String tag)");
|
||||||
T iWinBoll = (T)getIWinBoll(tag);
|
T iWinBoll = (T)getIWinBoll(tag);
|
||||||
|
LogUtils.d(TAG, String.format("iWinBoll.getTag() %s", iWinBoll.getTag()));
|
||||||
//LogUtils.d(TAG, "activity " + activity.getTag());
|
//LogUtils.d(TAG, "activity " + activity.getTag());
|
||||||
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
|
||||||
resumeActivity(context, iWinBoll);
|
resumeActivity(context, iWinBoll);
|
||||||
@@ -183,16 +219,18 @@ public class WinBollActivityManager {
|
|||||||
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
// 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
|
||||||
//
|
//
|
||||||
public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
|
public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
|
||||||
ActivityManager am = (ActivityManager) iWinBoll.getActivity().getSystemService(Context.ACTIVITY_SERVICE);
|
LogUtils.d(TAG, "resumeActivity(Context context, T iWinBoll)");
|
||||||
|
ActivityManager am = (ActivityManager) mGlobalApplication.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
//返回启动它的根任务(home 或者 MainActivity)
|
//返回启动它的根任务(home 或者 MainActivity)
|
||||||
Intent intent = new Intent(context, iWinBoll.getClass());
|
Intent intent = new Intent(mGlobalApplication, iWinBoll.getClass());
|
||||||
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
|
TaskStackBuilder stackBuilder = TaskStackBuilder.create(mGlobalApplication);
|
||||||
stackBuilder.addNextIntentWithParentStack(intent);
|
stackBuilder.addNextIntentWithParentStack(intent);
|
||||||
stackBuilder.startActivities();
|
stackBuilder.startActivities();
|
||||||
//moveTaskToFront(YourTaskId, 0);
|
//moveTaskToFront(YourTaskId, 0);
|
||||||
LogUtils.d(TAG, "am.moveTaskToFront");
|
|
||||||
//ToastUtils.show("resumeActivity am.moveTaskToFront");
|
//ToastUtils.show("resumeActivity am.moveTaskToFront");
|
||||||
|
LogUtils.d(TAG, String.format("iWinBoll.getActivity().getTaskId() %d", iWinBoll.getActivity().getTaskId()));
|
||||||
am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||||
|
LogUtils.d(TAG, "am.moveTaskToFront");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -245,11 +283,11 @@ public class WinBollActivityManager {
|
|||||||
// ★:0 1 2 [3] 4 >> 2
|
// ★:0 1 2 [3] 4 >> 2
|
||||||
// ★:0 1 2 3 [4] >> 3
|
// ★:0 1 2 3 [4] >> 3
|
||||||
// ★:[0] >> 直接关闭当前窗口
|
// ★:[0] >> 直接关闭当前窗口
|
||||||
LogUtils.d(TAG, "finish no yet.");
|
//LogUtils.d(TAG, "finish no yet.");
|
||||||
IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
|
IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
|
||||||
iWinBoll.getActivity().finish();
|
iWinBoll.getActivity().finish();
|
||||||
if (preIWinBoll != null) {
|
if (preIWinBoll != null) {
|
||||||
resumeActivity(mContext, preIWinBoll);
|
resumeActivity(mGlobalApplication, preIWinBoll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +306,7 @@ public class WinBollActivityManager {
|
|||||||
for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
|
for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
|
||||||
if (entity.getKey().equals(iWinBoll.getTag())) {
|
if (entity.getKey().equals(iWinBoll.getTag())) {
|
||||||
bingo = true;
|
bingo = true;
|
||||||
LogUtils.d(TAG, "bingo");
|
//LogUtils.d(TAG, "bingo");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
preIWinBoll = entity.getValue();
|
preIWinBoll = entity.getValue();
|
@@ -10,8 +10,8 @@
|
|||||||
<shape android:shape="rectangle" >
|
<shape android:shape="rectangle" >
|
||||||
<gradient
|
<gradient
|
||||||
android:angle="270"
|
android:angle="270"
|
||||||
android:endColor="@color/colorAccent"
|
android:endColor="#0F000000"
|
||||||
android:startColor="@color/colorAccent" />
|
android:startColor="#0F000000" />
|
||||||
<corners
|
<corners
|
||||||
android:bottomLeftRadius="6dip"
|
android:bottomLeftRadius="6dip"
|
||||||
android:bottomRightRadius="6dip"
|
android:bottomRightRadius="6dip"
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:clickable="true"
|
android:clickable="true">
|
||||||
android:layout_width="24dp"
|
<item
|
||||||
android:layout_height="24dp">
|
android:width="256dp"
|
||||||
<item android:drawable="@drawable/ic_launcher_background"/>
|
android:height="256dp"
|
||||||
<item
|
|
||||||
android:left="0dp"
|
android:left="0dp"
|
||||||
android:top="0dp"
|
android:top="0dp"
|
||||||
android:right="0dp"
|
android:right="0dp"
|
||||||
android:bottom="0dp"
|
android:bottom="0dp"
|
||||||
android:drawable="@drawable/ic_launcher_foreground"/>
|
android:drawable="@drawable/ic_winboll_logo">
|
||||||
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
android:viewportWidth="108"
|
android:viewportWidth="108"
|
||||||
android:viewportHeight="108">
|
android:viewportHeight="108">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF005C12"
|
android:fillColor="@color/colorPrimary"
|
||||||
android:pathData="M0,0h108v108h-108z" />
|
android:pathData="M0,0h108v108h-108z" />
|
||||||
<path
|
<path
|
||||||
android:fillColor="#00000000"
|
android:fillColor="#00000000"
|
||||||
|
@@ -8,6 +8,6 @@
|
|||||||
android:top="0dp"
|
android:top="0dp"
|
||||||
android:right="0dp"
|
android:right="0dp"
|
||||||
android:bottom="0dp"
|
android:bottom="0dp"
|
||||||
android:drawable="@drawable/winboll_logo">
|
android:drawable="@drawable/ic_winboll_logo">
|
||||||
</item>
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
41
libappbase/src/main/res/drawable/ic_winboll_log.xml
Normal file
41
libappbase/src/main/res/drawable/ic_winboll_log.xml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="512dp"
|
||||||
|
android:height="512dp"
|
||||||
|
android:viewportWidth="512"
|
||||||
|
android:viewportHeight="512">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF1E9B54"
|
||||||
|
android:strokeColor="#FFF8E733"
|
||||||
|
android:strokeWidth="20.0"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeMiterLimit="10"
|
||||||
|
android:pathData="M254.63 35.45C374.95 35.45 473.38 133.89 473.38 254.2 473.38 374.51 374.95 472.95 254.63 472.95 134.32 472.95 35.88 374.51 35.88 254.2 35.88 133.89 134.32 35.45 254.63 35.45"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FF000000"
|
||||||
|
android:strokeWidth="20.0"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeMiterLimit="10"
|
||||||
|
android:pathData="M151.49 130.96C151.49 130.96 348.53 130.96 348.53 130.96 348.53 130.96 348.53 393.46 348.53 393.46 348.53 393.46 151.49 393.46 151.49 393.46 151.49 393.46 151.49 130.96 151.49 130.96"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FF000000"
|
||||||
|
android:strokeWidth="20.0"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeMiterLimit="10"
|
||||||
|
android:pathData="M186.28 207.75C186.28 207.75 304.95 207.75 304.95 207.75 304.95 207.75 304.95 205.97 304.95 205.97 304.95 205.97 186.28 205.97 186.28 205.97 186.28 205.97 186.28 207.75 186.28 207.75"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FF000000"
|
||||||
|
android:strokeWidth="20.0"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeMiterLimit="10"
|
||||||
|
android:pathData="M186.28 263.52C186.28 263.52 304.95 263.52 304.95 263.52 304.95 263.52 304.95 264.41 304.95 264.41 304.95 264.41 186.28 264.41 186.28 264.41 186.28 264.41 186.28 263.52 186.28 263.52"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FF000000"
|
||||||
|
android:strokeWidth="20.0"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeMiterLimit="10"
|
||||||
|
android:pathData="M186.28 323.62C186.28 323.62 304.95 323.62 304.95 323.62 304.95 323.62 304.95 320.62 304.95 320.62 304.95 320.62 186.28 320.62 186.28 320.62 186.28 320.62 186.28 323.62 186.28 323.62"/>
|
||||||
|
</vector>
|
@@ -7,5 +7,5 @@
|
|||||||
android:top="0dp"
|
android:top="0dp"
|
||||||
android:right="0dp"
|
android:right="0dp"
|
||||||
android:bottom="0dp"
|
android:bottom="0dp"
|
||||||
android:drawable="@drawable/winboll_logo"/>
|
android:drawable="@drawable/ic_winboll_logo"/>
|
||||||
</layer-list>
|
</layer-list>
|
@@ -1,16 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
<cc.winboll.studio.libappbase.LogView
|
||||||
android:orientation="horizontal"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="0dp"
|
android:id="@+id/logview"/>
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -7,9 +7,9 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/viewglobalcrashreportLinearLayout1">
|
android:id="@+id/viewglobalcrashreportLinearLayout1">
|
||||||
|
|
||||||
<android.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/viewglobalcrashreportToolbar1"/>
|
android:id="@+id/viewglobalcrashreportToolbar1"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@@ -83,13 +83,21 @@
|
|||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:layout_marginRight="5dp"/>
|
android:layout_marginRight="5dp"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:ems="10"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:id="@+id/tagsearch_et"/>
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/bg_border"
|
android:background="@drawable/bg_border"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:layout_weight="1.0">
|
android:layout_weight="1.0"
|
||||||
|
android:id="@+id/viewlogHorizontalScrollView1">
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.views.HorizontalListView
|
<cc.winboll.studio.libappbase.views.HorizontalListView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
25
libappbase/src/main/res/menu/toolbar_appbase.xml
Normal file
25
libappbase/src/main/res/menu/toolbar_appbase.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?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_minimal"
|
||||||
|
android:title="MINIMAL"
|
||||||
|
android:icon="@drawable/ic_winboll_point"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/item_about"
|
||||||
|
android:title="ABOUT"
|
||||||
|
android:icon="@drawable/ic_winboll_logo"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/item_help"
|
||||||
|
android:title="HELP"
|
||||||
|
android:icon="@drawable/ic_winboll_help"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/item_log"
|
||||||
|
android:title="LOG"
|
||||||
|
android:icon="@drawable/ic_winboll_log"
|
||||||
|
app:showAsAction="always"/>
|
||||||
|
</menu>
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<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>
|
<item name="themeGlobalCrashActivity">@style/GlobalCrashActivityTheme</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user