Merge "Introduce LauncherSearchCallback to handle search overlay status." into ub-launcher3-burnaby

This commit is contained in:
Jun Mukai
2015-05-27 00:41:28 +00:00
committed by Android (Google) Code Review
3 changed files with 53 additions and 0 deletions
+41
View File
@@ -558,6 +558,35 @@ public class Launcher extends Activity
}
}
});
mLauncherCallbacks.setLauncherSearchCallback(new Launcher.LauncherSearchCallbacks() {
private boolean mImportanceStored = false;
private int mWorkspaceImportanceForAccessibility =
View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
private int mHotseatImportanceForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
@Override
public void onSearchOverlayOpened() {
if (mImportanceStored) {
return;
}
// The underlying workspace and hotseat are temporarily suppressed by the search
// overlay. So they sholudn't be accessible.
mWorkspaceImportanceForAccessibility = mWorkspace.getImportantForAccessibility();
mHotseatImportanceForAccessibility = mHotseat.getImportantForAccessibility();
mWorkspace.setImportantForAccessibility(
View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
mHotseat.setImportantForAccessibility(
View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
mImportanceStored = true;
}
@Override
public void onSearchOverlayClosed() {
mWorkspace.setImportantForAccessibility(mWorkspaceImportanceForAccessibility);
mHotseat.setImportantForAccessibility(mHotseatImportanceForAccessibility);
mImportanceStored = false;
}
});
return true;
}
@@ -1207,6 +1236,18 @@ public class Launcher extends Activity
public void dismissAllApps();
}
public interface LauncherSearchCallbacks {
/**
* Called when the search overlay is shown.
*/
public void onSearchOverlayOpened();
/**
* Called when the search overlay is dismissed.
*/
public void onSearchOverlayClosed();
}
public interface LauncherOverlayCallbacks {
/**
* This method indicates whether a call to {@link #enterFullImmersion()} will succeed,