mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Adds additional pages to Taskbar Edu.
Currently there are pages for the following: - Splitscreen - Customize (add apps/predicted apps) - Docking (long press to hide) At the moment they all use the same placeholder image from before. Button states: Page 1: Close and Next Page 2: Back and Next Page 3: Back and Done You can also swipe left and right between the pages. Demo: https://drive.google.com/file/d/1_D3i-jZxCRRVHV92p6hG5cm3VGcJ_bhK/view?usp=sharing&resourcekey=0-KHLHTTx67JlmVv-UZoAUAw Bug: 180605356 Test: Manual Change-Id: Ibbb81610a611f6ca412e53ed90dc1c67764f417e
This commit is contained in:
@@ -32,9 +32,8 @@ public class TaskbarEduController {
|
||||
mActivity.getDragLayer().post(() -> {
|
||||
mTaskbarEduView = (TaskbarEduView) mActivity.getLayoutInflater().inflate(
|
||||
R.layout.taskbar_edu, mActivity.getDragLayer(), false);
|
||||
mTaskbarEduView.addOnCloseListener(() -> {
|
||||
mTaskbarEduView = null;
|
||||
});
|
||||
mTaskbarEduView.init(new TaskbarEduCallbacks());
|
||||
mTaskbarEduView.addOnCloseListener(() -> mTaskbarEduView = null);
|
||||
mTaskbarEduView.show();
|
||||
});
|
||||
}
|
||||
@@ -44,4 +43,27 @@ public class TaskbarEduController {
|
||||
mTaskbarEduView.close(true /* animate */);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callbacks for {@link TaskbarEduView} to interact with its controller.
|
||||
*/
|
||||
class TaskbarEduCallbacks {
|
||||
void onPageChanged(int currentPage, int pageCount) {
|
||||
if (currentPage == 0) {
|
||||
mTaskbarEduView.updateStartButton(R.string.taskbar_edu_close,
|
||||
v -> mTaskbarEduView.close(true /* animate */));
|
||||
} else {
|
||||
mTaskbarEduView.updateStartButton(R.string.taskbar_edu_previous,
|
||||
v -> mTaskbarEduView.snapToPage(currentPage - 1));
|
||||
}
|
||||
if (currentPage == pageCount - 1) {
|
||||
mTaskbarEduView.updateEndButton(R.string.taskbar_edu_done,
|
||||
v -> mTaskbarEduView.close(true /* animate */));
|
||||
} else {
|
||||
mTaskbarEduView.updateEndButton(R.string.taskbar_edu_next,
|
||||
v -> mTaskbarEduView.snapToPage(currentPage + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user