List of usage examples for android.os PowerManager isPowerSaveMode
public boolean isPowerSaveMode()
From source file:com.fairphone.fplauncher3.Workspace.java
private void enableOverviewMode(boolean enable, int snapPage, boolean animated) { State finalState = Workspace.State.OVERVIEW; if (!enable) { finalState = Workspace.State.NORMAL; }// w w w . ja v a2 s .c o m PowerManager powerManager = (PowerManager) mLauncher.getSystemService(Context.POWER_SERVICE); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && powerManager.isPowerSaveMode()) { animated = false; } Animator workspaceAnim = getChangeStateAnimation(finalState, animated, 0, snapPage); if (workspaceAnim != null && !mIsSwitchingState) { onTransitionPrepare(); workspaceAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator arg0) { onTransitionEnd(); } }); workspaceAnim.start(); } }