实现JS方法(openUrl),能够弹窗提示用户是否跳转外部链接 (#4649)

* feat(ui): 添加外部链接跳转确认对话框

- 新增 ConfirmationDialogActivity 用于显示跳转确认对话框
- 在 AndroidManifest.xml 中注册新活动
- 添加 confirmation_dialog.xml 布局文件- 在 JsExtensions.kt 中实现 openUrl 函数以启动对话框
- 更新 styles.xml 添加透明主题样式
- 在 strings.xml 中添加新的错误提示字符串

* feat(dialog): 优化外部链接/应用跳转确认对话框

- 更新对话框布局,增加文本大小设置
- 添加来源标签显示,提高用户识别度
- 优化对话框逻辑,正确处理视图初始化顺序
- 更新字符串资源,支持来源标签显示

---------

Co-authored-by: SunQAQ <sunqi87c6@gmail.com>
This commit is contained in:
Sun-QAQ
2025-02-11 19:49:08 +08:00
committed by GitHub
co-authored by SunQAQ
parent fc96457df1
commit 1ea9952f60
6 changed files with 158 additions and 0 deletions
+2
View File
@@ -1185,4 +1185,6 @@
<string name="theme_config">主题配置</string>
<string name="menu_download_after">Download the chapter after</string>
<string name="menu_download_all">Download all chapter</string>
<string name="error_occurred" translatable="false">打开失败</string>
<string name="confirmation_message" translatable="false">%s正在请求跳转外部链接/应用,是否跳转?</string>
</resources>
+12
View File
@@ -127,4 +127,16 @@
<item name="android:layout_width">wrap_content</item>
</style>
<!-- 基础透明主题 -->
<style name="Theme.Translucent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
</style>
<!-- 无标题栏变体 -->
<style name="Theme.Translucent.NoTitleBar" parent="Theme.Translucent">
<item name="windowNoTitle">true</item>
</style>
</resources>