Java Code Examples for android.view.View#LAYER_TYPE_NONE
The following examples show how to use
android.view.View#LAYER_TYPE_NONE .
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 File: SlidingMenu.java From LiuAGeAndroid with MIT License | 6 votes |
@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); } } }); } }
Example 2
Source File: SlidingMenu.java From BigApp_Discuz_Android with Apache License 2.0 | 6 votes |
@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); } } }); } }
Example 3
Source File: SlidingMenu.java From WeatherStream with Apache License 2.0 | 6 votes |
@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); } } }); } }
Example 4
Source File: FragmentManager.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
static boolean shouldRunOnHWLayer(View v, Animator anim) { if (v == null || anim == null) { return false; } return v.getLayerType() == View.LAYER_TYPE_NONE && v.hasOverlappingRendering() && modifiesAlpha(anim); }
Example 5
Source File: JazzyViewPager.java From JazzyViewPager with Apache License 2.0 | 5 votes |
@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); }
Example 6
Source File: JazzyViewPager.java From UltimateAndroid with Apache License 2.0 | 5 votes |
@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); }
Example 7
Source File: InfiniteCycleManager.java From InfiniteCycleViewPager with Apache License 2.0 | 5 votes |
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); } }
Example 8
Source File: MovieRowView.java From android-movies-demo with MIT License | 5 votes |
@Override public void setUseHardwareLayers(boolean useHardwareLayers) { // TODO: While this helps performance, it does result in a spike when you first start sliding // Maybe there's some solution where some of the Views remain in a HW layer throughout? int toLayerType = useHardwareLayers ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE; if (mPosterView.getLayerType() != toLayerType) { mPosterView.setLayerType(toLayerType, null); mTitleView.setLayerType(toLayerType, null); mSubtitleView.setLayerType(toLayerType, null); mContentContainer.setLayerType(toLayerType, null); } }
Example 9
Source File: SdkCenteredViewPager.java From Android-SDK-Demo with MIT License | 5 votes |
private void enableLayers(boolean enable) { final int childCount = getChildCount(); for ( int i = 0; i < childCount; i++ ) { final int layerType = enable ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE; getChildAt( i ).setLayerType( layerType, null ); } }
Example 10
Source File: JazzyViewPager.java From zhangshangwuda with Apache License 2.0 | 5 votes |
@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); } }
Example 11
Source File: JazzyViewPager.java From Contacts with MIT License | 5 votes |
@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); }
Example 12
Source File: JazzyViewPager.java From school_shop with MIT License | 5 votes |
@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); } }
Example 13
Source File: JazzyViewPager.java From Gazetti_Newspaper_Reader with MIT License | 5 votes |
@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); }
Example 14
Source File: Screen.java From react-native-screens with MIT License | 5 votes |
/** * While transitioning this property allows to optimize rendering behavior on Android and provide * a correct blending options for the animated screen. It is turned on automatically by the container * when transitioning is detected and turned off immediately after */ public void setTransitioning(boolean transitioning) { if (mTransitioning == transitioning) { return; } mTransitioning = transitioning; super.setLayerType(transitioning ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE, null); }
Example 15
Source File: OpacityAnimation.java From react-native-GPay with MIT License | 5 votes |
@Override public void onAnimationStart(Animation animation) { if (mView.hasOverlappingRendering() && mView.getLayerType() == View.LAYER_TYPE_NONE) { mLayerTypeChanged = true; mView.setLayerType(View.LAYER_TYPE_HARDWARE, null); } }
Example 16
Source File: JazzyViewPager.java From UltimateAndroid with Apache License 2.0 | 5 votes |
@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); } }
Example 17
Source File: CoolViewPager.java From CoolViewPager with Apache License 2.0 | 5 votes |
private void enableLayers(boolean enable) { final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { final int layerType = enable ? mPageTransformerLayerType : View.LAYER_TYPE_NONE; getChildAt(i).setLayerType(layerType, null); } }
Example 18
Source File: JazzyViewPager.java From android-kernel-tweaker with GNU General Public License v3.0 | 5 votes |
@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); }
Example 19
Source File: Fade.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void onAnimationStart(Animator animator) { if (mView.hasOverlappingRendering() && mView.getLayerType() == View.LAYER_TYPE_NONE) { mLayerTypeChanged = true; mView.setLayerType(View.LAYER_TYPE_HARDWARE, null); } }
Example 20
Source File: JellyViewPager.java From Conquer with Apache License 2.0 | 4 votes |
@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); }