Using state to update voice button proxy visibility instead of view flags. (Bug 10915381)
Change-Id: I72feb506cbc1b03e2b99d36bc4a9d7bda27101be
This commit is contained in:
1 parent
eb0cc542fa
commit
5841efa612
2 files changed
+31
-11
No files matched your search
@@ -1036,14 +1036,14 @@ public class Workspace extends SmoothPagedView
|
||||
if (mCustomContentCallbacks != null) {
|
||||
mCustomContentCallbacks.onShow();
|
||||
mCustomContentShowTime = System.currentTimeMillis();
|
||||
mLauncher.setVoiceButtonProxyVisible(false);
|
||||
mLauncher.updateVoiceButtonProxyVisible(false);
|
||||
}
|
||||
} else if (hasCustomContent() && getNextPage() != 0 && mCustomContentShowing) {
|
||||
mCustomContentShowing = false;
|
||||
if (mCustomContentCallbacks != null) {
|
||||
mCustomContentCallbacks.onHide();
|
||||
mLauncher.resetQSBScroll();
|
||||
mLauncher.setVoiceButtonProxyVisible(true);
|
||||
mLauncher.updateVoiceButtonProxyVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1823,6 +1823,16 @@ public class Workspace extends SmoothPagedView
|
||||
return offsetDelta;
|
||||
}
|
||||
|
||||
boolean shouldVoiceButtonProxyBeVisible() {
|
||||
if (isOnOrMovingToCustomContent()) {
|
||||
return false;
|
||||
}
|
||||
if (mState != State.NORMAL) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Animator getChangeStateAnimation(final State state, boolean animated, int delay, int snapPage) {
|
||||
if (mState == state) {
|
||||
return null;
|
||||
@@ -1975,11 +1985,7 @@ public class Workspace extends SmoothPagedView
|
||||
setScaleY(mNewScale);
|
||||
setTranslationY(finalWorkspaceTranslationY);
|
||||
}
|
||||
if (finalSearchBarAlpha == 0) {
|
||||
mLauncher.setVoiceButtonProxyVisible(false);
|
||||
} else {
|
||||
mLauncher.setVoiceButtonProxyVisible(true);
|
||||
}
|
||||
mLauncher.updateVoiceButtonProxyVisible(false);
|
||||
|
||||
if (stateIsSpringLoaded) {
|
||||
// Right now we're covered by Apps Customize
|
||||
|
||||
Reference in new issue
Block a user