Hi, this is a multi-window system developed based on Android 4.4. There are still many shortcomings. Please advise me more. The code is already open-source.
Video address
Source Code address
Done:
1. The APP is displayed in a window
In PhoneWindowManager: layoutWindowLw (), the packageName filter is used to display the specified APP in a non-full screen size. Because an APP usually displays multiple activities in the unit of one task, therefore, the packageName filtering method is used.
2. Multiple apps are in the onResume status at the same time.
Modify the onPause () Notification in AMS. If pkg is specified, pause is not notified. In the future, we need to optimize the activity lifecycle control in AMS.
3. Modify touch region of Window
Modify InputMonitor: addinput?whandlelw () so that the Window intercepts the region of touch event only within the range of this Window.
4. Move the window of Touch to the top layer of the screen
In AMS and WindowSession, an interface is added to intercept touch events in ViewRootImpl, notify WMS through windowSession, and AMS, and move windows and tasks to the top layer.
5. The RecentActivity is started into the APP stack.
The visibility switching during task Switching in the same stack is well controlled, but it is difficult to control cross-stack switching. Therefore, you can move the RecentActivity to the APP stack to start it. In this way, RecentActivity is called out, when switching an APP, no display bugs will appear.
6. Add titlebar to the Window
Add titlebar in PhoneWindow: generateLayout (), including close, minimum, maximum, drag area, and resize.
Minimum has not yet been implemented, because we need to work with AMS to control the activity lifecycle.
7. added the portal APP
You can select an APP to start in a window, and register a Custom service in ServiceManager. The service contains the pkgs to be displayed in a window, which is then called by the framework.
Next plan:
1. Fixed various bugs
There are so many bugs that you can't bear to look straight... The key is that the source code is not familiar enough in many places, so it is always a headache and a headache.
2. Familiar with AMS Control Process
A reasonable multi-window activity lifecycle is designed to complete minimum.