Available Methods
- findViewById ( )
- getId ( )
- getLayoutParams ( )
- getTag ( )
- setTag ( )
- VISIBLE
- setVisibility ( )
- setOnClickListener ( )
- OnClickListener ( )
- getLeft ( )
- getHeight ( )
- getWidth ( )
- getTop ( )
- getVisibility ( )
- GONE
- setLayoutParams ( )
- getMeasuredHeight ( )
- inflate ( )
- getBottom ( )
- getMeasuredWidth ( )
- setBackgroundColor ( )
- getRight ( )
- measure ( )
- getParent ( )
- layout ( )
- getContext ( )
- setAlpha ( )
- setTranslationX ( )
- startAnimation ( )
- setScaleX ( )
- setScaleY ( )
- setPadding ( )
- setBackgroundResource ( )
- requestFocus ( )
- getLocationOnScreen ( )
- setTranslationY ( )
- setDrawingCacheEnabled ( )
- setPivotY ( )
- setOnLongClickListener ( )
- setPivotX ( )
- setBackground ( )
- INVISIBLE
- draw ( )
- setSystemUiVisibility ( )
- setBackgroundDrawable ( )
- equals ( )
- NO_ID
- getScrollY ( )
- OnLongClickListener ( )
- getBackground ( )
- postDelayed ( )
- setEnabled ( )
- setSelected ( )
- getY ( )
- requestLayout ( )
- getScrollX ( )
- setClickable ( )
- post ( )
- getDrawingCache ( )
- getTranslationY ( )
- setOnTouchListener ( )
- SYSTEM_UI_FLAG_FULLSCREEN
- destroyDrawingCache ( )
- SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- OnTouchListener ( )
- setRotation ( )
- getHitRect ( )
- getPaddingRight ( )
- setRotationY ( )
- invalidate ( )
- getPaddingBottom ( )
- buildDrawingCache ( )
- SYSTEM_UI_FLAG_HIDE_NAVIGATION
- LAYOUT_DIRECTION_RTL
- setId ( )
- setPressed ( )
- getLocationInWindow ( )
- clearAnimation ( )
- SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- SYSTEM_UI_FLAG_LAYOUT_STABLE
- getPaddingLeft ( )
- getX ( )
- getTranslationX ( )
- getDrawingRect ( )
- FOCUS_UP
- getPaddingTop ( )
- SYSTEM_UI_FLAG_IMMERSIVE_STICKY
- setLayerType ( )
- getGlobalVisibleRect ( )
- setFocusable ( )
- setRotationX ( )
- FOCUS_RIGHT
- clearFocus ( )
- getViewTreeObserver ( )
- SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
- canScrollVertically ( )
- getRootView ( )
- dispatchPopulateAccessibilityEvent ( )
- postOnAnimation ( )
- isShown ( )
- setY ( )
- FOCUS_LEFT
- getSystemUiVisibility ( )
- offsetLeftAndRight ( )
- getWindowVisibleDisplayFrame ( )
- getResources ( )
- getScaleX ( )
- addTouchables ( )
- bringToFront ( )
- isEnabled ( )
- performClick ( )
- FOCUS_DOWN
- FOCUS_BACKWARD
- setX ( )
- setFitsSystemWindows ( )
- FOCUS_FORWARD
- SYSTEM_UI_FLAG_LOW_PROFILE
- getWindowToken ( )
- setAnimation ( )
- offsetTopAndBottom ( )
- setFocusableInTouchMode ( )
- generateViewId ( )
- isSelected ( )
- sendAccessibilityEvent ( )
- setOnCreateContextMenuListener ( )
- removeCallbacks ( )
- scrollTo ( )
- setMinimumWidth ( )
- isClickable ( )
- getLayerType ( )
- getAlpha ( )
- setOnSystemUiVisibilityChangeListener ( )
- addFocusables ( )
- isFocusable ( )
- getClass ( )
- setDrawingCacheBackgroundColor ( )
- dispatchTouchEvent ( )
- setActivated ( )
- SYSTEM_UI_FLAG_IMMERSIVE
- LAYER_TYPE_HARDWARE
- hashCode ( )
- setElevation ( )
- addOnLayoutChangeListener ( )
- setAccessibilityDelegate ( )
- OnFocusChangeListener ( )
- LAYER_TYPE_NONE
- isLayoutRequested ( )
- setCameraDistance ( )
- isPressed ( )
- getAnimation ( )
- getScaleY ( )
- getRotationY ( )
- setMinimumHeight ( )
- animate ( )
- getOverScrollMode ( )
- getRotationX ( )
- onTouchEvent ( )
- setContentDescription ( )
- getRotation ( )
- SYSTEM_UI_FLAG_VISIBLE
- setLongClickable ( )
- canScrollHorizontally ( )
- performHapticFeedback ( )
- hasFocus ( )
- removeOnAttachStateChangeListener ( )
- cancelLongPress ( )
- LAYOUT_DIRECTION_LTR
- OVER_SCROLL_NEVER
- isInEditMode ( )
- getLayoutDirection ( )
- playSoundEffect ( )
- getDrawingCacheBackgroundColor ( )
- setOutlineProvider ( )
- getDefaultSize ( )
- isAttachedToWindow ( )
- SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
- setOnKeyListener ( )
- setWillNotCacheDrawing ( )
- hasTransientState ( )
- getLocalVisibleRect ( )
- startDrag ( )
- getPivotY ( )
- willNotCacheDrawing ( )
- LAYER_TYPE_SOFTWARE
- saveHierarchyState ( )
- findViewWithTag ( )
- performLongClick ( )
- requestFocusFromTouch ( )
- setOnApplyWindowInsetsListener ( )
- postInvalidateOnAnimation ( )
- isLongClickable ( )
- setTranslationZ ( )
- setOnFocusChangeListener ( )
- hasFocusable ( )
- setTop ( )
- addOnAttachStateChangeListener ( )
- postInvalidate ( )
- postInvalidateDelayed ( )
- onStartTemporaryDetach ( )
- removeOnLayoutChangeListener ( )
- getAccessibilityViewId ( )
- restoreHierarchyState ( )
- isHardwareAccelerated ( )
- setHasTransientState ( )
- getImportantForAccessibility ( )
- setBottom ( )
- setLeft ( )
- DragShadowBuilder ( )
- getBaseline ( )
- SCROLL_AXIS_VERTICAL
- setScrollX ( )
- isFocusableInTouchMode ( )
- forceLayout ( )
- setPaddingRelative ( )
- SCROLLBAR_POSITION_RIGHT
- setImportantForAccessibility ( )
- getPivotX ( )
- getContentDescription ( )
- announceForAccessibility ( )
- isDrawingCacheEnabled ( )
- showContextMenu ( )
- setDrawingCacheQuality ( )
- setRight ( )
- OnKeyListener ( )
- getFitsSystemWindows ( )
- OnLayoutChangeListener ( )
- getTransitionName ( )
- addView ( )
- dispatchApplyWindowInsets ( )
- onCheckIsTextEditor ( )
- setLayoutDirection ( )
- onFinishTemporaryDetach ( )
- setTransitionName ( )
- isFocused ( )
- getRootWindowInsets ( )
- jumpDrawablesToCurrentState ( )
- setClipToOutline ( )
- getWindowVisibility ( )
- getFocusedRect ( )
- IMPORTANT_FOR_ACCESSIBILITY_AUTO
- setScrollY ( )
- isActivated ( )
- STATUS_BAR_HIDDEN
- setOverScrollMode ( )
- setLabelFor ( )
- getMatrix ( )
- setHorizontalScrollBarEnabled ( )
- isOpaque ( )
- getParentForAccessibility ( )
- setLayerPaint ( )
- startDragAndDrop ( )
- setStateListAnimator ( )
- postOnAnimationDelayed ( )
- getPaddingStart ( )
- hasWindowFocus ( )
- getMinimumHeight ( )
- resolveSize ( )
- findFocus ( )
- AUTOFILL_TYPE_DATE
- setKeepScreenOn ( )
- focusSearch ( )
- getPaddingEnd ( )
- onInitializeAccessibilityNodeInfo ( )
- getViewRootImpl ( )
- isInTouchMode ( )
- getKeyDispatcherState ( )
- isLaidOut ( )
- scrollBy ( )
- AUTOFILL_TYPE_TEXT
- getTranslationZ ( )
- getWindowSystemUiVisibility ( )
- OVER_SCROLL_ALWAYS
- getMeasuredWidthAndState ( )
- performAccessibilityAction ( )
- AccessibilityDelegate ( )
- STATUS_BAR_TRANSLUCENT
- callOnClick ( )
- getAccessibilityLiveRegion ( )
- resolveSizeAndState ( )
- isImportantForAccessibility ( )
- getLabelFor ( )
- OnAttachStateChangeListener ( )
- getMeasuredHeightAndState ( )
- TEXT_ALIGNMENT_GRAVITY
- drawableHotspotChanged ( )
- getAccessibilityNodeProvider ( )
- onInitializeAccessibilityEvent ( )
- getZ ( )
- refreshDrawableState ( )
- IMPORTANT_FOR_ACCESSIBILITY_YES
- AUTOFILL_HINT_USERNAME
- setTagInternal ( )
- getHandler ( )
- getOnFocusChangeListener ( )
- isScrollContainer ( )
- getNextFocusRightId ( )
- IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
- getWindowId ( )
- TEXT_ALIGNMENT_VIEW_START
- onPopulateAccessibilityEvent ( )
- TRANSLATION_Y
- setWillNotDraw ( )
- setTextAlignment ( )
Related Classes
- java.io.File
- android.os.Bundle
- android.content.Context
- android.util.Log
- android.widget.TextView
- android.content.Intent
- android.view.ViewGroup
- android.app.Activity
- android.view.LayoutInflater
- android.os.Build
- android.widget.Toast
- android.widget.ImageView
- android.graphics.Color
- android.os.Handler
- android.net.Uri
- android.widget.Button
- android.graphics.Bitmap
- android.text.TextUtils
- android.view.MotionEvent
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
- android.support.annotation.Nullable
- android.widget.EditText
- android.content.SharedPreferences
- android.support.annotation.NonNull
Java Code Examples for android.view.View#setDrawingCacheQuality()
The following examples show how to use
android.view.View#setDrawingCacheQuality() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppUtils.java From YCWebView with Apache License 2.0 | 6 votes |
/** * 填充布局内容 */ private static Bitmap layoutView(final View viewBitmap, int width, int height) { // 整个View的大小 参数是左上角 和右下角的坐标 viewBitmap.layout(0, 0, width, height); int measuredWidth = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY); int measuredHeight = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.UNSPECIFIED); viewBitmap.measure(measuredWidth, measuredHeight); viewBitmap.layout(0, 0, viewBitmap.getMeasuredWidth(), viewBitmap.getMeasuredHeight()); viewBitmap.setDrawingCacheEnabled(true); viewBitmap.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); viewBitmap.setDrawingCacheBackgroundColor(Color.WHITE); // 把一个View转换成图片 Bitmap cachebmp = viewConversionBitmap(viewBitmap); viewBitmap.destroyDrawingCache(); return cachebmp; }
Example 2
Source File: X5WebUtils.java From YCWebView with Apache License 2.0 | 6 votes |
/** * 填充布局内容 * @param viewBitmap view * @param width 宽 * @param height 高 * @return */ private static Bitmap layoutView(final View viewBitmap, int width, int height) { // 整个View的大小 参数是左上角 和右下角的坐标 viewBitmap.layout(0, 0, width, height); //宽,父容器已经检测出view所需的精确大小,这时候view的最终大小SpecSize所指定的值,相当于match_parent或指定具体数值。 int measuredWidth = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY); //高,表示父容器不对View有任何限制,一般用于系统内部,表示一种测量状态; int measuredHeight = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.UNSPECIFIED); viewBitmap.measure(measuredWidth, measuredHeight); viewBitmap.layout(0, 0, viewBitmap.getMeasuredWidth(), viewBitmap.getMeasuredHeight()); viewBitmap.setDrawingCacheEnabled(true); viewBitmap.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); viewBitmap.setDrawingCacheBackgroundColor(Color.WHITE); // 把一个View转换成图片 Bitmap cachebmp = viewConversionBitmap(viewBitmap); viewBitmap.destroyDrawingCache(); return cachebmp; }
Example 3
Source File: RemoteViewsUtils.java From container with GNU General Public License v3.0 | 6 votes |
public Bitmap createBitmap(final Context context, RemoteViews remoteViews, boolean isBig, boolean systemId) { View mCache = null; try { mCache = createView(context, remoteViews, isBig, systemId); } catch (Throwable throwable) { try { // apply失败后,根据布局id创建view mCache = LayoutInflater.from(context).inflate(remoteViews.getLayoutId(), null); } catch (Throwable e) { } } if (mCache == null) { return null; } mCache.setDrawingCacheEnabled(true); mCache.buildDrawingCache(); mCache.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); return mCache.getDrawingCache(); }
Example 4
Source File: FastBlur.java From GearLoadingProject with Apache License 2.0 | 6 votes |
private Bitmap prepareAndSetBitmap(final View targetView) { targetView.setDrawingCacheEnabled(true); targetView.destroyDrawingCache(); targetView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_AUTO); targetView.buildDrawingCache(true); Bitmap sourceBitmap = Bitmap.createBitmap(targetView.getDrawingCache()); targetView.setDrawingCacheEnabled(false); targetView.destroyDrawingCache(); Bitmap overlay = Bitmap.createBitmap((int) (targetView.getMeasuredWidth() / scaleFactor), (int) (targetView.getMeasuredHeight() / scaleFactor), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(overlay); // canvas.translate(-targetView.getLeft() / scaleFactor, -targetView.getTop() / scaleFactor); canvas.scale(1 / scaleFactor, 1 / scaleFactor); Paint paint = new Paint(); paint.setColor(Color.RED); paint.setFlags(Paint.FILTER_BITMAP_FLAG); canvas.drawBitmap(sourceBitmap, 0, 0, paint); // canvas.drawColor(Color.RED); sourceBitmap.recycle(); return FastBlur.doBlur(overlay, radius, false); }
Example 5
Source File: MainActivity.java From TLint with Apache License 2.0 | 6 votes |
private Drawable buildCounterDrawable(int count, int backgroundImageId) { LayoutInflater inflater = LayoutInflater.from(this); View view = inflater.inflate(R.layout.notification_count_layout, null); view.setBackgroundResource(backgroundImageId); TextView tvCount = (TextView) view.findViewById(R.id.tvCount); if (count == 0) { tvCount.setVisibility(View.GONE); } else { tvCount.setVisibility(View.VISIBLE); tvCount.setText(String.valueOf(count)); } view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)); view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); view.setDrawingCacheEnabled(true); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache()); view.setDrawingCacheEnabled(false); return new BitmapDrawable(getResources(), bitmap); }
Example 6
Source File: UI.java From Android-Commons with Apache License 2.0 | 6 votes |
/** * Generates a screenshot of the specified `View` * * @param view the `View` component * @return the screenshot */ public static Bitmap getViewScreenshot(final View view) { // set up the drawing cache view.setDrawingCacheEnabled(true); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); // get the screenshot final Bitmap viewScreenshot = view.getDrawingCache(true); final Bitmap output = viewScreenshot.copy(viewScreenshot.getConfig(), false); // disable the drawing cache again view.destroyDrawingCache(); view.setDrawingCacheEnabled(false); return output; }
Example 7
Source File: PBitmapUtils.java From YImagePicker with Apache License 2.0 | 5 votes |
/** * @return view的截图,在InVisible时也可以获取到bitmap */ public static Bitmap getViewBitmap(View view) { view.measure(View.MeasureSpec.makeMeasureSpec(view.getMeasuredWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(view.getMeasuredHeight(), View.MeasureSpec.EXACTLY)); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); view.setDrawingCacheEnabled(true); view.buildDrawingCache(true); return view.getDrawingCache(true); }
Example 8
Source File: PBitmapUtils.java From YImagePicker with Apache License 2.0 | 5 votes |
/** * @return view的截图,在InVisible时也可以获取到bitmap */ public static Bitmap getViewBitmap(View view) { view.measure(View.MeasureSpec.makeMeasureSpec(view.getMeasuredWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(view.getMeasuredHeight(), View.MeasureSpec.EXACTLY)); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); view.setDrawingCacheEnabled(true); view.buildDrawingCache(true); return view.getDrawingCache(true); }
Example 9
Source File: Blur.java From likequanmintv with Apache License 2.0 | 5 votes |
public static Bitmap of(View view, BlurFactor factor) { view.setDrawingCacheEnabled(true); view.destroyDrawingCache(); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); Bitmap cache = view.getDrawingCache(); Bitmap bitmap = of(view.getContext(), cache, factor); cache.recycle(); return bitmap; }
Example 10
Source File: BlurTask.java From likequanmintv with Apache License 2.0 | 5 votes |
public BlurTask(View target, BlurFactor factor, Callback callback) { target.setDrawingCacheEnabled(true); this.res = target.getResources(); this.factor = factor; this.callback = callback; target.destroyDrawingCache(); target.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); capture = target.getDrawingCache(); contextWeakRef = new WeakReference<>(target.getContext()); }
Example 11
Source File: TransitionHelper.java From ColorReference with Apache License 2.0 | 5 votes |
private static Bitmap takeSnapshot(View view) { view.setDrawingCacheEnabled(true); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_AUTO); Bitmap snapshot = null; Bitmap cacheBitmap = view.getDrawingCache(); if (cacheBitmap != null) { snapshot = Bitmap.createBitmap(cacheBitmap); view.setDrawingCacheEnabled(false); view.destroyDrawingCache(); } return snapshot; }
Example 12
Source File: Blur.java From Blurry with Apache License 2.0 | 5 votes |
public static Bitmap of(View view, BlurFactor factor) { view.setDrawingCacheEnabled(true); view.destroyDrawingCache(); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); Bitmap cache = view.getDrawingCache(); Bitmap bitmap = of(view.getContext(), cache, factor); cache.recycle(); return bitmap; }
Example 13
Source File: BlurTask.java From Blurry with Apache License 2.0 | 5 votes |
public BlurTask(View target, BlurFactor factor, Callback callback) { this.res = target.getResources(); this.factor = factor; this.callback = callback; this.contextWeakRef = new WeakReference<>(target.getContext()); target.setDrawingCacheEnabled(true); target.destroyDrawingCache(); target.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); bitmap = target.getDrawingCache(); }
Example 14
Source File: Blur.java From MyBlogDemo with Apache License 2.0 | 5 votes |
public static Bitmap of(View view, BlurFactor factor) { view.setDrawingCacheEnabled(true); view.destroyDrawingCache(); view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); Bitmap cache = view.getDrawingCache(); Bitmap bitmap = of(view.getContext(), cache, factor); cache.recycle(); return bitmap; }
Example 15
Source File: BlurTask.java From MyBlogDemo with Apache License 2.0 | 5 votes |
public BlurTask(View target, BlurFactor factor, Callback callback) { target.setDrawingCacheEnabled(true); this.res = target.getResources(); this.factor = factor; this.callback = callback; target.destroyDrawingCache(); target.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW); capture = target.getDrawingCache(); contextWeakRef = new WeakReference<>(target.getContext()); }