From 200e32804c7de47db7d918bae5504cfb7c07e2cd Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Tue, 3 Jun 2014 15:04:21 -0700 Subject: 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 --- src/com/android/dialer/list/ViewPagerTabs.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/com') 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); @@ -156,6 +159,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(); -- cgit v1.2.3