Quick Note: Toolbar Style

不知為何經常忘記,為免每次要再 search 過,所以 mark down for my own reference:

layout/toolbar.xml

<android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:layout_alignParentTop="true"
        app:theme="@style/AppTheme.Widget.Toolbar"
        app:popupTheme="@style/AppTheme.Widget.Toolbar.Popup"
        />

values/style.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>

<style name="AppTheme.Widget.Toolbar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
    <item name="android:background">@color/orange</item>
    <item name="android:textColorPrimary">@android:color/white</item>
    <item name="selectableItemBackground">?android:selectableItemBackground</item>
    <item name="selectableItemBackgroundBorderless">?android:selectableItemBackgroundBorderless</item>
</style>

<style name="AppTheme.Widget.Toolbar.Popup" parent="ThemeOverlay.AppCompat.Light">
    <item name="android:background">#F4F4F4</item>
</style>