zoukankan      html  css  js  c++  java
  • Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析


    在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,代码如下:

    1. <FrameLayout  
    2.     xmlns:android="http://schemas.android.com/apk/res/android"  
    3.     android:layout_width="match_parent"  
    4.     android:layout_height="match_parent"  
    5.     android:id="@+id/main">  
    6.     <!-- MTK VideoCall fragment -->  
    7.     <FrameLayout  
    8.         android:id="@+id/vtCallFragment"  
    9.         android:layout_width="match_parent"  
    10.         android:layout_height="match_parent" />  
    11.   
    12.     <LinearLayout  
    13.         android:id="@+id/in_call_and_button_container"  
    14.         android:layout_width="match_parent"  
    15.         android:layout_height="match_parent"  
    16.         android:orientation="vertical">  
    17.         <RelativeLayout  
    18.              android:id="@+id/in_call_card_container"  
    19.              android:layout_width="match_parent"  
    20.              android:layout_height="match_parent"  
    21.              android:layout_weight="1">  
    22.            <!-- CallCard fragment 用于显示联系人信息 -->  
    23.            <fragment  
    24.                 android:name="com.android.incallui.CallCardFragment"  
    25.                 android:id="@+id/callCardFragment"  
    26.                 android:layout_width="match_parent"  
    27.                 android:layout_height="match_parent"  
    28.                 android:layout_alignParentTop="true"  
    29.                 android:layout_alignParentStart="true" />  
    30.             <!-- 拨号盘 独立出来易于复用 -->  
    31.             <fragment  
    32.                 android:name="com.android.incallui.DialpadFragment"  
    33.                 android:id="@+id/dialpadFragment"  
    34.                 android:layout_width="match_parent"  
    35.                 android:layout_height="match_parent"  
    36.                 android:layout_alignParentTop="true"  
    37.                 android:layout_alignParentStart="true" />  
    38.         </RelativeLayout>  
    39.         <!-- 控制按钮 也就是原来的InCallTouchUi -->  
    40.         <fragment android:name="com.android.incallui.CallButtonFragment"  
    41.                   android:id="@+id/callButtonFragment"  
    42.                   android:layout_width="match_parent"  
    43.                   android:layout_height="wrap_content"/>  
    44.   
    45.     </LinearLayout>  
    46.     <!-- 来电接听/挂断控件 原始使用的系统的GlowpadView -->  
    47.     <fragment android:name="com.android.incallui.AnswerFragment"  
    48.               android:id="@+id/answerFragment"  
    49.               android:layout_width="match_parent"  
    50.               android:layout_height="wrap_content"  
    51.               android:layout_alignParentBottom="true"  
    52.               android:layout_centerHorizontal="true"  
    53.               android:gravity="top"  
    54.               android:layout_gravity="bottom|center_horizontal"  
    55.               android:layout_marginBottom="@dimen/glowpadview_margin_bottom"  
    56.               android:visibility="gone" />  
    57.     <!-- 会议电话管理界面 -->  
    58.     <fragment android:name="com.android.incallui.ConferenceManagerFragment"  
    59.               android:id="@+id/conferenceManagerFragment"  
    60.               android:layout_width="match_parent"  
    61.               android:layout_height="match_parent"  
    62.               android:layout_alignParentTop="true"  
    63.               android:layout_alignParentStart="true"  
    64.               android:layout_alignParentBottom="true"  
    65.               android:layout_alignParentEnd="true" />  
    66.   
    67. </FrameLayout> 




























  • 相关阅读:
    自己觉得好的文章(2)
    为什么要用C运行时库的_beginthreadex代替操作系统的CreateThread来创建线程?
    GraphEdit
    吴裕雄天生自然Spring BootSpring Boot与Thymeleaf实现页面信息国际化
    吴裕雄天生自然Spring BootThymeleaf基础语法
    吴裕雄天生自然Spring BootSpring Boot处理JSON数据
    吴裕雄天生自然Spring Boot基于Thymeleaf与BootStrap的Web开发实例
    吴裕雄天生自然Spring Boot基本配置和注解
    吴裕雄天生自然Spring Boot自定义Starters
    吴裕雄天生自然Spring Boot的基本配置
  • 原文地址:https://www.cnblogs.com/liulaolaiu/p/11744519.html
Copyright © 2011-2022 走看看