添加日志窗口打开功能
This commit is contained in:
parent
c105123e7b
commit
934d54963a
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Fri May 30 01:04:53 GMT 2025
|
#Fri May 30 01:41:12 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.8
|
baseVersion=15.8
|
||||||
publishVersion=15.8.1
|
publishVersion=15.8.1
|
||||||
buildCount=7
|
buildCount=12
|
||||||
baseBetaVersion=15.8.2
|
baseBetaVersion=15.8.2
|
||||||
|
@ -40,7 +40,6 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Toolbar mToolbar;
|
Toolbar mToolbar;
|
||||||
LogView mLogView;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -53,8 +52,6 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
|||||||
|
|
||||||
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
CheckBox cbIsDebugMode = findViewById(R.id.activitymainCheckBox1);
|
||||||
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
cbIsDebugMode.setChecked(GlobalApplication.isDebuging());
|
||||||
mLogView = findViewById(R.id.logview);
|
|
||||||
mLogView.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -175,8 +172,7 @@ public class MainActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mLogView.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -71,10 +71,6 @@ public class New2Activity extends WinBoLLActivity implements IWinBoLLActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
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。
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
@ -69,10 +69,6 @@ public class NewActivity extends WinBoLLActivity implements IWinBoLLActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
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。
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,9 @@ package cc.winboll.studio.appbase.activities;
|
|||||||
* @Describe WinBoLL 窗口基础类
|
* @Describe WinBoLL 窗口基础类
|
||||||
*/
|
*/
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import cc.winboll.studio.appbase.R;
|
||||||
|
import cc.winboll.studio.libappbase.GlobalApplication;
|
||||||
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
|
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
|
||||||
|
|
||||||
public class WinBoLLActivity extends Activity implements IWinBoLLActivity {
|
public class WinBoLLActivity extends Activity implements IWinBoLLActivity {
|
||||||
@ -21,4 +24,16 @@ public class WinBoLLActivity extends Activity implements IWinBoLLActivity {
|
|||||||
public String getTag() {
|
public String getTag() {
|
||||||
return TAG;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == R.id.item_log) {
|
||||||
|
GlobalApplication.getWinBoLLActivityManager().startLogActivity(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 在switch语句中处理每个ID,并在处理完后返回true,未处理的情况返回false。
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -217,11 +217,5 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<cc.winboll.studio.libappbase.LogView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
android:id="@+id/logview"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Fri May 30 01:04:53 GMT 2025
|
#Fri May 30 01:41:12 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.8
|
baseVersion=15.8
|
||||||
publishVersion=15.8.1
|
publishVersion=15.8.1
|
||||||
buildCount=7
|
buildCount=12
|
||||||
baseBetaVersion=15.8.2
|
baseBetaVersion=15.8.2
|
||||||
|
@ -24,7 +24,9 @@ public class WinBoLLActivityManager {
|
|||||||
|
|
||||||
public static final String TAG = "IWinBoLLActivityManager";
|
public static final String TAG = "IWinBoLLActivityManager";
|
||||||
|
|
||||||
|
public static final String EXTRA_TAG = "EXTRA_TAG";
|
||||||
|
|
||||||
|
|
||||||
public enum WinBoLLUI_TYPE { Aplication, Service }
|
public enum WinBoLLUI_TYPE { Aplication, Service }
|
||||||
|
|
||||||
Context mContext;
|
Context mContext;
|
||||||
@ -112,6 +114,33 @@ public class WinBoLLActivityManager {
|
|||||||
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断 tag绑定的 MyActivity是否存在
|
* 判断 tag绑定的 MyActivity是否存在
|
||||||
|
Loading…
x
Reference in New Issue
Block a user