Hi, this is my Android 4.4 based on the development of the multi-form system, there are a lot of shortcomings, but also more generous to enlighten ah, the code has all open source.
Video Address
Source code Address
Done:
1. The app is displayed as a form
The PackageName filter in PHONEWINDOWMANAGER::LAYOUTWINDOWLW () enables the specified app to be displayed in a non-full-screen size, since an app typically displays multiple activity in a single task, Therefore, we adopt the method of PackageName filtration.
2. Multiple apps are in Onresume state at the same time
Change the place in AMs to notify OnPause (), specify that Pkg does not notify pause. The area of activity life cycle control in AMS is a need to be optimized later.
3. Change window's Touch region
Change Inputmonitor::addinputwindowhandlelw () so that the region of the window intercept touch event is only within the scope of this form.
4. Touch window moves up to the top level of the screen
Add interface to ams,windowsession, intercept touch event in Viewrootimpl, notify WMS, and AMS via windowsession, Move window and task to the top level.
5. Recentactivity boot into the APP stack
Because the visibility switch in the same stack is also better controlled, assuming that the control is more difficult to switch across the stack, the recentactivity is moved to the app stack to start, so that the outgoing recentactivity When you switch apps, there are no bugs appearing on the display.
6. Add TitleBar to Window
Add TitleBar in Phonewindow::generatelayout (), including close, minimum, maximum, drag area, resize.
Minimum has not yet been implemented, as it is also a combination of AMS to do some control activity life cycle work.
7. Add a mouth app
Provide the user with the option to let the app start in a form, and register a service defined in ServiceManager that contains the pkgs to form the display, which is then called by the framework.
Next Plan:
1. Fix various bugs
The number of bugs just can't bear to look straight ... The key or the source code very many places are not familiar, so always piecemeal, foot pain medical teaching.
2. Familiar with AMS control process
Design a reasonable multi-form activity life cycle, complete minimum.
Updated on 20140730-------------------------------------------------------------------------------------------
A brief introduction to the PPT of the Multi window development process:
Open source for multi-form systems developed based on Android 4.4