android-actionmode

how to Customize the Contextual Action Bar using appCompat in material design

自作多情 提交于 2019-11-27 03:20:21
MainActivity.java I've implemented MultiChoiceModeListener in this class and below is the code: on listView : listView.setMultiChoiceModeListener(MainActivity.this); listView.setChoiceMode(listView.CHOICE_MODE_MULTIPLE_MODAL); @Override public boolean onActionItemClicked(ActionMode arg0, MenuItem arg1) { switch (arg1.getItemId()) { case R.id.save: // Close CAB arg0.finish(); return true; case R.id.saveto: // Close CAB arg0.finish(); return true; default: return false; } } @Override public boolean onCreateActionMode(ActionMode arg0, Menu arg1) { arg0.getMenuInflater().inflate(R.menu.save_menu,

Remove “Done” button of ActionMode

霸气de小男生 提交于 2019-11-27 00:55:47
问题 0I'm using startActionMode(ActionMode) on my app. By default it's add a "Done" button on the bar, I want to remove it. Also, if there's a way to change it's text, I want to know too, cause a different description than "Done" can make the action be correspondent to the behaviour of what it does. 回答1: Even I was stuck with same and I found this way to solve it. int doneButtonId = Resources.getSystem().getIdentifier("action_mode_close_button", "id", "android"); LinearLayout layout =

Display ActionMode over Toolbar

≯℡__Kan透↙ 提交于 2019-11-26 15:36:14
问题 I am trying to use the android.view.ActionMode with the new android.support.v7.widget.Toolbar , in addition to the traditional android.app.ActionBar . I am able to display it with: toolbar.startActionMode(callback); The problem is that the ActionMode is displayed over the ActionBar , and not over the Toolbar . Is there a way to change that? I tryied to set the following in my theme, but it does not seem to change anything: <item name="windowActionModeOverlay">true</item> 回答1: Since you are

How to change ActionMode background color in Android

不羁岁月 提交于 2019-11-26 11:14:10
问题 i am creating an android app in which support level api is 7 so i am using sherlock actionbar. I am using action mode in it. Issue is i want to change the background of action mode. So i have tried <item name=\"android:background\">@color/something</item> <item name=\"android:backgroundStacked\">@color/something</item> <item name=\"android:backgroundSplit\">@color/something</item> these style solution\'s available but none of them works. 回答1: if you want change the color of ActionBar just do

how to Customize the Contextual Action Bar using appCompat in material design

柔情痞子 提交于 2019-11-26 10:28:53
问题 MainActivity.java I\'ve implemented MultiChoiceModeListener in this class and below is the code: on listView : listView.setMultiChoiceModeListener(MainActivity.this); listView.setChoiceMode(listView.CHOICE_MODE_MULTIPLE_MODAL); @Override public boolean onActionItemClicked(ActionMode arg0, MenuItem arg1) { switch (arg1.getItemId()) { case R.id.save: // Close CAB arg0.finish(); return true; case R.id.saveto: // Close CAB arg0.finish(); return true; default: return false; } } @Override public