am f099eb0b: Merge "Using state to update voice button proxy visibility instead of view flags. (Bug 10915381)" into jb-ub-now-indigo-rose
* commit 'f099eb0bf4c0fdee5c4708d48ce0134fbf0d1249': Using state to update voice button proxy visibility instead of view flags. (Bug 10915381)
This commit is contained in:
@@ -900,6 +900,9 @@ public class Launcher extends Activity
|
|||||||
// Process any items that were added while Launcher was away.
|
// Process any items that were added while Launcher was away.
|
||||||
InstallShortcutReceiver.disableAndFlushInstallQueue(this);
|
InstallShortcutReceiver.disableAndFlushInstallQueue(this);
|
||||||
|
|
||||||
|
// Update the voice search button proxy
|
||||||
|
updateVoiceButtonProxyVisible(false);
|
||||||
|
|
||||||
// Again, as with the above scenario, it's possible that one or more of the global icons
|
// Again, as with the above scenario, it's possible that one or more of the global icons
|
||||||
// were updated in the wrong orientation.
|
// were updated in the wrong orientation.
|
||||||
updateGlobalIcons();
|
updateGlobalIcons();
|
||||||
@@ -3338,7 +3341,7 @@ public class Launcher extends Activity
|
|||||||
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE);
|
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE);
|
||||||
if (searchButton != null) searchButton.setVisibility(View.GONE);
|
if (searchButton != null) searchButton.setVisibility(View.GONE);
|
||||||
if (voiceButton != null) voiceButton.setVisibility(View.GONE);
|
if (voiceButton != null) voiceButton.setVisibility(View.GONE);
|
||||||
setVoiceButtonProxyVisible(false);
|
updateVoiceButtonProxyVisible(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3385,13 +3388,13 @@ public class Launcher extends Activity
|
|||||||
}
|
}
|
||||||
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.VISIBLE);
|
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.VISIBLE);
|
||||||
voiceButton.setVisibility(View.VISIBLE);
|
voiceButton.setVisibility(View.VISIBLE);
|
||||||
setVoiceButtonProxyVisible(true);
|
updateVoiceButtonProxyVisible(false);
|
||||||
invalidatePressedFocusedStates(voiceButtonContainer, voiceButton);
|
invalidatePressedFocusedStates(voiceButtonContainer, voiceButton);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE);
|
if (voiceButtonContainer != null) voiceButtonContainer.setVisibility(View.GONE);
|
||||||
if (voiceButton != null) voiceButton.setVisibility(View.GONE);
|
if (voiceButton != null) voiceButton.setVisibility(View.GONE);
|
||||||
setVoiceButtonProxyVisible(false);
|
updateVoiceButtonProxyVisible(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3403,12 +3406,23 @@ public class Launcher extends Activity
|
|||||||
invalidatePressedFocusedStates(voiceButtonContainer, voiceButton);
|
invalidatePressedFocusedStates(voiceButtonContainer, voiceButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVoiceButtonProxyVisible(boolean visible) {
|
public void updateVoiceButtonProxyVisible(boolean forceDisableVoiceButtonProxy) {
|
||||||
final View voiceButtonProxy = findViewById(R.id.voice_button_proxy);
|
final View voiceButtonProxy = findViewById(R.id.voice_button_proxy);
|
||||||
if (voiceButtonProxy != null) {
|
if (voiceButtonProxy != null) {
|
||||||
|
boolean visible = !forceDisableVoiceButtonProxy &&
|
||||||
|
mWorkspace.shouldVoiceButtonProxyBeVisible();
|
||||||
voiceButtonProxy.setVisibility(visible ? View.VISIBLE : View.GONE);
|
voiceButtonProxy.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||||
|
voiceButtonProxy.bringToFront();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is an overrid eot disable the voice button proxy. If disabled is true, then the voice button proxy
|
||||||
|
* will be hidden regardless of what shouldVoiceButtonProxyBeVisible() returns.
|
||||||
|
*/
|
||||||
|
public void disableVoiceButtonProxy(boolean disabled) {
|
||||||
|
updateVoiceButtonProxyVisible(disabled);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Sets the app market icon
|
* Sets the app market icon
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1036,14 +1036,14 @@ public class Workspace extends SmoothPagedView
|
|||||||
if (mCustomContentCallbacks != null) {
|
if (mCustomContentCallbacks != null) {
|
||||||
mCustomContentCallbacks.onShow();
|
mCustomContentCallbacks.onShow();
|
||||||
mCustomContentShowTime = System.currentTimeMillis();
|
mCustomContentShowTime = System.currentTimeMillis();
|
||||||
mLauncher.setVoiceButtonProxyVisible(false);
|
mLauncher.updateVoiceButtonProxyVisible(false);
|
||||||
}
|
}
|
||||||
} else if (hasCustomContent() && getNextPage() != 0 && mCustomContentShowing) {
|
} else if (hasCustomContent() && getNextPage() != 0 && mCustomContentShowing) {
|
||||||
mCustomContentShowing = false;
|
mCustomContentShowing = false;
|
||||||
if (mCustomContentCallbacks != null) {
|
if (mCustomContentCallbacks != null) {
|
||||||
mCustomContentCallbacks.onHide();
|
mCustomContentCallbacks.onHide();
|
||||||
mLauncher.resetQSBScroll();
|
mLauncher.resetQSBScroll();
|
||||||
mLauncher.setVoiceButtonProxyVisible(true);
|
mLauncher.updateVoiceButtonProxyVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1823,6 +1823,16 @@ public class Workspace extends SmoothPagedView
|
|||||||
return offsetDelta;
|
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) {
|
Animator getChangeStateAnimation(final State state, boolean animated, int delay, int snapPage) {
|
||||||
if (mState == state) {
|
if (mState == state) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1975,11 +1985,7 @@ public class Workspace extends SmoothPagedView
|
|||||||
setScaleY(mNewScale);
|
setScaleY(mNewScale);
|
||||||
setTranslationY(finalWorkspaceTranslationY);
|
setTranslationY(finalWorkspaceTranslationY);
|
||||||
}
|
}
|
||||||
if (finalSearchBarAlpha == 0) {
|
mLauncher.updateVoiceButtonProxyVisible(false);
|
||||||
mLauncher.setVoiceButtonProxyVisible(false);
|
|
||||||
} else {
|
|
||||||
mLauncher.setVoiceButtonProxyVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stateIsSpringLoaded) {
|
if (stateIsSpringLoaded) {
|
||||||
// Right now we're covered by Apps Customize
|
// Right now we're covered by Apps Customize
|
||||||
|
|||||||
Reference in New Issue
Block a user