Changing the overviewState to show appsearch and floating header

Change-Id: I2cfd61cfc9978e4c8e4520f0f7217e49e7344c79
This commit is contained in:
Sunny Goyal
2018-03-14 17:51:49 -07:00
parent 9d69c8da9a
commit 7185dd63eb
35 changed files with 860 additions and 1292 deletions

View File

@@ -22,6 +22,7 @@ import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;
import android.graphics.Rect;
import android.view.View;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Workspace;
@@ -105,4 +106,29 @@ public class OverviewState extends LauncherState {
return new float[] {scale, 0, translationY};
}
@Override
public int getVisibleElements(Launcher launcher) {
if (launcher.getDeviceProfile().isVerticalBarLayout()) {
// TODO: Remove hotseat from overview
return HOTSEAT;
} else {
return launcher.getAppsView().getFloatingHeaderView().hasVisibleContent()
? ALL_APPS_HEADER : HOTSEAT;
}
}
@Override
public float getVerticalProgress(Launcher launcher) {
if (getVisibleElements(launcher) == HOTSEAT) {
return super.getVerticalProgress(launcher);
}
return 1 - (getDefaultSwipeHeight(launcher)
/ launcher.getAllAppsController().getShiftRange());
}
public static float getDefaultSwipeHeight(Launcher launcher) {
DeviceProfile dp = launcher.getDeviceProfile();
return dp.allAppsCellHeightPx - dp.allAppsIconTextSizePx;
}
}