10-of-my-most-popular-text-to-image-series-prompts-78b0897e
generate a bunch of images, then you curate the results to handpick the best ones
YZTurboWebAndroid 高性能 Android WebView 容器 SDK 接入。用于在 Android 项目中集成 WebView 容器,实现: (1) WebView 预加载与复用,提升 H5 页面加载速度 (2) 离线包管理,拦截请求优先命中本地资源 (3) JS Bridge 双向通信,Native 与 H5 互调 适用场景:Android App 接入 H5 页面、需要离线包能力、需要 JS 通信的业务
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install hefuwei-95/yzturbo-web-android打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
Android 高性能 WebView 容器解决方案,支持 WebView 复用、离线包管理、JS Bridge 通信。
在 Application 中初始化:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
WebViewLoader.INSTANCE.init(
WebViewLoaderConfig.Builder(getApplication())
.appKey("retail") // 应用标识
.poolSize(2) // WebView 池大小
.preloadUrl("https://xxx.com/m")
.build()
)
}
}
添加依赖:
dependencies {
implementation 'com.youzan.turboweb:turbo-web:1.0.1'
}
class WebActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_web)
if (savedInstanceState == null) {
val fragment = WebViewFragment().apply {
arguments = Bundle().apply {
putString("web_view_url", "https://your-domain.com/path")
putString("web_view_title", "页面标题")
putBoolean("show_title_bar", true)
putBoolean("show_progress_bar", true)
}
}
supportFragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.commit()
}
}
}
class MyWebFragment : WebViewFragment() {
override fun onPageReady() {
super.onPageReady()
// 页面加载完成后的自定义逻辑
}
}
// 1. 获取 WebView(复用池中有可用则复用)
val (webView, isReused) = WebViewLoader.acquireWebView(
context = this,
url = "https://your-domain.com/app/path",
listener = object : WebViewListener {
override fun onPageFinished(view: WebView?, url: String?) {}
}
)
// 2. 添加...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# YZTurboWebAndroid
Android 高性能 WebView 容器解决方案,支持 WebView 复用、离线包管理、JS Bridge 通信。
## 初始化配置
在 `Application` 中初始化:
```kotlin
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
WebViewLoader.INSTANCE.init(
WebViewLoaderConfig.Builder(getApplication())
.appKey("retail") // 应用标识
.poolSize(2) // WebView 池大小
.preloadUrl("https://xxx.com/m")
.build()
)
}
}
```
添加依赖:
```groovy
dependencies {
implementation 'com.youzan.turboweb:turbo-web:1.0.1'
}
```
## 使用 WebViewFragment(推荐)
### 基础用法
```kotlin
class WebActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_web)
if (savedInstanceState == null) {
val fragment = WebViewFragment().apply {
arguments = Bundle().apply {
putString("web_view_url", "https://your-domain.com/path")
putString("web_view_title", "页面标题")
putBoolean("show_title_bar", true)
putBoolean("show_progress_bar", true)
}
}
supportFragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.commit()
}
}
}
```
### 继承定制
```kotlin
class MyWebFragment : WebViewFragment() {
override fun onPageReady() {
super.onPageReady()
// 页面加载完成后的自定义逻辑
}
}
```
## 手动管理 WebView(进阶)
```kotlin
// 1. 获取 WebView(复用池中有可用则复用)
val (webView, isReused) = WebViewLoader.acquireWebView(
context = this,
url = "https://your-domain.com/app/path",
listener = object : WebViewListener {
override fun onPageFinished(view: WebView?, url: String?) {}
}
)
// 2. 添加...generate a bunch of images, then you curate the results to handpick the best ones
generate a bunch of images, then you curate the results to handpick the best ones
Productivity system based on Maya calendar with 13 natural tones for project management and personal development
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.