diff options
author | Nancy Chen <nancychen@google.com> | 2014-06-03 15:04:21 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-06-04 01:13:43 +0000 |
commit | 200e32804c7de47db7d918bae5504cfb7c07e2cd (patch) | |
tree | 72978a21fdab555ca2693a54f479ff9ed413ed85 /src | |
parent | d4a57a94d55840782a444bda20ae45d387fc2230 (diff) |
DO NOT MERGE 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
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/list/ViewPagerTabs.java | 11 |
1 files changed, 11 insertions, 0 deletions
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)) { |