对于android6.0实现-- > 窗口呈现的逻辑分析

对于android6.0实现– > 窗口呈现的逻辑分析

经过两周的学习虽然仍是没有把详细逻辑顺清楚,但是就需求而言可以实现,暂且做个记录

public final class ActivityStackSupervisor implements DisplayListener {
    /* ASS computeStackFocus中: AMS 的resizeStack(id , Rect); 
     *                          |
     *     resizeStack(int stackId, Rect bounds) {
     *        mStackSupervisor.resizeStackLocked(stackId, bounds); 
     *     } 
     *                          |
     * ASS resizeStackLocked(id, bounds){}方法;
     *                          |
     *     resizeStackLocked(int stackId, Rect bounds) {
     *       Configuration overrideConfig = mWindowManager.resizeStack(stackId, bounds); 
     *     }
     *                          |  
     * WMS -- > resizeStack(id, Rect);
     *                          |
     *     resizeStack() {
     *       if (stack.setBounds(bounds)) {
     *         stack.resizeWindows();
     *       } 
     *     }
     *                          |
     * TaskStack: -->  void setBounds() {}
     *                 void getBounds(Rect out) {}//getBounds对外提供调用。
     *                          |
     * WindowState --> void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf, Rect dcf, Rect sf, Rect osf) {}
     *                          |
     *     computeFrameLw (...) {
     *       stack.getBounds(mContainingFrame);//mContainingFrame 是Rect
     *     }
     * Session extends IWindowSession.Stub --> relayout()
     *                          |
     *     relayout(...) {
     *          int res = mService.relayoutWindow(this, window, seq, attrs,
     *                           requestedWidth, requestedHeight, viewFlags, flags,
     *                           outFrame, outOverscanInsets, outContentInsets, outVisibleInsets,
     *                           outStableInsets, outsets, outConfig, outSurface);
     *     }
     *
     * ViewRootImpl -- >  relayoutWindow(...)
     *                          |
     *     relayoutTinyWindow (...) {
     *       int relayoutResult = mWindowSession.relayout(  //mWindowSession 属于IWindowSession
     *                        mWindow, mSeq, params,
     *                        (int) (mView.getMeasuredWidth() * appScale + 0.5f),
     *                        (int) (mView.getMeasuredHeight() * appScale + 0.5f),
     *                        viewVisibility, insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0,
     *                        mWinFrame, mPendingOverscanInsets, mPendingContentInsets, mPendingVisibleInsets,
     *                        mPendingStableInsets, mPendingOutsets, mPendingConfiguration, mSurface);
     *     }
     *     //IWindowSession是AIDL ,Session 和 ViewRootImpl 通过AIDL通信。
     *
     *     ------ >WMS 中的 relayoutWindow(...)
     *     relayoutWindow(Session session, IWindow client, int seq,                                                                                           
     *                   WindowManager.LayoutParams attrs, int requestedWidth,
     *                   int requestedHeight, int viewVisibility, int flags,
     *                   Rect outFrame, Rect outOverscanInsets, Rect outContentInsets,
     *                   Rect outVisibleInsets, Rect outStableInsets, Rect outOutsets, Configuration outConfig,
     *                   Surface outSurface) {
     *                   //--> successfully
     *                   }
     *                             
     */



}

对于窗口的位置大小改变现在自然就可以写啦

mService.resizeStack(stackId, new Rect(, , , ));//在ASS computeStackFocus中。
//这样就可以调动位置和大小啦!。。。

对于,WindowState 和 Session之间的交互,还有参数传递具体到ViewRootImpl, 仍需要继续调研
不管怎么样,这个可以实现android6.0窗口的变化

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值