Java Code Examples for android.view.View#isHardwareAccelerated()
The following examples show how to use
android.view.View#isHardwareAccelerated() .
These examples are extracted from open source projects.
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 Project: flickr-uploader File: SlidingDrawer.java License: GNU General Public License v2.0 | 6 votes |
private void prepareContent() { if (mAnimating) { return; } // Something changed in the content, we need to honor the layout request // before creating the cached bitmap final View content = mContent; if (content.isLayoutRequested()) { final int childHeight = mHandleHeight; int height = getBottom() - getTop() - childHeight - mTopOffset; content.measure(MeasureSpec.makeMeasureSpec(getRight() - getLeft(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); content.layout(0, mTopOffset + childHeight, content.getMeasuredWidth(), mTopOffset + childHeight + content.getMeasuredHeight()); } // Try only once⦠we should really loop but it's not a big deal // if the draw was cancelled, it will only be temporary anyway content.getViewTreeObserver().dispatchOnPreDraw(); if (!content.isHardwareAccelerated()) content.buildDrawingCache(); content.setVisibility(View.GONE); }
Example 2
Source Project: android_9.0.0_r45 File: SlidingDrawer.java License: Apache License 2.0 | 5 votes |
private void prepareContent() { if (mAnimating) { return; } // Something changed in the content, we need to honor the layout request // before creating the cached bitmap final View content = mContent; if (content.isLayoutRequested()) { if (mVertical) { final int childHeight = mHandleHeight; int height = mBottom - mTop - childHeight - mTopOffset; content.measure(MeasureSpec.makeMeasureSpec(mRight - mLeft, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); content.layout(0, mTopOffset + childHeight, content.getMeasuredWidth(), mTopOffset + childHeight + content.getMeasuredHeight()); } else { final int childWidth = mHandle.getWidth(); int width = mRight - mLeft - childWidth - mTopOffset; content.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(mBottom - mTop, MeasureSpec.EXACTLY)); content.layout(childWidth + mTopOffset, 0, mTopOffset + childWidth + content.getMeasuredWidth(), content.getMeasuredHeight()); } } // Try only once... we should really loop but it's not a big deal // if the draw was cancelled, it will only be temporary anyway content.getViewTreeObserver().dispatchOnPreDraw(); if (!content.isHardwareAccelerated()) content.buildDrawingCache(); content.setVisibility(View.GONE); }
Example 3
Source Project: TigerVideo File: DisplayManager.java License: Apache License 2.0 | 5 votes |
public static boolean isHardwareAccelerated(final View v) { if (Build.VERSION.SDK_INT >= 11) { try { return v.isHardwareAccelerated(); } catch (Exception e) { } } return false; }
Example 4
Source Project: Trebuchet File: ShortcutAndWidgetContainer.java License: GNU General Public License v3.0 | 5 votes |
@Override protected void setChildrenDrawingCacheEnabled(boolean enabled) { final int count = getChildCount(); for (int i = 0; i < count; i++) { final View view = getChildAt(i); view.setDrawingCacheEnabled(enabled); // Update the drawing caches if (!view.isHardwareAccelerated() && enabled) { view.buildDrawingCache(true); } } }
Example 5
Source Project: sa-sdk-android File: ViewUtil.java License: Apache License 2.0 | 5 votes |
@SuppressLint("NewApi") public static void invalidateLayerTypeView(View[] views) { for (View view : views) { if (ViewUtil.viewVisibilityInParents(view) && view.isHardwareAccelerated()) { checkAndInvalidate(view); if (view instanceof ViewGroup) { invalidateViewGroup((ViewGroup) view); } } } }
Example 6
Source Project: TurboLauncher File: PagedViewCellLayoutChildren.java License: Apache License 2.0 | 5 votes |
@Override protected void setChildrenDrawingCacheEnabled(boolean enabled) { final int count = getChildCount(); for (int i = 0; i < count; i++) { final View view = getChildAt(i); view.setDrawingCacheEnabled(enabled); // Update the drawing caches if (!view.isHardwareAccelerated()) { view.buildDrawingCache(true); } } }
Example 7
Source Project: TurboLauncher File: ShortcutAndWidgetContainer.java License: Apache License 2.0 | 5 votes |
@Override protected void setChildrenDrawingCacheEnabled(boolean enabled) { final int count = getChildCount(); for (int i = 0; i < count; i++) { final View view = getChildAt(i); view.setDrawingCacheEnabled(enabled); // Update the drawing caches if (!view.isHardwareAccelerated() && enabled) { view.buildDrawingCache(true); } } }
Example 8
Source Project: LB-Launcher File: PagedViewCellLayoutChildren.java License: Apache License 2.0 | 5 votes |
@Override protected void setChildrenDrawingCacheEnabled(boolean enabled) { final int count = getChildCount(); for (int i = 0; i < count; i++) { final View view = getChildAt(i); view.setDrawingCacheEnabled(enabled); // Update the drawing caches if (!view.isHardwareAccelerated()) { view.buildDrawingCache(true); } } }
Example 9
Source Project: LB-Launcher File: ShortcutAndWidgetContainer.java License: Apache License 2.0 | 5 votes |
@Override protected void setChildrenDrawingCacheEnabled(boolean enabled) { final int count = getChildCount(); for (int i = 0; i < count; i++) { final View view = getChildAt(i); view.setDrawingCacheEnabled(enabled); // Update the drawing caches if (!view.isHardwareAccelerated() && enabled) { view.buildDrawingCache(true); } } }
Example 10
Source Project: slidingtabs File: MySlidingDrawer.java License: GNU General Public License v2.0 | 5 votes |
private void prepareContent() { if (mAnimating) { return; } // Something changed in the content, we need to honor the layout request // before creating the cached bitmap final View content = mContent; if (content.isLayoutRequested()) { if (mVertical) { final int childHeight = mHandleHeight; int height = getBottom() - getTop() - childHeight - mTopOffset; content.measure(MeasureSpec.makeMeasureSpec(getRight() - getLeft(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); content.layout(0, mTopOffset + childHeight, content.getMeasuredWidth(), mTopOffset + childHeight + content.getMeasuredHeight()); } else { final int childWidth = mHandle.getWidth(); int width = getRight() - getLeft() - childWidth - mTopOffset; content.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(getBottom() - getTop() , MeasureSpec.EXACTLY)); content.layout(childWidth + mTopOffset, 0, mTopOffset + childWidth + content.getMeasuredWidth(), content.getMeasuredHeight()); } } // Try only once... we should really loop but it's not a big deal // if the draw was cancelled, it will only be temporary anyway content.getViewTreeObserver().dispatchOnPreDraw(); if (!content.isHardwareAccelerated()) content.buildDrawingCache(); content.setVisibility(View.GONE); }
Example 11
Source Project: sealrtc-android File: SeekBarCompatDontCrash.java License: MIT License | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 12
Source Project: PLDroidShortVideo File: SeekBarCompatDontCrash.java License: Apache License 2.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 13
Source Project: Musicoco File: SeekBarCompatDontCrash.java License: Apache License 2.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 14
Source Project: IdealMedia File: SeekBarCompatDontCrash.java License: Apache License 2.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 15
Source Project: FuAgoraDemoDroid File: SeekBarCompatDontCrash.java License: MIT License | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 16
Source Project: SwipeBack File: SeekBarCompatDontCrash.java License: GNU General Public License v3.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 17
Source Project: Sky31Radio File: SeekBarCompatDontCrash.java License: Apache License 2.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 18
Source Project: Panoramic-Screenshot File: SeekBarCompatDontCrash.java License: GNU General Public License v3.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 19
Source Project: discreteSeekBar File: SeekBarCompatDontCrash.java License: Apache License 2.0 | 4 votes |
public static boolean isHardwareAccelerated(View view) { return view.isHardwareAccelerated(); }
Example 20
Source Project: Klyph File: KlyphSlidingDrawer.java License: MIT License | 4 votes |
@TargetApi(11) private void checkHardwareAccelerated(View view) { if (!view.isHardwareAccelerated()) view.buildDrawingCache(); }