mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Changing the overviewState to show appsearch and floating header
Change-Id: I2cfd61cfc9978e4c8e4520f0f7217e49e7344c79
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user