com.tencent.smtt.sdk.WebView.drawChild()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中com.tencent.smtt.sdk.WebView.drawChild()方法的一些代码示例,展示了WebView.drawChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.drawChild()方法的具体详情如下:
包路径:com.tencent.smtt.sdk.WebView
类名称:WebView
方法名:drawChild

WebView.drawChild介绍

暂无

代码示例

代码示例来源:origin: leftcoding/GankLy

@Override
  protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
//        boolean ret = super.drawChild(canvas, child, drawingTime);
//        canvas.save();
//        Paint paint = new Paint();
//        paint.setColor(0x7fff0000);
//        paint.setTextSize(24.f);
//        paint.setAntiAlias(true);
//        if (getX5WebViewExtension() != null) {
//            canvas.drawText(this.getContext().getPackageName() + "-pid:"
//                    + android.os.Process.myPid(), 10, 50, paint);
//            canvas.drawText(
//                    "X5  Core:" + QbSdk.getTbsVersion(this.getContext()), 10,
//                    100, paint);
//        } else {
//            canvas.drawText(this.getContext().getPackageName() + "-pid:"
//                    + android.os.Process.myPid(), 10, 50, paint);
//            canvas.drawText("Sys Core", 10, 100, paint);
//        }
//        canvas.drawText(Build.MANUFACTURER, 10, 150, paint);
//        canvas.drawText(Build.MODEL, 10, 200, paint);
//        canvas.restore();
//        return ret;
    return super.drawChild(canvas, child, drawingTime);
  }

代码示例来源:origin: xkzh/yduoduo

/**
   * 这里可以为自定义webview绘制背景或文字
   * @param canvas
   * @param child
   * @param drawingTime
   * @return
   */
  @Override
  protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
    boolean ret = super.drawChild(canvas, child, drawingTime);
    canvas.save();
    Paint paint = new Paint();
    paint.setColor(0x7fff0000);
    paint.setTextSize(24.f);
    paint.setAntiAlias(true);
    canvas.drawText("", 10, 50, paint);
//        if (getX5WebViewExtension() != null) {
//            canvas.drawText(
//                    "X5  Core:" + QbSdk.getTbsVersion(this.getContext()), 10,
//                    100, paint);
//        }
    canvas.restore();
    return ret;
  }

代码示例来源:origin: luili16/UIMocker

@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
  boolean ret = super.drawChild(canvas, child, drawingTime);
  canvas.save();
  Paint paint = new Paint();
  paint.setColor(0x7fff0000);
  paint.setTextSize(24.f);
  paint.setAntiAlias(true);
  if (getX5WebViewExtension() != null) {
    canvas.drawText(this.getContext().getPackageName() + "-pid:"
        + android.os.Process.myPid(), 10, 50, paint);
    canvas.drawText(
        "X5  Core:" + QbSdk.getTbsVersion(this.getContext()), 10,
        100, paint);
  } else {
    canvas.drawText(this.getContext().getPackageName() + "-pid:"
        + android.os.Process.myPid(), 10, 50, paint);
    canvas.drawText("Sys Core", 10, 100, paint);
  }
  canvas.drawText(Build.MANUFACTURER, 10, 150, paint);
  canvas.drawText(Build.MODEL, 10, 200, paint);
  canvas.restore();
  return ret;
}

代码示例来源:origin: linxin6560/DetailScrollView

@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
  boolean ret = super.drawChild(canvas, child, drawingTime);
  canvas.save();
  Paint paint = new Paint();
  paint.setColor(0x7fff0000);
  paint.setTextSize(24.f);
  paint.setAntiAlias(true);
  if (getX5WebViewExtension() != null) {
    canvas.drawText(this.getContext().getPackageName() + "-pid:"
        + android.os.Process.myPid(), 10, 50, paint);
    canvas.drawText(
        "X5  Core:" + QbSdk.getTbsVersion(this.getContext()), 10,
        100, paint);
  } else {
    canvas.drawText(this.getContext().getPackageName() + "-pid:"
        + android.os.Process.myPid(), 10, 50, paint);
    canvas.drawText("Sys Core", 10, 100, paint);
  }
  canvas.drawText(Build.MANUFACTURER, 10, 150, paint);
  canvas.drawText(Build.MODEL, 10, 200, paint);
  canvas.restore();
  return ret;
}

相关文章