Use this skill when a web app needs to call the JavaScript Bridge injected by the LazyCat Android client.
The following requirements usually correspond to this skill:
- Control whether the Android shell's bottom Snackbar or bottom prompt is displayed
- Close, restore, and other host-level prompts such as the download complete prompt
- Handle
lzc_toast、setSnackBarEnabled、showSnakecalls
lzc_toast.setSnackBarEnabled
This interface is injected by the Android WebView host under the name lzc_toast . The call parameter is a Boolean value:
lzc_toast.setSnackBarEnabled(false) // 禁止宿主 Snackbar
lzc_toast.setSnackBarEnabled(true) // 恢复宿主 Snackbar
It only controls the host shell's Snackbar display switch and does not change the web page's own Toast, Snackbar, or other UI. After it is disabled, the host will directly ignore display requests for lzc_toast.showSnake(...) and the download complete prompt; the default state is enabled.
Compatibility and calling method
- Only applies to the LazyCat Android WebView shell; ordinary browsers, desktop, iOS, and WebViews without this bridge injected do not provide this interface.
- A capability check must be performed before calling to avoid errors when the web page runs in a non-Android environment:
if (globalThis.lzc_toast && typeof globalThis.lzc_toast.setSnackBarEnabled === 'function') {
globalThis.lzc_toast.setSnackBarEnabled(false)
}
- This is a method exposed by Android
@JavascriptInterface. The call should be made after the page has finished loading; do not treat it as a cross-platform standard API or a persistent setting. - When the prompt needs to be restored, explicitly pass in
true. The state after a page refresh or host lifecycle rebuild should not be assumed to be persisted by the web page.
Implementation basis: the Android shell injects ToastInterface as lzc_toast,setSnackBarEnabled(Boolean) modifies the Snackbar switch in the host's memory; this state is not an app configuration file or server-side configuration.