大部分还看不懂,只记录接触到的一些
Android N 通话界面_InCallActivity_Yigit_dev的博客-CSDN博客
android N 拨打电话流程(MO)_Yigit_dev的博客-CSDN博客
-------------------------------------
平板上去掉了一些ui的功能------------
打电话的ui对应的activity是com.android.incallui.InCallActivity里面是fragment组成的界面,看call_card_fragment.xml里面的一些按钮,看callButtonFragment.java-----------
去掉了一些按钮,直接把按钮数量设为了0代码里面检测按钮数量,然后显示预设个数,多余的折叠起来,有一个回调函数updateButtonStates (我说怎么在xml里面设置visibility没有用!!)改没改几行代码,看看试试了大半天其他的不写了,代码很多没看过
diff --git a/packages/apps/Dialer/InCallUI/res/layout-w500dp-land/call_card_fragment.xml b/packages/apps/Dialer/InCallUI/res/layout-w500dp-land/call_card_fragment.xml
index 4d59cb7..60b4732 100644
--- a/packages/apps/Dialer/InCallUI/res/layout-w500dp-land/call_card_fragment.xml
+++ b/packages/apps/Dialer/InCallUI/res/layout-w500dp-land/call_card_fragment.xml
@@ -98,7 +98,7 @@<!-- Call recorder infor --><RelativeLayout
- android:layout_width="wrap_content"
+ android:layout_width="200dp"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:layout_alignParentLeft="true">
@@ -159,7 +159,7 @@<LinearLayoutandroid:id="@+id/primary_call_info_container"android:layout_alignParentStart="true"
- android:layout_width="wrap_content"
+ android:layout_width="1024dp"android:layout_height="match_parent"android:layout_above="@id/secondary_call_info"android:orientation="vertical"
@@ -199,16 +199,16 @@<!-- Margin left and centerHorizontal don't work well together, so use a Space instead. --><Spaceandroid:id="@+id/floating_end_call_action_button_margin_left"
- android:layout_width="@dimen/end_call_button_margin_left"
+ android:layout_width="@dimen/end_call_button_margin_left"android:layout_height="wrap_content"
- android:layout_centerHorizontal="true" />
+ android:layout_marginStart="480dp" /><FrameLayoutandroid:id="@+id/floating_end_call_action_button_container"android:layout_width="@dimen/end_call_floating_action_button_diameter"android:layout_height="@dimen/end_call_floating_action_button_diameter"android:background="@drawable/fab_red"
- android:layout_toRightOf="@id/floating_end_call_action_button_margin_left"
+ android:layout_toRightOf="@id/floating_end_call_action_button_margin_left"android:layout_alignParentBottom="true"android:layout_marginBottom="@dimen/end_call_button_margin_bottom"><ImageButton android:id="@+id/floating_end_call_action_button"
diff --git a/packages/apps/Dialer/InCallUI/res/layout/call_button_fragment.xml b/packages/apps/Dialer/InCallUI/res/layout/call_button_fragment.xml
index 3bc306e..d96bb1e 100644
--- a/packages/apps/Dialer/InCallUI/res/layout/call_button_fragment.xml
+++ b/packages/apps/Dialer/InCallUI/res/layout/call_button_fragment.xml
@@ -83,6 +83,7 @@<ToggleButton android:id="@+id/dialpadButton"style="@style/InCallCompoundButton"android:background="@drawable/btn_compound_dialpad"
+ android:visibility="invisible"android:contentDescription="@string/onscreenShowDialpadText_unselected" /><!-- MIDDLE RIGHT SLOT ================================================================= -->
diff --git a/packages/apps/Dialer/InCallUI/res/layout/call_card_fragment.xml b/packages/apps/Dialer/InCallUI/res/layout/call_card_fragment.xml
index 3a1c61d..c877985 100644
--- a/packages/apps/Dialer/InCallUI/res/layout/call_card_fragment.xml
+++ b/packages/apps/Dialer/InCallUI/res/layout/call_card_fragment.xml
@@ -49,9 +49,9 @@<!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. --><FrameLayoutandroid:id="@+id/answer_and_dialpad_container"
- android:layout_width="match_parent"
+ android:layout_width="300dp"android:elevation="@dimen/dialpad_elevation"
- android:layout_height="match_parent" />
+ android:layout_height="300dp" /><!-- Secondary "Call info" block, for the background ("on hold") call. --><include layout="@layout/secondary_call_info"
diff --git a/packages/apps/Dialer/InCallUI/res/values-sw410dp/config.xml b/packages/apps/Dialer/InCallUI/res/values-sw410dp/config.xml
index a57f867..7db0dc4 100644
--- a/packages/apps/Dialer/InCallUI/res/values-sw410dp/config.xml
+++ b/packages/apps/Dialer/InCallUI/res/values-sw410dp/config.xml
@@ -17,5 +17,5 @@<resources><!-- Determines the maximum number of buttons visible on the call card. Any buttons over thiscount are put into the overflow menu. -->
- <integer name="call_card_max_buttons">6</integer>
-</resources>
\ No newline at end of file
+ <integer name="call_card_max_buttons">0</integer>
+</resources>
diff --git a/packages/apps/Dialer/InCallUI/res/values-w500dp-land/dimens.xml b/packages/apps/Dialer/InCallUI/res/values-w500dp-land/dimens.xml
index 42b0886..26ffd51 100644
--- a/packages/apps/Dialer/InCallUI/res/values-w500dp-land/dimens.xml
+++ b/packages/apps/Dialer/InCallUI/res/values-w500dp-land/dimens.xml
@@ -33,5 +33,5 @@<dimen name="video_preview_margin">20dp</dimen>- <dimen name="end_call_button_margin_left">50dp</dimen>
+ <dimen name="end_call_button_margin_left">0dp</dimen></resources>
diff --git a/packages/apps/Dialer/InCallUI/res/values/dimens.xml b/packages/apps/Dialer/InCallUI/res/values/dimens.xml
index 357c582..f7160f9 100644
--- a/packages/apps/Dialer/InCallUI/res/values/dimens.xml
+++ b/packages/apps/Dialer/InCallUI/res/values/dimens.xml
@@ -113,7 +113,7 @@<!-- Height of translucent shadow effect --><dimen name="translucent_shadow_height">2dp</dimen>- <dimen name="end_call_button_margin_bottom">2dp</dimen>
+ <dimen name="end_call_button_margin_bottom">155dp</dimen><dimen name="call_card_anim_translate_y_offset">50dp</dimen>diff --git a/packages/apps/Dialer/InCallUI/src/com/android/incallui/CallButtonFragment.java b/packages/apps/Dialer/InCallUI/src/com/android/incallui/CallButtonFragment.java
index 068b9b0..8a7d69b 100755
--- a/packages/apps/Dialer/InCallUI/src/com/android/incallui/CallButtonFragment.java
+++ b/packages/apps/Dialer/InCallUI/src/com/android/incallui/CallButtonFragment.java
@@ -185,6 +185,7 @@ public class CallButtonFragmentmMuteButton.setOnClickListener(this);mShowDialpadButton = (CompoundButton) parent.findViewById(R.id.dialpadButton);mShowDialpadButton.setOnClickListener(this);
+ mShowDialpadButton.setVisibility(View.INVISIBLE);mHoldButton = (CompoundButton) parent.findViewById(R.id.holdButton);mHoldButton.setOnClickListener(this);mSwapButton = (ImageButton) parent.findViewById(R.id.swapButton);
@@ -264,6 +265,7 @@ public class CallButtonFragment} else if (id == R.id.swapButton) {getPresenter().swapClicked();} else if (id == R.id.dialpadButton) {
+ Log.e("QYC", "qyc, dialpad...1111");getPresenter().showDialpadClicked(!mShowDialpadButton.isSelected());} else if (id == R.id.addParticipant) {getPresenter().addParticipantClicked();
@@ -622,19 +624,20 @@ public class CallButtonFragmentbutton.setVisibility(View.VISIBLE);prevVisibleButton = button;prevVisibleId = i;
- } else {
- if (menu == null) {
- menu = getPopupMenu();
- }
+ } else {
+ //qyc
+ //if (menu == null) {
+ // menu = getPopupMenu();
+ //}// Collapse the current button into the overflow menu. If is the first visible// button that exceeds the threshold, also collapse the previous visible button// so that the total number of visible buttons will never exceed the threshold.
- if (prevVisibleButton != null) {
- addToOverflowMenu(prevVisibleId, prevVisibleButton, menu);
- prevVisibleButton = null;
- prevVisibleId = -1;
- }
- addToOverflowMenu(i, button, menu);
+ //if (prevVisibleButton != null) {
+ // addToOverflowMenu(prevVisibleId, prevVisibleButton, menu);
+ // prevVisibleButton = null;
+ // prevVisibleId = -1;
+ // }
+ // addToOverflowMenu(i, button, menu);}} else if (visibility == BUTTON_HIDDEN) {button.setVisibility(View.GONE);
@@ -949,6 +952,8 @@ public class CallButtonFragment: R.string.onscreenShowDialpadText_selected));}}
+
+ mShowDialpadButton.setVisibility(View.INVISIBLE);}@Override