I am building my first (material designed) app in Android Studio. I am following Slidnerd's Material design playlist, I'm up to #5. I wanted to know how I can have the menu popup to have dark text while have white primary and secondary text. Thanks!
Asked
Active
Viewed 855 times
-1
-
what you want .. your Question are not clear.. – Abhinav singh Apr 22 '15 at 11:11
-
I was wondering how I could have dark text on on menu popup, because I currently have white text on the popup. – Gursimran Bedi Apr 23 '15 at 00:18
-
check this [Link](http://stackoverflow.com/questions/18015010/action-bar-menu-item-text-color) – Abhinav singh Apr 23 '15 at 05:04
1 Answers
0
If i undestood your question, you need this:
Set color of Toolbar in xml:
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/my_awesome_toolbar"
android:layout_height="56dp"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="@color/purple_800" <!--color-->
app:theme="@style/ActionBarThemeOverlay"
app:popupTheme="@style/ActionBarPopupThemeOverlay"
android:elevation="2dp"/>
And another in style:
<style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:actionMenuTextColor">#fff</item>
<item name="android:windowAnimationStyle">@null</item>
</style>
<style name="ActionBarThemeOverlay" parent="">
<item name="android:textColorPrimary">#fff</item>
<item name="colorControlNormal">@color/gray_800</item>
<item name="colorControlHighlight">@color/gray_800</item>
<item name="android:textColor">#fff</item>
</style>
<style name="ActionBarPopupThemeOverlay" parent="ThemeOverlay.AppCompat.Light" >
<item name="android:background">@android:color/white</item>
<item name="android:textColor">#fff</item>
</style>
and in values-v21 include this too
<item name="android:colorPrimary">@color/purple_900</item>
<item name="android:colorPrimaryDark">@color/purple_900</item>

MilanNz
- 1,323
- 3
- 12
- 29
-
Thanks so much! All I needed was ActionBarPopupThemeOverlay. And BTW why doesn't your ActionBarThemeOverlay have a parent? – Gursimran Bedi Apr 23 '15 at 00:27
-
-
-
-