当前位置: 首页>>代码示例>>Java>>正文


Java View.LAYER_TYPE_HARDWARE属性代码示例

本文整理汇总了Java中android.view.View.LAYER_TYPE_HARDWARE属性的典型用法代码示例。如果您正苦于以下问题:Java View.LAYER_TYPE_HARDWARE属性的具体用法?Java View.LAYER_TYPE_HARDWARE怎么用?Java View.LAYER_TYPE_HARDWARE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.view.View的用法示例。


在下文中一共展示了View.LAYER_TYPE_HARDWARE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: destroy

public void destroy() {
  ComponentObserver observer;
  if ((observer = getInstance().getComponentObserver()) != null) {
    observer.onPreDestory(this);
  }

  if (WXEnvironment.isApkDebugable() && !WXUtils.isUiThread()) {
    throw new WXRuntimeException("[WXComponent] destroy can only be called in main thread");
  }
  if(mHost!= null && mHost.getLayerType()==View.LAYER_TYPE_HARDWARE && isLayerTypeEnabled()) {
    mHost.setLayerType(View.LAYER_TYPE_NONE, null);
  }
  removeAllEvent();
  removeStickyStyle();

  View view;
  if(mDomObj.isFixed() && (view = getHostView()) != null){
    getInstance().removeFixedView(view);
  }

  mDomObj = ImmutableDomObject.DESTROYED;
  mIsDestroyed = true;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:23,代码来源:WXComponent.java

示例2: manageLayer

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void manageLayer(View v, boolean enableHardware) {
	if (!API_11) return;
	int layerType = enableHardware ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;
	if (layerType != v.getLayerType())
		v.setLayerType(layerType, null);
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:7,代码来源:JazzyViewPager.java

示例3: manageLayers

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void manageLayers(float percentOpen) {
    if (Build.VERSION.SDK_INT < 11) return;

    boolean layer = percentOpen > 0.0f && percentOpen < 1.0f;
    final int layerType = layer ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;

    if (layerType != getContent().getLayerType()) {
        mHandler.post(new Runnable() {
            public void run() {
                Log.v(TAG, "changing layerType. hardware? " + (layerType == View.LAYER_TYPE_HARDWARE));
                getContent().setLayerType(layerType, null);
                getMenu().setLayerType(layerType, null);
                if (getSecondaryMenu() != null) {
                    getSecondaryMenu().setLayerType(layerType, null);
                }
            }
        });
    }
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:20,代码来源:SlidingMenu.java

示例4: manageLayers

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void manageLayers(float percentOpen) {
	if (Build.VERSION.SDK_INT < 11) return;

	boolean layer = percentOpen > 0.0f && percentOpen < 1.0f;
	final int layerType = layer ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;

	if (layerType != getContent().getLayerType()) {
		getHandler().post(new Runnable() {
			public void run() {
				Log.v(TAG, "changing layerType. hardware? " + (layerType == View.LAYER_TYPE_HARDWARE));
				getContent().setLayerType(layerType, null);
				getMenu().setLayerType(layerType, null);
				if (getSecondaryMenu() != null) {
					getSecondaryMenu().setLayerType(layerType, null);
				}
			}
		});
	}
}
 
开发者ID:6ag,项目名称:LiuAGeAndroid,代码行数:20,代码来源:SlidingMenu.java

示例5: destroy

/********************************
 *  end hook Activity life cycle callback
 ********************************************************/


public void destroy() {
  if (WXEnvironment.isApkDebugable() && !WXUtils.isUiThread()) {
    throw new WXRuntimeException("[WXComponent] destroy can only be called in main thread");
  }
  if(mHost!= null && mHost.getLayerType()==View.LAYER_TYPE_HARDWARE) {
    mHost.setLayerType(View.LAYER_TYPE_NONE, null);
  }
  removeAllEvent();
  removeStickyStyle();
  if (mDomObj != null) {
    mDomObj = null;
  }
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:18,代码来源:WXComponent.java

示例6: enableHardwareLayer

private void enableHardwareLayer(final View v) {
    final int layerType = Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT ?
            View.LAYER_TYPE_NONE : View.LAYER_TYPE_HARDWARE;
    if (v.getLayerType() != layerType) v.setLayerType(layerType, null);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:InfiniteCycleManager.java

示例7: destroy

public void destroy() {
  if (WXEnvironment.isApkDebugable() && !WXUtils.isUiThread()) {
    throw new WXRuntimeException("[WXComponent] destroy can only be called in main thread");
  }
  if(mHost!= null && mHost.getLayerType()==View.LAYER_TYPE_HARDWARE) {
    mHost.setLayerType(View.LAYER_TYPE_NONE, null);
  }
  removeAllEvent();
  removeStickyStyle();
  if (mDomObj != null) {
    mDomObj.destroy();
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:13,代码来源:WXComponent.java

示例8: onDraw

@Override
protected void onDraw(Canvas canvas) {

	// Check if the bitmap was ever set
	if(mBitmap!=null && !mBitmap.isRecycled() ){

		// If the current version is above Gingerbread and the layer type is 
		// hardware accelerated, the paint is no longer needed
		if( Build.VERSION.SDK_INT >=  Build.VERSION_CODES.HONEYCOMB 
				&& getLayerType() == View.LAYER_TYPE_HARDWARE ){
			canvas.drawBitmap(mBitmap, mMatrix, null);
		}else{
			// Check if the time between draws has been met and draw the bitmap
			if( (System.currentTimeMillis()-mLastDraw) > sPaintDelay ){
				canvas.drawBitmap(mBitmap, mMatrix, mPaint);
				mLastDraw = System.currentTimeMillis();
			}

			// Otherwise draw the bitmap without the paint and resubmit a new request
			else{
				canvas.drawBitmap(mBitmap, mMatrix, null);
				removeCallbacks(mRefresh);
				postDelayed(mRefresh, sPaintDelay);
			}
		}
	}
}
 
开发者ID:lpy19930103,项目名称:MinimalismJotter,代码行数:27,代码来源:ZoomableImageView.java

示例9: manageLayers

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void manageLayers(float percentOpen)
{
    if (Build.VERSION.SDK_INT < 11)
    {
        return;
    }

    boolean layer = percentOpen > 0.0f && percentOpen < 1.0f;
    final int layerType = layer ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;

    if (layerType != getContent().getLayerType())
    {
        getHandler().post(new Runnable()
        {
            public void run()
            {
                Log.v(TAG, "changing layerType. hardware? " + (layerType == View.LAYER_TYPE_HARDWARE));
                getContent().setLayerType(layerType, null);
                getMenu().setLayerType(layerType, null);
                if (getSecondaryMenu() != null)
                {
                    getSecondaryMenu().setLayerType(layerType, null);
                }
            }
        });
    }
}
 
开发者ID:HueToYou,项目名称:ChatExchange-old,代码行数:28,代码来源:SlidingMenu.java

示例10: onDraw

@SuppressLint("NewApi")
@Override
protected void onDraw(Canvas canvas) {
	// Check if the bitmap was ever set
	if(mBitmap!=null && !mBitmap.isRecycled() ){

		// If the current version is above Gingerbread and the layer type is 
		// hardware accelerated, the paint is no longer needed
		if( Build.VERSION.SDK_INT >=  MIN_SDK_ENABLE_LAYER_TYPE_HARDWARE
				&& getLayerType() == View.LAYER_TYPE_HARDWARE ){
			canvas.drawBitmap(mBitmap, mMatrix, null);
		} 
		else 
		{
			// Check if the time between draws has been met and draw the bitmap
			if( (System.currentTimeMillis()-mLastDraw) > sPaintDelay ){
				canvas.drawBitmap(mBitmap, mMatrix, mPaint);
				mLastDraw = System.currentTimeMillis();
			}

			// Otherwise draw the bitmap without the paint and resubmit a new request
			else{
				canvas.drawBitmap(mBitmap, mMatrix, null);
				removeCallbacks(mRefresh);
				postDelayed(mRefresh, sPaintDelay);
			}
		}			
	}
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:29,代码来源:BaseZoomableImageView.java

示例11: onAnimationApplierStart

void onAnimationApplierStart(AdditiveAnimationAccumulator applier) {
    // only now are we expecting updates from this applier
    if(mUseHardwareLayer && mAnimationTargetView instanceof View) {
        if(((View)mAnimationTargetView).getLayerType() != View.LAYER_TYPE_HARDWARE) {
            ((View)mAnimationTargetView).setLayerType(View.LAYER_TYPE_HARDWARE, null);
        }
    }
}
 
开发者ID:wirecube,项目名称:android_additive_animations,代码行数:8,代码来源:AdditiveAnimationStateManager.java

示例12: RevealFinishedJellyBeanMr2

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
RevealFinishedJellyBeanMr2(RevealAnimator target) {
    super(target);

    mFeaturedLayerType = View.LAYER_TYPE_HARDWARE;
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:6,代码来源:RevealAnimator.java


注:本文中的android.view.View.LAYER_TYPE_HARDWARE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。