feat: 调试工具按钮组添加布局草稿预览入口

在DebugToolButtonsView中新增布局草稿按钮,
点击后跳转LayoutDraftPreViewActivity窗口。
This commit is contained in:
MiMo
2026-07-18 20:05:42 +08:00
parent 5d73960a54
commit c8e55730f3
3 changed files with 40 additions and 2 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sat Jul 18 19:53:07 CST 2026
#Sat Jul 18 20:03:10 CST 2026
stageCount=11
libraryProject=
baseVersion=15.20
publishVersion=15.20.10
buildCount=3
buildCount=5
baseBetaVersion=15.20.11
@@ -61,6 +61,7 @@ public class DebugToolButtonsView extends LinearLayout {
Button btnShowLog = (Button) findViewById(R.id.btn_debug_show_log);
Button btnRestartService = (Button) findViewById(R.id.btn_debug_restart_service);
Button btnAppInfo = (Button) findViewById(R.id.btn_debug_app_info);
Button btnLayoutPreview = (Button) findViewById(R.id.btn_debug_layout_preview);
btnClearData.setOnClickListener(new OnClickListener() {
@Override
@@ -103,6 +104,13 @@ public class DebugToolButtonsView extends LinearLayout {
onShowAppInfo();
}
});
btnLayoutPreview.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
onOpenLayoutPreview();
}
});
}
private void onClearData() {
@@ -198,4 +206,18 @@ public class DebugToolButtonsView extends LinearLayout {
ToastUtils.show("获取信息失败: " + e.getMessage());
}
}
private void onOpenLayoutPreview() {
LogUtils.d(TAG, "onOpenLayoutPreview: 打开布局草稿预览窗口");
try {
Intent intent = new Intent();
intent.setClassName(mContext, "cc.winboll.studio.contacts.unittest.LayoutDraftPreViewActivity");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
LogUtils.d(TAG, "onOpenLayoutPreview: 跳转成功");
} catch (Exception e) {
LogUtils.e(TAG, "onOpenLayoutPreview: 跳转失败", e);
ToastUtils.show("跳转失败: " + e.getMessage());
}
}
}
@@ -82,4 +82,20 @@
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right">
<Button
android:id="@+id/btn_debug_layout_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="布局草稿"
android:textSize="12sp"
android:layout_margin="2dp"/>
</LinearLayout>
</LinearLayout>