android.view.View.willNotCacheDrawing()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(167)

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

View.willNotCacheDrawing介绍

暂无

代码示例

代码示例来源:origin: ImmortalZ/TransitionHelper

view.setPressed(false);
boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);

代码示例来源:origin: gzu-liyujiang/AndroidPicker

view.clearFocus();
view.setPressed(false);
boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);

代码示例来源:origin: stackoverflow.com

/**
    * Draw the view into a bitmap.
    */
   private Bitmap getViewBitmap(View v) {
     v.clearFocus();
     v.setPressed(false);
     boolean willNotCache = v.willNotCacheDrawing();
     v.setWillNotCacheDrawing(false);
     // Reset the drawing cache background color to fully transparent
     // for the duration of this operation
     int color = v.getDrawingCacheBackgroundColor();
     v.setDrawingCacheBackgroundColor(0);
     if (color != 0) {
       v.destroyDrawingCache();
     }
     v.buildDrawingCache();
     Bitmap cacheBitmap = v.getDrawingCache();
     if (cacheBitmap == null) {
       Log.e(TAG, "failed getViewBitmap(" + v + ")", new RuntimeException());
       return null;
     }
     Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);
     // Restore the view
     v.destroyDrawingCache();
     v.setWillNotCacheDrawing(willNotCache);
     v.setDrawingCacheBackgroundColor(color);
     return bitmap;
   }

代码示例来源:origin: Blizzard-liu/AndroidUtils

boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);
int color = view.getDrawingCacheBackgroundColor();

代码示例来源:origin: jingle1267/android-utils

boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);
int color = view.getDrawingCacheBackgroundColor();

代码示例来源:origin: roomanl/AndroidDownload

view.clearFocus();
view.setPressed(false);
boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);

代码示例来源:origin: WeAreFairphone/FP2-Launcher

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: fookwood/Launcher3

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: imLibo/FilePicker

view.clearFocus();
view.setPressed(false);
boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);

代码示例来源:origin: jinguangyue/Android-CustomCamera

boolean willNotCache = view.willNotCacheDrawing();// 返回视图是否可以保存他的画图缓存
view.setWillNotCacheDrawing(false);

代码示例来源:origin: gavinliu/SimpleOneStep

private Bitmap getViewBitmap(View v) {
  v.clearFocus();
  v.setPressed(false);
  boolean willNotCache = v.willNotCacheDrawing();
  v.setWillNotCacheDrawing(false);
  int color = v.getDrawingCacheBackgroundColor();
  v.setDrawingCacheBackgroundColor(0);
  if (color != 0) {
    v.destroyDrawingCache();
  }
  v.buildDrawingCache();
  Bitmap cacheBitmap = v.getDrawingCache();
  if (cacheBitmap == null) {
    return null;
  }
  Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);
  v.destroyDrawingCache();
  v.setWillNotCacheDrawing(willNotCache);
  v.setDrawingCacheBackgroundColor(color);
  return bitmap;
}

代码示例来源:origin: stackoverflow.com

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: 18Gray/CommonUtils

/**
 * 普通View截屏
 * @param v
 * @param fileName
 * @return
 */
public static Bitmap screenShotNormalView(View v, String fileName)
{
  v.clearFocus();
  v.setPressed(false);
  boolean willNotCache = v.willNotCacheDrawing();
  v.setWillNotCacheDrawing(false);
  int color = v.getDrawingCacheBackgroundColor();
  v.setDrawingCacheBackgroundColor(0);
  if (color != 0)
  {
    v.destroyDrawingCache();
  }
  v.buildDrawingCache();
  Bitmap cacheBitmap = v.getDrawingCache();
  Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);
  // Restore the view
  v.destroyDrawingCache();
  v.setWillNotCacheDrawing(willNotCache);
  v.setDrawingCacheBackgroundColor(color);
  return bitmap;
}

代码示例来源:origin: MichaelJokAr/retrofit-download-file

boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: jamorham/xDrip-plus

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: jamorham/xDrip-plus

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: NightscoutFoundation/xDrip

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

代码示例来源:origin: FreedomZZQ/YouJoin-Android

boolean willNotCache = view.willNotCacheDrawing();
view.setWillNotCacheDrawing(false);
int color = view.getDrawingCacheBackgroundColor();

代码示例来源:origin: luhaoaimama1/zone-sdk

boolean willNotCache = view.willNotCacheDrawing(); // 返回视图是否可以保存他的画图缓存
view.setWillNotCacheDrawing(false);

代码示例来源:origin: stackoverflow.com

v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);

相关文章

微信公众号

最新文章

更多

View类方法