Rechercher

PythonReactSEOPDF
OpenClaw

yzturbo-web-android

YZTurboWebAndroid 高性能 Android WebView 容器 SDK 接入。用于在 Android 项目中集成 WebView 容器,实现: (1) WebView 预加载与复用,提升 H5 页面加载速度 (2) 离线包管理,拦截请求优先命中本地资源 (3) JS Bridge 双向通信,Native 与 H5 互调 适用场景:Android App 接入 H5 页面、需要离线包能力、需要 JS 通信的业务

hefuwei-950 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install hefuwei-95/yzturbo-web-android

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

YZTurboWebAndroid

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'
}

使用 WebViewFragment(推荐)

基础用法
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()
        // 页面加载完成后的自定义逻辑
    }
}

手动管理 WebView(进阶)

// 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. 添加...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/hefuwei-95/yzturbo-web-android
Version
—
Commit
012f7bb0834aa8c1e02c79be8a4e9a7378a8c669
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

Contenu extrait

SKILL.md
# 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. 添加...

Skills associés

OpenClaw

1password

daggerkun007

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.