Customize ActionMode 'Done' button

2,435 views
Skip to first unread message

Stephan Roorda

unread,
Jun 8, 2012, 9:59:07 PM6/8/12
to actionba...@googlegroups.com
I implemented ActionMode using the callback and I have added my menus but there is that default 'Done' button in the upper left when the contextual action bar is shown.  I need to either get rid of it and implement my own or figure out a way to style it to match the menu buttons I am adding.  Right now the 'Done' button shows in a different text style then the others and I cannot find the styles to override to fix that.  Anyone know what they are?

I have tried the following with no luck:
<style name="AppTheme">
    <item name="actionModeBackground">@color/header_orange</item>
    <item name="android:actionModeBackground">@color/header_orange</item>
    
    <item name="actionModeCloseDrawable">@android:drawable/ic_menu_close_clear_cancel</item>
    <item name="android:actionModeCloseDrawable">@android:drawable/ic_menu_close_clear_cancel</item>
    
    <item name="actionModeCloseButtonStyle">@style/MyActionModeCloseButtonStyle</item>
    <item name="android:actionModeCloseButtonStyle">@style/MyActionModeCloseButtonStyle</item>
    
  </style>    

  <style name="MyActionModeCloseButtonStyle" parent="Widget.Sherlock.ActionButton.CloseMode">
    <item name="android:text">Cancel</item>    
    <item name="android:textColor">@color/white</item>
    <item name="android:textSize">@dimen/textXLarge</item>    
    <item name="android:textAllCaps">false</item>
  </style>

Stephan

Bren Worth

unread,
Apr 10, 2013, 4:17:56 PM4/10/13
to actionba...@googlegroups.com
I've run into this issue just recently and used this example to solve the problem.  At present I was unable to find a better way then manually updating

Reply all
Reply to author
Forward
0 new messages