更新类库,重新初始化项目。
This commit is contained in:
		| @@ -19,17 +19,17 @@ def genVersionName(def versionName){ | |||||||
|  |  | ||||||
| android { | android { | ||||||
|     compileSdkVersion 32 |     compileSdkVersion 32 | ||||||
|     buildToolsVersion "33.0.3" |     buildToolsVersion "32.0.0" | ||||||
|  |  | ||||||
|     defaultConfig { |     defaultConfig { | ||||||
|         applicationId "cc.winboll.studio.app" |         applicationId "cc.winboll.studio.app" | ||||||
|         minSdkVersion 21 |         minSdkVersion 24 | ||||||
|         targetSdkVersion 30 |         targetSdkVersion 29 | ||||||
|         versionCode 1 |         versionCode 1 | ||||||
|         // versionName 更新后需要手动设置  |         // versionName 更新后需要手动设置  | ||||||
|         // 项目模块目录的 build.gradle 文件的 stageCount=0 |         // 项目模块目录的 build.gradle 文件的 stageCount=0 | ||||||
|         // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" |         // Gradle编译环境下合起来的 versionName 就是 "${versionName}.0" | ||||||
|         versionName "1.8"  |         versionName "15.0"  | ||||||
|         if(true) { |         if(true) { | ||||||
|             versionName = genVersionName("${versionName}") |             versionName = genVersionName("${versionName}") | ||||||
|         } |         } | ||||||
| @@ -41,14 +41,32 @@ android { | |||||||
|             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|      |  | ||||||
|     compileOptions { |  | ||||||
|         sourceCompatibility JavaVersion.VERSION_17 |  | ||||||
|         targetCompatibility JavaVersion.VERSION_17 |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|  |  | ||||||
| dependencies { | dependencies { | ||||||
| 	api project(':winboll-shared') | 	api fileTree(dir: 'libs', include: ['*.jar']) | ||||||
|     api fileTree(dir: 'libs', include: ['*.jar']) |     // SSH | ||||||
|  |     api 'com.jcraft:jsch:0.1.55' | ||||||
|  |     // Html 解析 | ||||||
|  |     api 'org.jsoup:jsoup:1.13.1' | ||||||
|  |     // 二维码类库 | ||||||
|  |     api 'com.google.zxing:core:3.4.1' | ||||||
|  |     api 'com.journeyapps:zxing-android-embedded:3.6.0' | ||||||
|  |     // 应用介绍页类库 | ||||||
|  |     api 'io.github.medyo:android-about-page:2.0.0' | ||||||
|  |     // 吐司类库 | ||||||
|  |     api 'com.github.getActivity:ToastUtils:10.5' | ||||||
|  |     // 网络连接类库 | ||||||
|  |     api 'com.squareup.okhttp3:okhttp:4.4.1' | ||||||
|  |     // AndroidX 类库 | ||||||
|  |     api 'androidx.appcompat:appcompat:1.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:libaes:15.2.4' | ||||||
|  |     api 'cc.winboll.studio:libapputils:15.2.1' | ||||||
|  |     api 'cc.winboll.studio:libappbase:15.2.2' | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| #Created by .winboll/winboll_app_build.gradle | #Created by .winboll/winboll_app_build.gradle | ||||||
| #Sun Jan 05 07:55:24 HKT 2025 | #Tue Apr 01 05:35:45 GMT 2025 | ||||||
| stageCount=17 | stageCount=0 | ||||||
| libraryProject=winboll-shared | libraryProject= | ||||||
| baseVersion=1.8 | baseVersion=15.0 | ||||||
| publishVersion=1.8.16 | publishVersion=15.0.0 | ||||||
| buildCount=0 | buildCount=12 | ||||||
| baseBetaVersion=1.8.17 | baseBetaVersion=15.0.1 | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <resources> | <resources> | ||||||
|  |  | ||||||
|     <string name="app_name">WinBoll-APP+</string> |     <string name="app_name">APP+</string> | ||||||
|  |  | ||||||
| </resources> | </resources> | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ | |||||||
|         android:allowBackup="true" |         android:allowBackup="true" | ||||||
|         android:icon="@drawable/ic_winboll" |         android:icon="@drawable/ic_winboll" | ||||||
|         android:label="@string/app_name" |         android:label="@string/app_name" | ||||||
|         android:theme="@style/WinBoll.SupportThemeNoActionBar" |         android:theme="@style/AESTheme" | ||||||
|         android:supportsRtl="true"> |         android:supportsRtl="true"> | ||||||
|  |  | ||||||
|         <activity |         <activity | ||||||
| @@ -42,6 +42,7 @@ | |||||||
|  |  | ||||||
|         </provider> |         </provider> | ||||||
|  |  | ||||||
|  |         <activity android:name=".AboutActivity"/> | ||||||
|  |  | ||||||
|     </application> |     </application> | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										88
									
								
								app/src/main/java/cc/winboll/studio/app/AboutActivity.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								app/src/main/java/cc/winboll/studio/app/AboutActivity.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,88 @@ | |||||||
|  | package cc.winboll.studio.app; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @Author ZhanGSKen@AliYun.Com | ||||||
|  |  * @Date 2025/03/24 23:52:29 | ||||||
|  |  * @Describe 应用介绍窗口 | ||||||
|  |  */ | ||||||
|  | import android.app.Activity; | ||||||
|  | import android.content.Context; | ||||||
|  | import android.os.Bundle; | ||||||
|  | import android.view.ViewGroup; | ||||||
|  | import android.widget.LinearLayout; | ||||||
|  | import androidx.appcompat.widget.Toolbar; | ||||||
|  | import cc.winboll.studio.app.R; | ||||||
|  | import cc.winboll.studio.libaes.winboll.APPInfo; | ||||||
|  | import cc.winboll.studio.libaes.winboll.AboutView; | ||||||
|  | import cc.winboll.studio.libappbase.GlobalApplication; | ||||||
|  | import cc.winboll.studio.libappbase.winboll.IWinBollActivity; | ||||||
|  |  | ||||||
|  | public class AboutActivity extends WinBollActivity implements IWinBollActivity { | ||||||
|  |  | ||||||
|  |     public static final String TAG = "AboutActivity"; | ||||||
|  |  | ||||||
|  |     Context mContext; | ||||||
|  |     Toolbar mToolbar; | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public Activity getActivity() { | ||||||
|  |         return this; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public String getTag() { | ||||||
|  |         return TAG; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     protected void onCreate(Bundle savedInstanceState) { | ||||||
|  |         super.onCreate(savedInstanceState); | ||||||
|  |         mContext = this; | ||||||
|  |         setContentView(R.layout.activity_about); | ||||||
|  |  | ||||||
|  |         mToolbar = findViewById(R.id.toolbar); | ||||||
|  |         setSupportActionBar(mToolbar); | ||||||
|  |         mToolbar.setSubtitle(TAG); | ||||||
|  |         getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||||||
|  |  | ||||||
|  |         AboutView aboutView = CreateAboutView(); | ||||||
|  |         // 在 Activity 的 onCreate 或其他生命周期方法中调用 | ||||||
|  | //        LinearLayout layout = new LinearLayout(this); | ||||||
|  | //        layout.setOrientation(LinearLayout.VERTICAL); | ||||||
|  | //        // 创建布局参数(宽度和高度) | ||||||
|  | //        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( | ||||||
|  | //            ViewGroup.LayoutParams.MATCH_PARENT, | ||||||
|  | //            ViewGroup.LayoutParams.MATCH_PARENT | ||||||
|  | //        ); | ||||||
|  | //        addContentView(aboutView, params); | ||||||
|  |  | ||||||
|  |         LinearLayout layout = findViewById(R.id.aboutviewroot_ll); | ||||||
|  |         // 创建布局参数(宽度和高度) | ||||||
|  |         ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( | ||||||
|  |             ViewGroup.LayoutParams.MATCH_PARENT, | ||||||
|  |             ViewGroup.LayoutParams.MATCH_PARENT | ||||||
|  |         ); | ||||||
|  |         layout.addView(aboutView, params); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     protected void onDestroy() { | ||||||
|  |         super.onDestroy(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public AboutView CreateAboutView() { | ||||||
|  |         String szBranchName = "aes"; | ||||||
|  |         APPInfo appInfo = new APPInfo(); | ||||||
|  |         appInfo.setAppName("AES"); | ||||||
|  |         appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll); | ||||||
|  |         appInfo.setAppDescription("AES Description"); | ||||||
|  |         appInfo.setAppGitName("APP"); | ||||||
|  |         appInfo.setAppGitOwner("Studio"); | ||||||
|  |         appInfo.setAppGitAPPBranch(szBranchName); | ||||||
|  |         appInfo.setAppGitAPPSubProjectFolder(szBranchName); | ||||||
|  |         appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES"); | ||||||
|  |         appInfo.setAppAPKName("AES"); | ||||||
|  |         appInfo.setAppAPKFolderName("AES"); | ||||||
|  |         return new AboutView(mContext, appInfo); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -5,20 +5,17 @@ package cc.winboll.studio.app; | |||||||
|  * @Date 2024/12/08 15:10:51 |  * @Date 2024/12/08 15:10:51 | ||||||
|  * @Describe 全局应用类 |  * @Describe 全局应用类 | ||||||
|  */ |  */ | ||||||
| import cc.winboll.studio.shared.app.WinBollApplication; | import cc.winboll.studio.libappbase.GlobalApplication; | ||||||
| import cc.winboll.studio.shared.log.LogUtils; | import cc.winboll.studio.libappbase.LogUtils; | ||||||
|  | import cc.winboll.studio.libappbase.winboll.WinBollActivityManager; | ||||||
|  |  | ||||||
| public class App extends WinBollApplication { | public class App extends GlobalApplication { | ||||||
|  |  | ||||||
|     public static final String TAG = "App"; |     public static final String TAG = "App"; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public void onCreate() { |     public void onCreate() { | ||||||
|         // 必须在调用基类前设置应用调试标志, |  | ||||||
|         // 这样可以预先设置日志与数据的存储根目录。 |  | ||||||
|         //setIsDebug(BuildConfig.DEBUG); |  | ||||||
|         super.onCreate(); |         super.onCreate(); | ||||||
|         LogUtils.d(TAG, "onCreate"); |         getWinBollActivityManager().setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,98 +1,26 @@ | |||||||
| package cc.winboll.studio.app; | package cc.winboll.studio.app; | ||||||
|  |  | ||||||
|  | import android.app.Activity; | ||||||
| import android.content.Intent; | import android.content.Intent; | ||||||
| import android.net.Uri; |  | ||||||
| import android.os.Bundle; | import android.os.Bundle; | ||||||
| import android.text.TextUtils; |  | ||||||
| import android.view.Menu; | import android.view.Menu; | ||||||
| import android.view.MenuItem; | import android.view.MenuItem; | ||||||
| import androidx.appcompat.widget.Toolbar; | import androidx.appcompat.widget.Toolbar; | ||||||
| import cc.winboll.studio.shared.app.WinBollActivity; | import cc.winboll.studio.app.R; | ||||||
| import cc.winboll.studio.shared.app.WinBollActivityManager; | import cc.winboll.studio.libappbase.LogUtils; | ||||||
| import cc.winboll.studio.shared.app.WinBollApplication; | import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog; | ||||||
| import cc.winboll.studio.shared.log.LogUtils; | import cc.winboll.studio.libappbase.winboll.IWinBollActivity; | ||||||
| import cc.winboll.studio.shared.util.UriUtils; | import cc.winboll.studio.libappbase.winboll.WinBollActivityManager; | ||||||
| import cc.winboll.studio.shared.view.StringToQrCodeView; |  | ||||||
| import cc.winboll.studio.shared.view.YesNoAlertDialog; |  | ||||||
| import cc.winboll.studio.unittest.UnitTestActivity; |  | ||||||
| import java.io.File; |  | ||||||
| import java.io.IOException; |  | ||||||
| import java.nio.file.Files; |  | ||||||
| import java.nio.file.Paths; |  | ||||||
| import java.util.UUID; |  | ||||||
|  |  | ||||||
| final public class MainActivity extends WinBollActivity { | final public class MainActivity extends WinBollActivity implements IWinBollActivity { | ||||||
|  |  | ||||||
| 	public static final String TAG = "MainActivity"; | 	public static final String TAG = "MainActivity"; | ||||||
|  |  | ||||||
|     public static final int REQUEST_HOME_ACTIVITY = 0; |     Toolbar mToolbar; | ||||||
|     public static final int REQUEST_ABOUT_ACTIVITY = 1; |  | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     protected boolean isEnableDisplayHomeAsUp() { |     public Activity getActivity() { | ||||||
|         return false; |         return this; | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     protected void onCreate(Bundle savedInstanceState) { |  | ||||||
|         // 接收并处理 Intent 数据,函数 Intent 处理接收就直接返回 |  | ||||||
|         if (prosessIntents(getIntent())) return; |  | ||||||
|         // 以下正常创建主窗口 |  | ||||||
|         super.onCreate(savedInstanceState); |  | ||||||
|         setContentView(R.layout.activity_main); |  | ||||||
|         // 设置 WinBoll 应用 UI 类型 |  | ||||||
|         WinBollApplication.setWinBollUI_TYPE(WinBollApplication.WinBollUI_TYPE.Aplication); |  | ||||||
|         //ToastUtils.show("WinBollUI_TYPE " + WinBollApplication.getWinBollUI_TYPE()); |  | ||||||
|         LogUtils.d(TAG, "BuildConfig.DEBUG : " + Boolean.toString(BuildConfig.DEBUG)); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     protected void onPostCreate(Bundle savedInstanceState) { |  | ||||||
|         super.onPostCreate(savedInstanceState); |  | ||||||
|         setSubTitle(""); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     // |  | ||||||
|     // 处理传入的 Intent 数据 |  | ||||||
|     // |  | ||||||
|     boolean prosessIntents(Intent intent) { |  | ||||||
|         if (intent == null  |  | ||||||
|             || intent.getAction() == null |  | ||||||
|             || intent.getAction().equals("")) |  | ||||||
|             return false; |  | ||||||
|  |  | ||||||
|         if (intent.getAction().equals(StringToQrCodeView.ACTION_UNITTEST_QRCODE)) { |  | ||||||
|             try { |  | ||||||
|                 WinBollActivity clazzActivity = UnitTestActivity.class.newInstance(); |  | ||||||
|                 String tag = clazzActivity.getTag(); |  | ||||||
|                 LogUtils.d(TAG, "String tag = clazzActivity.getTag(); tag " + tag); |  | ||||||
|                 Intent subIntent = new Intent(this, UnitTestActivity.class); |  | ||||||
|                 subIntent.setAction(intent.getAction()); |  | ||||||
|                 File file = new File(getCacheDir(), UUID.randomUUID().toString()); |  | ||||||
|                 //取出文件uri |  | ||||||
|                 Uri uri = intent.getData(); |  | ||||||
|                 if (uri == null) { |  | ||||||
|                     uri = intent.getParcelableExtra(Intent.EXTRA_STREAM); |  | ||||||
|                 } |  | ||||||
|                 //获取文件真实地址 |  | ||||||
|                 String szSrcPath = UriUtils.getFileFromUri(getApplication(), uri); |  | ||||||
|                 if (TextUtils.isEmpty(szSrcPath)) { |  | ||||||
|                     return false; |  | ||||||
|                 } |  | ||||||
|  |  | ||||||
|                 Files.copy(Paths.get(szSrcPath), Paths.get(file.getPath())); |  | ||||||
|                 //startWinBollActivity(subIntent, tag); |  | ||||||
|                 WinBollActivityManager.getInstance(this).startWinBollActivity(this, subIntent, UnitTestActivity.class); |  | ||||||
|             } catch (IllegalAccessException | InstantiationException | IOException e) { |  | ||||||
|                 LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); |  | ||||||
|                 // 函数处理异常返回失败 |  | ||||||
|                 return false; |  | ||||||
|             } |  | ||||||
|         } else { |  | ||||||
|             LogUtils.d(TAG, "prosessIntents|" + intent.getAction() + "|yet"); |  | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|         return true; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @@ -100,10 +28,25 @@ final public class MainActivity extends WinBollActivity { | |||||||
|         return TAG; |         return TAG; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     protected void onCreate(Bundle savedInstanceState) { | ||||||
|  |         LogUtils.d(TAG, "onCreate(Bundle savedInstanceState)"); | ||||||
|  |         super.onCreate(savedInstanceState); | ||||||
|  |         setContentView(R.layout.activity_main); | ||||||
|  |  | ||||||
|  |         mToolbar = findViewById(R.id.toolbar); | ||||||
|  |         setSupportActionBar(mToolbar); | ||||||
|  |         mToolbar.setSubtitle(TAG); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     protected boolean isAddWinBollToolBar() { |     protected void onPostCreate(Bundle savedInstanceState) { | ||||||
|         return true; |         super.onPostCreate(savedInstanceState); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     protected void onDestroy() { | ||||||
|  |         super.onDestroy(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
| @@ -116,7 +59,7 @@ final public class MainActivity extends WinBollActivity { | |||||||
|  |  | ||||||
|             @Override |             @Override | ||||||
|             public void onYes() { |             public void onYes() { | ||||||
|                 WinBollActivityManager.getInstance(getApplicationContext()).finishAll(); |                 App.getWinBollActivityManager().finishAll(); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             @Override |             @Override | ||||||
| @@ -126,43 +69,23 @@ final public class MainActivity extends WinBollActivity { | |||||||
|         YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener); |         YesNoAlertDialog.show(this, "[ " + getString(R.string.app_name) + " ]", "Exit(Yes/No).\nIs close all activity?", listener); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     protected Toolbar initToolBar() { |  | ||||||
|         return findViewById(R.id.activitymainToolbar1); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public boolean onCreateOptionsMenu(Menu menu) { |     public boolean onCreateOptionsMenu(Menu menu) { | ||||||
|         getMenuInflater().inflate(R.menu.toolbar_winboll_app_main, menu); |         getMenuInflater().inflate(R.menu.toolbar_main, menu); | ||||||
|         return super.onCreateOptionsMenu(menu); |         return super.onCreateOptionsMenu(menu); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public boolean onOptionsItemSelected(MenuItem item) { |     public boolean onOptionsItemSelected(MenuItem item) { | ||||||
|         if (item.getItemId() == R.id.item_unittest) { |         if (item.getItemId() == R.id.item_log) { | ||||||
|             WinBollActivityManager.getInstance(this).startWinBollActivity(this, UnitTestActivity.class); |             App.getWinBollActivityManager().startLogActivity(this); | ||||||
|  |         } else if (item.getItemId() == R.id.item_about) { | ||||||
|  |             App.getWinBollActivityManager().startWinBollActivity(this, AboutActivity.class); | ||||||
|         } else if (item.getItemId() == R.id.item_exit) { |         } else if (item.getItemId() == R.id.item_exit) { | ||||||
|             exit(); |             exit(); | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|         return super.onOptionsItemSelected(item); |         return super.onOptionsItemSelected(item); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     protected void onActivityResult(int requestCode, int resultCode, Intent data) { |  | ||||||
|         switch (resultCode) { |  | ||||||
|             case REQUEST_HOME_ACTIVITY : { |  | ||||||
|                     LogUtils.d(TAG, "REQUEST_HOME_ACTIVITY"); |  | ||||||
|                     break; |  | ||||||
|                 } |  | ||||||
|             case REQUEST_ABOUT_ACTIVITY : { |  | ||||||
|                     LogUtils.d(TAG, "REQUEST_ABOUT_ACTIVITY"); |  | ||||||
|                     break; |  | ||||||
|                 } |  | ||||||
|             default : { |  | ||||||
|                     super.onActivityResult(requestCode, resultCode, data); |  | ||||||
|                 } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										66
									
								
								app/src/main/java/cc/winboll/studio/app/WinBollActivity.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								app/src/main/java/cc/winboll/studio/app/WinBollActivity.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,66 @@ | |||||||
|  | package cc.winboll.studio.app; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @Author ZhanGSKen@AliYun.Com | ||||||
|  |  * @Date 2025/04/01 12:55:32 | ||||||
|  |  * @Describe 应用窗口基类 | ||||||
|  |  */ | ||||||
|  | import android.app.Activity; | ||||||
|  | import android.os.Bundle; | ||||||
|  | import android.view.MenuItem; | ||||||
|  | import androidx.appcompat.app.AppCompatActivity; | ||||||
|  | import cc.winboll.studio.libaes.beans.AESThemeBean; | ||||||
|  | import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||||
|  | import cc.winboll.studio.libappbase.winboll.IWinBollActivity; | ||||||
|  |  | ||||||
|  | public class WinBollActivity extends AppCompatActivity implements IWinBollActivity { | ||||||
|  |  | ||||||
|  |     public static final String TAG = "WinBollActivity"; | ||||||
|  |  | ||||||
|  |     protected volatile AESThemeBean.ThemeType mThemeType; | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public Activity getActivity() { | ||||||
|  |         return this; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public String getTag() { | ||||||
|  |         return TAG; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     protected void onCreate(Bundle savedInstanceState) { | ||||||
|  |         mThemeType = getThemeType(); | ||||||
|  |         super.onCreate(savedInstanceState); | ||||||
|  |         App.getWinBollActivityManager().add(this); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     protected void onDestroy() { | ||||||
|  |         super.onDestroy(); | ||||||
|  |         App.getWinBollActivityManager().registeRemove(this); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     AESThemeBean.ThemeType getThemeType() { | ||||||
|  |         /*SharedPreferences sharedPreferences = getSharedPreferences( | ||||||
|  |          SHAREDPREFERENCES_NAME, MODE_PRIVATE); | ||||||
|  |          return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))]; | ||||||
|  |          */ | ||||||
|  |         return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     void setThemeStyle() { | ||||||
|  |         //setTheme(AESThemeBean.getThemeStyle(getThemeType())); | ||||||
|  |         setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext())); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public boolean onOptionsItemSelected(MenuItem item) { | ||||||
|  |         if (item.getItemId() == android.R.id.home) { | ||||||
|  |             finish(); | ||||||
|  |             return true; | ||||||
|  |         } | ||||||
|  |         return super.onOptionsItemSelected(item); | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										21
									
								
								app/src/main/res/layout/activity_about.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								app/src/main/res/layout/activity_about.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <LinearLayout | ||||||
|  |     xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
|  |     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|  |     android:orientation="vertical" | ||||||
|  |     android:layout_width="match_parent" | ||||||
|  |     android:layout_height="match_parent"> | ||||||
|  |  | ||||||
|  |     <cc.winboll.studio.libaes.views.ASupportToolbar | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="wrap_content" | ||||||
|  |         android:id="@+id/toolbar"/> | ||||||
|  |  | ||||||
|  |     <LinearLayout | ||||||
|  |         android:orientation="vertical" | ||||||
|  |         android:layout_width="match_parent" | ||||||
|  |         android:layout_height="0dp" | ||||||
|  |         android:layout_weight="1.0" | ||||||
|  |         android:id="@+id/aboutviewroot_ll"/> | ||||||
|  |  | ||||||
|  | </LinearLayout> | ||||||
| @@ -5,10 +5,10 @@ | |||||||
| 	android:layout_width="match_parent" | 	android:layout_width="match_parent" | ||||||
| 	android:layout_height="match_parent"> | 	android:layout_height="match_parent"> | ||||||
|  |  | ||||||
| 	<androidx.appcompat.widget.Toolbar |     <cc.winboll.studio.libaes.views.ASupportToolbar | ||||||
| 		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"/> | ||||||
|  |  | ||||||
| 	<LinearLayout | 	<LinearLayout | ||||||
| 		xmlns:app="http://schemas.android.com/apk/res-auto" | 		xmlns:app="http://schemas.android.com/apk/res-auto" | ||||||
|   | |||||||
| @@ -1,5 +1,10 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <menu xmlns:android="http://schemas.android.com/apk/res/android" | <menu xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
| 	xmlns:app="http://schemas.android.com/apk/res-auto"> | 	xmlns:app="http://schemas.android.com/apk/res-auto"> | ||||||
| 
 |     <item | ||||||
|  |         android:id="@+id/item_log" | ||||||
|  |         android:title="Log"/> | ||||||
|  |     <item | ||||||
|  |         android:id="@+id/item_about" | ||||||
|  |         android:title="About"/> | ||||||
| </menu> | </menu> | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <resources> | <resources> | ||||||
|  |  | ||||||
|     <string name="app_name">WinBoll-APP</string> |     <string name="app_name">APP</string> | ||||||
|  |  | ||||||
| </resources> | </resources> | ||||||
|   | |||||||
| @@ -2,9 +2,8 @@ | |||||||
| //include ':demo' | //include ':demo' | ||||||
| //rootProject.name = "demo" | //rootProject.name = "demo" | ||||||
|  |  | ||||||
| // WinBoll-APP 项目编译设置 | // APP 项目编译设置 | ||||||
| //include ':app' | //include ':app' | ||||||
| //include ':winboll-shared' |  | ||||||
| //rootProject.name = "app" | //rootProject.name = "app" | ||||||
|  |  | ||||||
| // AutoInstaller 项目编译设置 | // AutoInstaller 项目编译设置 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen