am 8a7f4009: am 4a24965c: Merge "Use custom ViewOutlineProvider to enable shadows" into lmp-dev
* commit '8a7f4009e1d232fa523df5aa4847dd0bb851b1c5':
Use custom ViewOutlineProvider to enable shadows
diff --git a/res/layout/people_activity_toolbar.xml b/res/layout/people_activity_toolbar.xml
index fe5be04..e69728b 100644
--- a/res/layout/people_activity_toolbar.xml
+++ b/res/layout/people_activity_toolbar.xml
@@ -14,14 +14,10 @@
limitations under the License.
-->
-<!-- Need to set a non null background on Toolbar in order for MenuItem ripples to be drawn on
- this view, instead of another. This will *not* cause an additional draw since the
- background is transparent.-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar_parent"
android:orientation="vertical"
android:layout_width="match_parent"
- android:background="#00000000"
android:elevation="@dimen/tab_elevation"
android:layout_height="wrap_content" >
diff --git a/res/layout/quickcontact_activity.xml b/res/layout/quickcontact_activity.xml
index 577a451..6d94fcc 100644
--- a/res/layout/quickcontact_activity.xml
+++ b/res/layout/quickcontact_activity.xml
@@ -35,12 +35,9 @@
android:contentDescription="@string/quickcontact_transparent_view_description"
android:id="@+id/transparent_view" />
- <!-- Needs a non null background for elevation to work on this View. This will *not*
- cause an additional draw since the background is transparent. -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="#00000000"
android:id="@+id/toolbar_parent">
<include layout="@layout/quickcontact_header" />
</FrameLayout>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 363e459..75f3607 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -359,6 +359,9 @@
portraitViewPagerTabs, landscapeViewPagerTabs, toolbar);
mActionBarAdapter.initialize(savedState, mRequest);
+ // Add shadow under toolbar
+ ViewUtil.addRectangularOutlineProvider(findViewById(R.id.toolbar_parent), getResources());
+
// Configure action button
final View floatingActionButtonContainer = findViewById(
R.id.floating_action_button_container);
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 209904f..f5d4951 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -119,6 +119,7 @@
import com.android.contacts.common.util.DateUtils;
import com.android.contacts.common.util.MaterialColorMapUtils;
import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
+import com.android.contacts.common.util.ViewUtil;
import com.android.contacts.detail.ContactDisplayUtils;
import com.android.contacts.interactions.CalendarInteractionsLoader;
import com.android.contacts.interactions.CallLogInteractionsLoader;
@@ -570,6 +571,9 @@
});
}
+ // Allow a shadow to be shown under the toolbar.
+ ViewUtil.addRectangularOutlineProvider(findViewById(R.id.toolbar_parent), getResources());
+
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setActionBar(toolbar);
getActionBar().setTitle(null);