當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。