mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
Add two extra empty pages on two panel launcher home
Add a new screen ID for the second extra empty page and add that new screen as well when the existing extra empty page is added so that users can put items on both sides of Workspace. Test: manual Bug: 196376162 Change-Id: I0b4f2e818407a10d8a7c032788a7bd7a61267779
This commit is contained in:
@@ -23,6 +23,7 @@ import com.android.launcher3.folder.Folder;
|
||||
import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.touch.ItemLongClickListener;
|
||||
import com.android.launcher3.util.IntSet;
|
||||
|
||||
public interface WorkspaceLayoutManager {
|
||||
|
||||
@@ -30,6 +31,12 @@ public interface WorkspaceLayoutManager {
|
||||
|
||||
// The screen id used for the empty screen always present at the end.
|
||||
int EXTRA_EMPTY_SCREEN_ID = -201;
|
||||
// The screen id used for the second empty screen always present at the end for two panel home.
|
||||
int EXTRA_EMPTY_SCREEN_SECOND_ID = -200;
|
||||
// The screen ids used for the empty screens at the end of the workspaces.
|
||||
IntSet EXTRA_EMPTY_SCREEN_IDS =
|
||||
IntSet.wrap(EXTRA_EMPTY_SCREEN_ID, EXTRA_EMPTY_SCREEN_SECOND_ID);
|
||||
|
||||
// The is the first screen. It is always present, even if its empty.
|
||||
int FIRST_SCREEN_ID = 0;
|
||||
// This is the second page. On two panel home it is always present, even if its empty.
|
||||
@@ -81,9 +88,9 @@ public interface WorkspaceLayoutManager {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (screenId == EXTRA_EMPTY_SCREEN_ID) {
|
||||
if (EXTRA_EMPTY_SCREEN_IDS.contains(screenId)) {
|
||||
// This should never happen
|
||||
throw new RuntimeException("Screen id should not be EXTRA_EMPTY_SCREEN_ID");
|
||||
throw new RuntimeException("Screen id should not be extra empty screen: " + screenId);
|
||||
}
|
||||
|
||||
final CellLayout layout;
|
||||
|
||||
Reference in New Issue
Block a user