“664bb9a824cbc5d42dd00fff3a1024af09bc2786”上不存在“lite/git@gitcode.net:paddlepaddle/Paddle-Lite.git”
index.uts 797 字节
Newer Older
1
import { CanWebViewGoBack, CanWebViewGoForward, HasNativeView} from "../interface";
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
2
import WebView from 'android.webkit.WebView';
3
import View from "android.view.View"
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
4

DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
5 6
export const canWebViewGoBack : CanWebViewGoBack = function (elementId : string) : boolean {
  const view = uni.getElementById(elementId)?.getAndroidView<WebView>();
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
7 8 9
  return view == null ? false : view.canGoBack();
}

DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
10 11
export const canWebViewGoForward : CanWebViewGoForward = function (elementId : string) : boolean {
  const view = uni.getElementById(elementId)?.getAndroidView<WebView>();
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
12
  return view == null ? false : view.canGoForward();
13 14 15 16 17 18
}

export const hasNativeView : HasNativeView = function (elementId : string) : boolean {
  const view = uni.getElementById(elementId)?.getAndroidView<View>();
  return view != null;
}