Move fake menu buttons to DialtactsActivity
Currenty fake menu buttons are in DialpadFragment, which requires the app
to render split ActionBars during users drag events. Because of that
we have a rendering problem around horizontal swipes (bug 6126934: Lots
of stutter in animations between Dialer tabs).
This change moves those buttons to DialtactsActivity and delay menu
creation until really necessary.
This change also introduces some verbose logs, to detect possible new
problems or bug 6041917.
Bug: 6041917
Bug: 6126934
Change-Id: Ic2d8d82461e6d1916f2309b775f47c47d310ad1a
diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml
index d652ad7..1ad71a4 100644
--- a/res/layout/call_log_fragment.xml
+++ b/res/layout/call_log_fragment.xml
@@ -20,8 +20,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="?android:attr/actionBarSize"
- android:divider="?android:attr/dividerHorizontal"
- android:showDividers="end">
+ android:divider="?android:attr/dividerHorizontal">
<FrameLayout
android:id="@+id/voicemail_status"
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml
index a95e4cb..796eb28 100644
--- a/res/layout/dialpad_fragment.xml
+++ b/res/layout/dialpad_fragment.xml
@@ -64,27 +64,18 @@
android:layout_height="@dimen/dialpad_vertical_margin"
android:background="#66000000"/>
- <LinearLayout
+ <!-- left and right paddings will be modified by the code. See DialpadFragment. -->
+ <FrameLayout
android:id="@+id/dialButtonContainer"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="@integer/dialpad_layout_weight_additional_buttons"
android:layout_gravity="center_horizontal"
android:background="@drawable/dialpad_background">
- <ImageButton
- android:id="@+id/searchButton"
- android:layout_width="wrap_content"
- android:layout_height="?android:attr/actionBarSize"
- android:layout_gravity="bottom|center_horizontal"
- android:state_enabled="false"
- android:background="?android:attr/selectableItemBackground"
- android:contentDescription="@string/description_search_button"
- android:src="@drawable/ic_dial_action_search"/>
<ImageButton
android:id="@+id/dialButton"
- android:layout_width="0px"
- android:layout_weight="1"
+ android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:state_enabled="false"
@@ -92,16 +83,7 @@
android:contentDescription="@string/description_dial_button"
android:src="@drawable/ic_dial_action_call" />
- <ImageButton
- android:id="@+id/overflow_menu"
- android:layout_width="wrap_content"
- android:layout_height="?android:attr/actionBarSize"
- android:layout_gravity="bottom|center_horizontal"
- android:src="@drawable/ic_menu_overflow"
- android:contentDescription="@string/action_menu_overflow_description"
- android:nextFocusLeft="@id/digits"
- android:background="?android:attr/selectableItemBackground"/>
- </LinearLayout>
+ </FrameLayout>
<!-- "Dialpad chooser" UI, shown only when the user brings up the
Dialer while a call is already in progress.
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
index 7bcddc1..35fa00f 100644
--- a/res/layout/dialtacts_activity.xml
+++ b/res/layout/dialtacts_activity.xml
@@ -24,4 +24,24 @@
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
+
+ <ImageButton
+ android:id="@+id/searchButton"
+ android:layout_width="wrap_content"
+ android:layout_height="?android:attr/actionBarSize"
+ android:layout_gravity="bottom|left"
+ android:state_enabled="false"
+ android:background="?android:attr/selectableItemBackground"
+ android:contentDescription="@string/description_search_button"
+ android:src="@drawable/ic_dial_action_search"/>
+
+ <ImageButton
+ android:id="@+id/overflow_menu"
+ android:layout_width="wrap_content"
+ android:layout_height="?android:attr/actionBarSize"
+ android:layout_gravity="bottom|right"
+ android:src="@drawable/ic_menu_overflow"
+ android:contentDescription="@string/action_menu_overflow_description"
+ android:nextFocusLeft="@id/digits"
+ android:background="?android:attr/selectableItemBackground"/>
</FrameLayout>
diff --git a/res/layout/phone_contact_tile_list.xml b/res/layout/phone_contact_tile_list.xml
index 29ceb19..289fba3 100644
--- a/res/layout/phone_contact_tile_list.xml
+++ b/res/layout/phone_contact_tile_list.xml
@@ -21,8 +21,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="?android:attr/actionBarSize"
- android:divider="?android:attr/dividerHorizontal"
- android:showDividers="end">
+ android:divider="?android:attr/dividerHorizontal">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index b6620f5..c0ea600 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -238,4 +238,7 @@
<!-- Min height of the list of contacts when the contact picker is a dialog (on
wide screen devices). -->
<dimen name="contact_picker_contact_list_min_height">550dip</dimen>
+
+ <!-- Min with of fake menu buttons, which should be same as ActionBar's one -->
+ <dimen name="fake_menu_button_min_width">56dip</dimen>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ae2ecc2..2132dc3 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -284,7 +284,12 @@
</style>
<style name="DialtactsActionBarStyle" parent="android:Widget.Holo.ActionBar">
- <!-- For making test easier. Should use @null. -->
+ <!-- For making test easier. Should use @null.
+ TODO: use @null once we're sure issue 6041917 is gone.
+ Don't forget to add android:showDividers="end" to call_log_fragment.xml
+ and phone_contact_tile_list.xml, to show horizontal divider between
+ the list and the split ActionBar.
+ -->
<!-- <item name="android:backgroundSplit">@null</item> -->
<item name="android:backgroundStacked">@drawable/ab_stacked_opaque_dark_holo</item>
<item name="android:displayOptions"></item>