Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析

本文深入分析了Android 4.4 KitKat中InCallActivity的UI结构,包括InCallActivity布局、CallCardFragment、CallButtonFragment、answerFragment的详细功能和控制流程。InCallActivity作为状态机,使用fragment展示不同界面,如通话信息、控制按钮和来电控制。同时,文中探讨了初始化流程和各组件交互,提供了相关时序图以辅助理解。
摘要由CSDN通过智能技术生成

本文来自http://blog.csdn.net/yihongyuelan 转载请务必注明出处

本文代码以MTK平台Android 4.4为分析对象,与Google原生AOSP有些许差异,请读者知悉。

概述

       之前有分析过Android 4.2的InCallScreen结构(传送门),但后面Google发布了Android 4.4即Kitkat,遂决定以之前的文章为模板,重新整理并记录。在4.4中当有来电或去电时,显示给用户的界面如图1,在4.4之前称之为InCallScreen,但在4.4之后叫做InCallActivity。在4.4中我们调出的拨号盘界面,实际为DialtactsActivity并隶属于Dialer应用。4.4 中界面分为3块,CallCardFragment、CallButtonFragment、AnswerFragment,如下所示:
 
图 1 InCallActivity界面(左:接通 右:来电)

InCallActivity布局分析

       在InCallActivity.java中,实现了对界面的初始化,在4.4中界面的布局是通过fragment来完成的,即incall_screen.xml,代码如下:

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/main">
    <!-- MTK VideoCall fragment -->
    <FrameLayout
        android:id="@+id/vtCallFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <LinearLayout
        android:id="@+id/in_call_and_button_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <RelativeLayout
             android:id="@+id/in_call_card_container"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1">
           <!-- CallCard fragment 用于显示联系人信息 -->
           <fragment
                android:name="com.android.incallui.CallCardFragment"
                android:id="@+id/callCardFragment"
                
  • 20
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值