Add alpha layer to tab carousel on contact card
- Introduce CarouselTab class to handle the
alpha layer and touch interceptor
- Clicking anywhere on the tab will select that
tab
- Remove split style action bar on contact card
so favorites star will be in upper right corner
Bug: 5081735
Bug: 5042660
Change-Id: I54088b49c928297dbfc523752258ceaa97cce445
diff --git a/res/layout/carousel_about_tab.xml b/res/layout/carousel_about_tab.xml
index dfcf0da..e902c8e 100644
--- a/res/layout/carousel_about_tab.xml
+++ b/res/layout/carousel_about_tab.xml
@@ -14,8 +14,9 @@
limitations under the License.
-->
-<RelativeLayout
+<view
xmlns:android="http://schemas.android.com/apk/res/android"
+ class="com.android.contacts.detail.CarouselTab"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
@@ -51,4 +52,22 @@
android:textColor="@color/detail_tab_carousel_tab_label_color"
style="@android:style/Widget.Holo.ActionBar.TabView" />
-</RelativeLayout>
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="@android:color/black"
+ android:alpha="0"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"/>
+</view>
diff --git a/res/layout/carousel_updates_tab.xml b/res/layout/carousel_updates_tab.xml
index b036523..689e17b 100644
--- a/res/layout/carousel_updates_tab.xml
+++ b/res/layout/carousel_updates_tab.xml
@@ -14,8 +14,13 @@
limitations under the License.
-->
-<RelativeLayout
+<!--
+ TODO: Collapse carousel_about_tab with carousel_updates_tab into 1 XML that
+ handles all cases when updates fragment is more finalized.
+-->
+<view
xmlns:android="http://schemas.android.com/apk/res/android"
+ class="com.android.contacts.detail.CarouselTab"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
@@ -68,4 +73,23 @@
android:textStyle="bold"
android:maxLines="3"/>
-</RelativeLayout>
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="@android:color/black"
+ android:alpha="0"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"/>
+
+</view>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index e98175d..c23d99d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -73,7 +73,7 @@
<item name="call_log_voicemail_status_text_color">#000000</item>
</style>
- <style name="ContactDetailActivityTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
+ <style name="ContactDetailActivityTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
<item name="android:windowContentOverlay">@null</item>
</style>