當前位置: 首頁>>代碼示例>>Java>>正文


Java View.LAYER_TYPE_NONE屬性代碼示例

本文整理匯總了Java中android.view.View.LAYER_TYPE_NONE屬性的典型用法代碼示例。如果您正苦於以下問題:Java View.LAYER_TYPE_NONE屬性的具體用法?Java View.LAYER_TYPE_NONE怎麽用?Java View.LAYER_TYPE_NONE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.View的用法示例。


在下文中一共展示了View.LAYER_TYPE_NONE屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: disableHardwareLayers

private void disableHardwareLayers() {
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) return;
    for (int i = 0; i < mViewPageable.getChildCount(); i++) {
        final View child = mViewPageable.getChildAt(i);
        if (child.getLayerType() != View.LAYER_TYPE_NONE)
            child.setLayerType(View.LAYER_TYPE_NONE, null);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:InfiniteCycleManager.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: disableHardwareLayer

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void disableHardwareLayer() {
	if (!API_11) return;
	View v;
	for (int i = 0; i < getChildCount(); i++) {
		v = getChildAt(i);
		if (v.getLayerType() != View.LAYER_TYPE_NONE)
			v.setLayerType(View.LAYER_TYPE_NONE, null);
	}
}
 
開發者ID:SimonCherryGZ,項目名稱:JewelryUI,代碼行數:10,代碼來源:JazzyViewPager.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()) {
        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

示例5: updateFromViewRotation

private void updateFromViewRotation() {
    if (Build.VERSION.SDK_INT == 19) {
        // KitKat seems to have an issue with views which are rotated with angles which are
        // not divisible by 90. Worked around by moving to software rendering in these cases.
        if ((mRotation % 90) != 0) {
            if (mView.getLayerType() != View.LAYER_TYPE_SOFTWARE) {
                mView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
            }
        } else {
            if (mView.getLayerType() != View.LAYER_TYPE_NONE) {
                mView.setLayerType(View.LAYER_TYPE_NONE, null);
            }
        }
    }

    // Offset any View rotation
    if (mShadowDrawable != null) {
        mShadowDrawable.setRotation(-mRotation);
    }
    if (mBorderDrawable != null) {
        mBorderDrawable.setRotation(-mRotation);
    }
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:23,代碼來源:FloatingActionButtonImpl.java

示例6: 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

示例7: 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

示例8: 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

示例9: onAnimationStart

@Override
public void onAnimationStart(Animation animation) {
  if (mView.hasOverlappingRendering() &&
      mView.getLayerType() == View.LAYER_TYPE_NONE) {
    mLayerTypeChanged = true;
    mView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:8,代碼來源:OpacityAnimation.java


注:本文中的android.view.View.LAYER_TYPE_NONE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。