Adds the ability for Launcher3 to respond to QSB alpha change requests.

Test: Tested locally
BUG:124063782
Change-Id: I8c4bfaa62d9608fcfffff5e30b2913f3a6fb2f75
(cherry picked from commit 827f0807d3)
This commit is contained in:
Govinda Wasserman 2019-03-28 12:23:28 -04:00 committed by Sunny Goyal
parent 0ca0188374
commit 24e489e5a3
7 changed files with 41 additions and 0 deletions

View File

@ -33,6 +33,11 @@ public abstract class GoActivityControlHelper<T extends BaseDraggingActivity> im
// Go does not support swipe up gesture.
}
@Override
public void onAssistantVisibilityChanged(float visibility) {
// Go does not support assistant visibility transitions.
}
@Override
public HomeAnimationFactory prepareHomeUI(T activity) {
// Go does not support gestures from app to home.

View File

@ -83,6 +83,11 @@ public class TouchInteractionService extends Service {
// TODO handle assistant
}
@Override
public void onAssistantVisibilityChanged(float visibility) {
// TODO handle assistant
}
/** Deprecated methods **/
public void onQuickStep(MotionEvent motionEvent) { }

View File

@ -75,6 +75,11 @@ public final class FallbackActivityControllerHelper implements
// TODO:
}
@Override
public void onAssistantVisibilityChanged(float visibility) {
// TODO:
}
@NonNull
@Override
public HomeAnimationFactory prepareHomeUI(RecentsActivity activity) {

View File

@ -45,6 +45,7 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherInitListener;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager;
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.AllAppsTransitionController;
import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.anim.AnimatorPlaybackController;
@ -98,6 +99,14 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
DiscoveryBounce.showForOverviewIfNeeded(activity);
}
@Override
public void onAssistantVisibilityChanged(float visibility) {
Launcher launcher = getCreatedActivity();
if (launcher != null) {
launcher.setQuickSearchBarAlpha(1f - visibility);
}
}
@NonNull
@Override
public HomeAnimationFactory prepareHomeUI(Launcher activity) {

View File

@ -125,6 +125,14 @@ public class TouchInteractionService extends Service {
mAssistantAvailable = available;
}
@Override
public void onAssistantVisibilityChanged(float visibility) {
MAIN_THREAD_EXECUTOR.execute(() -> {
mOverviewComponentObserver.getActivityControlHelper()
.onAssistantVisibilityChanged(visibility);
});
}
/** Deprecated methods **/
public void onQuickStep(MotionEvent motionEvent) { }

View File

@ -53,6 +53,8 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
void onSwipeUpComplete(T activity);
void onAssistantVisibilityChanged(float visibility);
@NonNull HomeAnimationFactory prepareHomeUI(T activity);
AnimationFactory prepareRecentsUI(T activity, boolean activityVisible,

View File

@ -408,6 +408,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
onIdpChanged(idp);
}
public void setQuickSearchBarAlpha(float alpha) {
View qsbAllApps = findViewById(R.id.search_container_all_apps);
if (qsbAllApps != null) {
qsbAllApps.setAlpha(alpha);
}
}
private void onIdpChanged(InvariantDeviceProfile idp) {
mUserEventDispatcher = null;