android.view.View#isHardwareAccelerated ( )源码实例Demo

下面列出了android.view.View#isHardwareAccelerated ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: flickr-uploader   文件: SlidingDrawer.java
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);
}
 
源代码2 项目: android_9.0.0_r45   文件: SlidingDrawer.java
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);        
}
 
源代码3 项目: TigerVideo   文件: DisplayManager.java
public static boolean isHardwareAccelerated(final View v) {
    if (Build.VERSION.SDK_INT >= 11) {
        try {
            return v.isHardwareAccelerated();
        } catch (Exception e) {
        }
    }
    return false;
}
 
源代码4 项目: Trebuchet   文件: ShortcutAndWidgetContainer.java
@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);
        }
    }
}
 
源代码5 项目: sa-sdk-android   文件: ViewUtil.java
@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);
            }
        }
    }
}
 
@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);
        }
    }
}
 
@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);
        }
    }
}
 
源代码8 项目: LB-Launcher   文件: PagedViewCellLayoutChildren.java
@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);
        }
    }
}
 
源代码9 项目: LB-Launcher   文件: ShortcutAndWidgetContainer.java
@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);
        }
    }
}
 
源代码10 项目: slidingtabs   文件: MySlidingDrawer.java
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);        
}
 
源代码11 项目: sealrtc-android   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码12 项目: PLDroidShortVideo   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码13 项目: Musicoco   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码14 项目: IdealMedia   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码15 项目: FuAgoraDemoDroid   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码16 项目: SwipeBack   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码17 项目: Sky31Radio   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码19 项目: discreteSeekBar   文件: SeekBarCompatDontCrash.java
public static boolean isHardwareAccelerated(View view) {
    return view.isHardwareAccelerated();
}
 
源代码20 项目: Klyph   文件: KlyphSlidingDrawer.java
@TargetApi(11)
private void checkHardwareAccelerated(View view)
{
	if (!view.isHardwareAccelerated()) view.buildDrawingCache();
}
 
 方法所在类
 同类方法