Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
2014-12-16 14:05
656 查看
在4.4中当有来电或去电时,显示给用户的界面 如图1,在4.4之前称之为InCallScreen,但在4.4之后叫做InCallActivity。在4.4中我们调出的拨号盘界面,实际为DialtactsActivity并隶属于Dialer应用。4.4 中界面分为3块,CallCardFragment、CallButtonFragment、AnswerFragment,如下所示:
图 1 InCallActivity界面(左:接通 右:来电)
[html]
view plaincopy
<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<!-- 拨号盘 独立出来易于复用 -->
<fragment
android:name="com.android.incallui.DialpadFragment"
android:id="@+id/dialpadFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<!-- 控制按钮 也就是原来的InCallTouchUi -->
<fragment android:name="com.android.incallui.CallButtonFragment"
android:id="@+id/callButtonFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<!-- 来电接听/挂断控件 原始使用的系统的GlowpadView -->
<fragment android:name="com.android.incallui.AnswerFragment"
android:id="@+id/answerFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="top"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/glowpadview_margin_bottom"
android:visibility="gone" />
<!-- 会议电话管理界面 -->
<fragment android:name="com.android.incallui.ConferenceManagerFragment"
android:id="@+id/conferenceManagerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true" />
</FrameLayout>
图 1 InCallActivity界面(左:接通 右:来电)
InCallActivity布局分析
在InCallActivity.java中,实现了对界面的初始化,在4.4中界面的布局是通过fragment来完成的,即incall_screen.xml,代码如下:[html]
view plaincopy
<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<!-- 拨号盘 独立出来易于复用 -->
<fragment
android:name="com.android.incallui.DialpadFragment"
android:id="@+id/dialpadFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<!-- 控制按钮 也就是原来的InCallTouchUi -->
<fragment android:name="com.android.incallui.CallButtonFragment"
android:id="@+id/callButtonFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<!-- 来电接听/挂断控件 原始使用的系统的GlowpadView -->
<fragment android:name="com.android.incallui.AnswerFragment"
android:id="@+id/answerFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="top"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/glowpadview_margin_bottom"
android:visibility="gone" />
<!-- 会议电话管理界面 -->
<fragment android:name="com.android.incallui.ConferenceManagerFragment"
android:id="@+id/conferenceManagerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true" />
</FrameLayout>
相关文章推荐
- 转(Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析)
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(二)__UI结构分析
- Android 4.4 Kitkat Phone工作流程浅析(三)__MO(去电)流程分析
- Android 4.4 Kitkat Phone工作流程浅析(五)__MT(来电)流程分析
- Android 4.4 Kitkat Phone工作流程浅析(九)__状态通知流程分析
- Android 4.4 Kitkat Phone工作流程浅析(八)__Phone状态分析
- Android 4.4 Kitkat Phone工作流程浅析(五)__MT(来电)流程分析
- Android 4.4 Kitkat Phone工作流程浅析(三)__MO(去电)流程分析
- Android 4.4 Kitkat Phone工作流程浅析(八)__Phone状态分析
- 转(Android 4.4 Kitkat Phone工作流程浅析(五)__MT(来电)流程分析)
- Android 4.4 Kitkat Phone工作流程浅析(三)__MO(去电)流程分析
- Android 4.4 Kitkat Phone工作流程浅析(九)__状态通知流程分析
- Android 4.4 Kitkat Phone工作流程浅析(八)__Phone状态分析
- 转(Android 4.4 Kitkat Phone工作流程浅析(三)__MO(去电)流程分析)