contextual-action-bar

Contextual Actionbar styles

无人久伴 提交于 2019-11-27 00:10:09
I'm looking for style information on the Contextual Action bar (CAB). I just need to change the colour of the text in fact.. As you can see from the above, this is using the standard Theme.Holo.Light.DarkActionBar theme, so I just need to set the text colour to white! Can anyone point me in the right direction? To change the color/etc of the text in a contextual action bar: public boolean onCreateActionMode(ActionMode mode, Menu menu) { //mode.setTitle("Contextual Action Bar"); (replace this call) TextView tv= (TextView)getLayoutInflater().inflate(R.layout.contextual_title, null); tv.setText(

How to invoke the ActionBar's ContextMenu-like behavior?

余生颓废 提交于 2019-11-26 22:57:37
问题 In Android 3.0, when you select some text for example, the ActionBar switches to a ContextMenu-like mode, which enables you to do actions with the selected text: copy/share/etc, and a "Done" button appears on the left side to enable the user to leave this mode. How can I switch the ActionBar into this mode in my app (with my menu items of course)? I just couldn't find this in the docs. 回答1: Yeah, I couldn't find it either -- I had to ask at Google I|O. Use startActionMode(). Here is one of

How can you implement multi-selection and Contextual ActionMode in ActionBarSherlock?

六月ゝ 毕业季﹏ 提交于 2019-11-26 10:17:17
问题 How should I implement multi selection on AdapterView with ActionBarSherlock, because it does not provide MultiChoiceModeListener? This is what it looks like How can you do this? 回答1: So here's what I did. Edit: Over a year passed since I found out the previous answer had alot of useless code (woops) and the CAB thing can be achieved with much less effort and a cleaner code, so I took some time and updated it The LibraryFragment ListView should be defined with choice mode "none" <ListView

Custom cut/copy action bar for EditText that shows text selection handles

耗尽温柔 提交于 2019-11-26 05:59:41
问题 I have an app where I want to be able to show a TextView (or EditText) that allows the user to select some text, then press a button to have something done with that text. Implementing this on Android versions prior to Honeycomb is no problem but on Honeycomb and above the default long-press action is to show an action bar with Copy/Cut/Paste options. I can intercept long-press to show my own action bar, but then I do not get the text selection handles displayed. Once I have started my own