summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-06-03 15:04:21 -0700
committerNancy Chen <nancychen@google.com>2014-06-03 17:24:46 -0700
commitf40bd66b3a8dd4da0fe272570bc9089e6000bec4 (patch)
treec851566a899c83921f176ad5bd1adcff8a3e878d
parent9da8fb46fa21159321295119e1b2075747cfbbf9 (diff)
Decreased shadows for search bar and recent contact
Lowered elevation/z-level for search bar ("Search contacts & places") and recent contact card ("Caller ID by Google is enabled") Bug: 15385828 Change-Id: Icdbc87d4046953bafcb5e0c7686e6efb3a49bdfb
-rw-r--r--res/layout/lists_fragment.xml1
-rw-r--r--res/values/dimens.xml5
-rw-r--r--src/com/android/dialer/list/ViewPagerTabs.java11
3 files changed, 15 insertions, 2 deletions
diff --git a/res/layout/lists_fragment.xml b/res/layout/lists_fragment.xml
index 7e15f84c5..02dcbe3a0 100644
--- a/res/layout/lists_fragment.xml
+++ b/res/layout/lists_fragment.xml
@@ -40,6 +40,7 @@
android:textAllCaps="true"
android:orientation="horizontal"
android:layout_gravity="top"
+ android:elevation="@dimen/tab_elevation"
style="@style/DialtactsActionBarTabTextStyle" />
<android.support.v4.view.ViewPager
android:id="@+id/lists_pager"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 416c3138d..b8c5588fe 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -55,7 +55,7 @@
<dimen name="favorites_row_undo_text_side_padding">32dp</dimen>
<!-- Dimensions for most recent call shortcut cards -->
- <dimen name="recent_call_log_item_translation_z">3dp</dimen>
+ <dimen name="recent_call_log_item_translation_z">1dp</dimen>
<dimen name="recent_call_log_item_margin_horizontal">8dp</dimen>
<dimen name="recent_call_log_item_margin_top">4dp</dimen>
<dimen name="recent_call_log_item_margin_bottom">6dp</dimen>
@@ -110,10 +110,11 @@
<!-- Size of the icon (voice search, close search) in the search box. -->
<dimen name="search_box_icon_size">28dp</dimen>
<dimen name="search_list_padding_top">8dp</dimen>
- <dimen name="search_box_elevation">3dp</dimen>
+ <dimen name="search_box_elevation">2dp</dimen>
<!-- Size of text in tabs. -->
<dimen name="tab_height">43dp</dimen>
+ <dimen name="tab_elevation">2dp</dimen>
<!-- Padding to the left and right of call log action buttons. -->
<dimen name="call_log_action_horizontal_padding">8dp</dimen>
diff --git a/src/com/android/dialer/list/ViewPagerTabs.java b/src/com/android/dialer/list/ViewPagerTabs.java
index c95a80bda..7e5b5949a 100644
--- a/src/com/android/dialer/list/ViewPagerTabs.java
+++ b/src/com/android/dialer/list/ViewPagerTabs.java
@@ -3,6 +3,7 @@ package com.android.dialer.list;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
+import android.graphics.Outline;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
@@ -38,6 +39,7 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP
final boolean mTextAllCaps;
int mPrevSelected = -1;
int mSidePadding;
+ Outline mOutline;
private static final int TAB_SIDE_PADDING_IN_DPS = 10;
@@ -94,6 +96,7 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP
setFillViewport(true);
mSidePadding = (int) (getResources().getDisplayMetrics().density * TAB_SIDE_PADDING_IN_DPS);
+ mOutline = new Outline();
final TypedArray a = context.obtainStyledAttributes(attrs, ATTRS);
mTextSize = a.getDimensionPixelSize(0, 0);
@@ -157,6 +160,14 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP
}
@Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ // An outline is necessary to enable shadows
+ mOutline.setRect(l, t, r, b);
+ setOutline(mOutline);
+ super.onLayout(changed, l, t, r, b);
+ }
+
+ @Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
int tabStripChildCount = mTabStrip.getChildCount();
if ((tabStripChildCount == 0) || (position < 0) || (position >= tabStripChildCount)) {