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:
Andy Wickham
2021-08-18 15:17:54 -10:00
parent a71426811e
commit a0cc0903e8
6 changed files with 260 additions and 31 deletions

View File

@@ -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));
}
}
}
}