优化调试框架
This commit is contained in:
parent
9706a39f41
commit
f3ef7226d8
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon Mar 24 21:28:41 GMT 2025
|
||||
#Tue Mar 25 12:59:12 GMT 2025
|
||||
stageCount=11
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.10
|
||||
buildCount=12
|
||||
buildCount=41
|
||||
baseBetaVersion=15.0.11
|
||||
|
@ -13,7 +13,6 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleInstance"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
@ -106,10 +105,9 @@
|
||||
android:name="android.max_aspect"
|
||||
android:value="4.0"/>
|
||||
|
||||
<activity android:name=".activities.NewActivity"
|
||||
android:label="NewActivity"
|
||||
android:launchMode="singleInstance"
|
||||
android:exported="true"/>
|
||||
<activity android:name=".activities.NewActivity"/>
|
||||
|
||||
<activity android:name=".activities.New2Activity"/>
|
||||
|
||||
</application>
|
||||
|
||||
|
@ -19,12 +19,15 @@ import cc.winboll.studio.libappbase.sos.SOS;
|
||||
import cc.winboll.studio.libappbase.utils.ToastUtils;
|
||||
import cc.winboll.studio.libappbase.widgets.StatusWidget;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.LogActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
public class MainActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "MainActivity";
|
||||
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
@ -36,7 +39,7 @@ public class MainActivity extends Activity implements IWinBollActivity {
|
||||
}
|
||||
|
||||
Toolbar mToolbar;
|
||||
LogView mLogView;
|
||||
//LogView mLogView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -49,14 +52,32 @@ public class MainActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||
mLogView = findViewById(R.id.activitymainLogView1);
|
||||
//mLogView = findViewById(R.id.activitymainLogView1);
|
||||
|
||||
if (GlobalApplication.isDebuging()) {
|
||||
mLogView.start();
|
||||
ToastUtils.show("LogView start.");
|
||||
}
|
||||
// if (GlobalApplication.isDebuging()) {
|
||||
// mLogView.start();
|
||||
// ToastUtils.show("LogView start.");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.toolbar_main, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if(item.getItemId() == cc.winboll.studio.appbase.R.id.item_log) {
|
||||
onLogActivity();
|
||||
return true;
|
||||
}
|
||||
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
@ -67,9 +88,9 @@ public class MainActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
LogUtils.d(TAG, "onResume");
|
||||
//LogUtils.d(TAG, "onResume");
|
||||
super.onResume();
|
||||
mLogView.start();
|
||||
//mLogView.start();
|
||||
}
|
||||
|
||||
public void onSwitchDebugMode(View view) {
|
||||
@ -155,8 +176,20 @@ public class MainActivity extends Activity implements IWinBollActivity {
|
||||
Intent intent = new Intent(this, TestDemoBindService.class);
|
||||
stopService(intent);
|
||||
}
|
||||
|
||||
|
||||
public void onTestOpenNewActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, NewActivity.class);
|
||||
}
|
||||
|
||||
public void onLogActivity() {
|
||||
Intent intent = new Intent(MainActivity.this, LogActivity.class);
|
||||
//打开多任务窗口 flags
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT);
|
||||
// startActivity(intent);
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, intent, LogActivity.class);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,58 @@
|
||||
package cc.winboll.studio.appbase.activities;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/25 11:46:40
|
||||
* @Describe 测试窗口2
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
|
||||
public class New2Activity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "New2Activity";
|
||||
|
||||
//LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_new2);
|
||||
|
||||
// mLogView = findViewById(R.id.logview);
|
||||
// mLogView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//mLogView.start();
|
||||
}
|
||||
|
||||
public void onCloseThisActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
|
||||
public void onCloseAllActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finishAll();
|
||||
}
|
||||
|
||||
public void onNewActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, NewActivity.class);
|
||||
}
|
||||
}
|
@ -1,20 +1,23 @@
|
||||
package cc.winboll.studio.appbase.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
|
||||
/**
|
||||
* @Author ZhanGSKen@AliYun.Com
|
||||
* @Date 2025/03/25 05:04:22
|
||||
*/
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import cc.winboll.studio.appbase.R;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
|
||||
import cc.winboll.studio.libappbase.winboll.WinBollActivityManager;
|
||||
|
||||
public class NewActivity extends Activity implements IWinBollActivity {
|
||||
|
||||
public static final String TAG = "NewActivity";
|
||||
|
||||
//LogView mLogView;
|
||||
|
||||
@Override
|
||||
public Activity getActivity() {
|
||||
return this;
|
||||
@ -29,13 +32,25 @@ public class NewActivity extends Activity implements IWinBollActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_new);
|
||||
// mLogView = findViewById(R.id.logview);
|
||||
// mLogView.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//mLogView.start();
|
||||
}
|
||||
|
||||
public void onCloseThisActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finish(this);
|
||||
}
|
||||
|
||||
|
||||
public void onCloseAllActivity(View view) {
|
||||
WinBollActivityManager.getInstance(this).finishAll();
|
||||
}
|
||||
|
||||
public void onNew2Activity(View view) {
|
||||
WinBollActivityManager.getInstance(this).startWinBollActivity(this, New2Activity.class);
|
||||
}
|
||||
}
|
||||
|
@ -198,11 +198,6 @@
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_height="300dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/activitymainLogView1"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -29,6 +29,15 @@
|
||||
android:text="CloseAllActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseAllActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New2Activity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onNew2Activity"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
50
appbase/src/main/res/layout/activity_new2.xml
Normal file
50
appbase/src/main/res/layout/activity_new2.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/toolbar"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New2Activity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseThisActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseThisActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseAllActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseAllActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CloseAllActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onCloseAllActivity"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="NewActivity"
|
||||
android:textAllCaps="false"
|
||||
android:onClick="onNewActivity"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
9
appbase/src/main/res/menu/toolbar_main.xml
Normal file
9
appbase/src/main/res/menu/toolbar_main.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/item_log"
|
||||
android:title="Log"/>
|
||||
|
||||
</menu>
|
@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon Mar 24 21:28:41 GMT 2025
|
||||
#Tue Mar 25 12:59:12 GMT 2025
|
||||
stageCount=11
|
||||
libraryProject=libappbase
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.10
|
||||
buildCount=12
|
||||
buildCount=41
|
||||
baseBetaVersion=15.0.11
|
||||
|
@ -21,8 +21,11 @@
|
||||
android:label="GlobalCrashActivity"
|
||||
android:launchMode="standard"/>
|
||||
|
||||
<activity android:name=".LogActivity"/>
|
||||
|
||||
<activity
|
||||
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
|
||||
android:name="cc.winboll.studio.libappbase.winboll.LogActivity"
|
||||
android:exported="true"/>
|
||||
|
||||
<service
|
||||
android:name=".SimpleOperateSignalCenterService"
|
||||
android:exported="true">
|
||||
@ -87,4 +90,4 @@
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
@ -87,11 +87,11 @@ public class GlobalApplication extends Application {
|
||||
// 初始化 Toast 框架
|
||||
ToastUtils.init(this);
|
||||
|
||||
mWinBollActivityManager = WinBollActivityManager.getInstance(this);
|
||||
mWinBollActivityManager.setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||
// 注册回调
|
||||
mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(mWinBollActivityManager);
|
||||
registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
// mWinBollActivityManager = WinBollActivityManager.getInstance(this);
|
||||
// mWinBollActivityManager.setWinBollUI_TYPE(WinBollActivityManager.WinBollUI_TYPE.Service);
|
||||
// // 注册回调
|
||||
// mMyActivityLifecycleCallbacks = new MyActivityLifecycleCallbacks(mWinBollActivityManager);
|
||||
// registerActivityLifecycleCallbacks(mMyActivityLifecycleCallbacks);
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
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.Bundle;
|
||||
import cc.winboll.studio.libappbase.LogView;
|
||||
import cc.winboll.studio.libappbase.R;
|
||||
|
||||
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,16 +1,14 @@
|
||||
<?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">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:id="@+id/logview"/>
|
||||
<cc.winboll.studio.libappbase.LogView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/logview"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user