ShareActionProvider Menu Style

I have this menu when the user clicks on ShareActionProvider: enter image description here

How to change the background color. I suppose I need to style it, but I can’t find it anywhere else.

+7
android styles shareactionprovider
source share
2 answers

You might want to take a look at the source code if there is no documentation on how to apply the style. I didn't actually try to style ShareActionProvider, but I have some hints from the code:

I would like to hear if this works, since I will soon find myself in the same situation;)

+3
source share

So what I did to change the style is to change our styles.xml.

 <!-- ACTION BAR --> <style name="ToolbarTheme"> <item name="android:textColorPrimary">#fff</item> <item name="colorControlNormal">#fff</item> <item name="colorControlHighlight">#3fff</item> <item name="android:listPopupWindowStyle">@style/ToolbarPopupListStyle</item> <item name="listPopupWindowStyle">@style/ToolbarPopupListStyle</item> <item name="android:textAppearanceLargePopupMenu">@style/PopupMenuTextAppearance</item> <item name="textAppearanceLargePopupMenu">@style/PopupMenuTextAppearance</item> </style> <style name="ToolbarStyle"> <item name="android:background">?colorPrimary</item> <item name="android:titleTextAppearance">@style/collapsedToolbarText</item> <item name="titleTextAppearance">@style/collapsedToolbarText</item> </style> <style name="ToolbarPopupListStyle"> <item name="android:popupBackground">#00ff00</item> </style> <style name="PopupMenuTextAppearance" parent="android:TextAppearance.Small"> <item name="android:textColor">#ff0000</item> </style> 

Of course, these styles should be specified in the layout file referenced by the toolbar:

 <android.support.v7.widget.Toolbar android:id="@+id/toolbar_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@android:color/transparent" app:layout_collapseMode="pin" app:theme="@style/ToolbarTheme" style="@style/ToolbarStyle"/> 

I have a strange feeling, however, that styles should have a parent style. But it works like that.

Thanks to @Brian who pointed me in the right direction.

0
source share

All Articles