contextual-action-bar

Change Status Bar color when entering Contextual Action Mode

寵の児 提交于 2019-11-29 02:18:56
问题 I have an application that uses theme attribute (colorPrimaryDark) to color the Status Bar on Android v21+: This is working fine. Now, when user long-presses a list item and enters the contextual action mode, I am able to color the CAB bar using attribute actionModeBackground so it looks like this: So the action bar is gray, which is what I want, but the status bar is still colored using the theme dark color . I don't want that, I want to change it to dark gray or black. How can I do this? I

Webview text selection not clearing

泄露秘密 提交于 2019-11-28 21:56:22
I have implemented an ActionMode.Callback for custom text selection functions within a WebView . The problem that I am having is that the selection and the action mode states do not match. When I long-press, everything starts out just fine. When I interact with one of the buttons, or the WebView (excluding the actual selection) then the ActionMode should be destroyed, and the selection should disappear. In Android 4.4, KitKat, this is exactly what happens. However, this is not what is happening in 4.1.1 - 4.3, Jelly Bean. When I click one of the buttons, the selection is not removed. When I

Android compatibility contextual action bar

被刻印的时光 ゝ 提交于 2019-11-28 20:22:10
In trying to follow the Android Design Guidelines, I'm running into a small quandary. I want to have a list of items that I can long-press several of (multi-select), and then perform bulk actions on them. The Design Guidelines suggest using the Contextual Action Bar for this, and it sounds perfectly like what I had in mind. Problem is, I'm trying to maintain compatibility backwards to API 7 (due to my phone being 2.3.3 currently). I'm using ActionBarSherlock to get other actionbar stuff, but I can't seem to figure out how to get it to either fire up a contextual action bar, nor have I figured

Overriding the default Contextual Action Bar for text selection(in WebView) in Android

和自甴很熟 提交于 2019-11-28 17:31:29
I want to override the existing default Contextual Action Bar(CAB) for text selection. I mean, I want to display my own CAB, with my own buttons, when some text is selected on the webview. I tried implementing a CAB using Android Documentation. OnLongClickListener doesn't capture the text selection event in the web view. What is the event that captures text selection? Is it possible to hide the default CAB and display my CAB on Text selection? childWebView.setOnLongClickListener(new OnLongClickListener() { @Override // Called when the user long-clicks on someView public boolean onLongClick

Android expanded SearchView makes other ActionBar items disappear

淺唱寂寞╮ 提交于 2019-11-28 01:27:48
问题 I'm facing some problems with a SearchView in a Contextual Action Bar called by a Fragment. The major one is that when my SearchView is expanded, it makes disappear all other items in action bar (except the closing button) even if there's some unused space, like you can see in this screenshot: Screenshot Furthermore, I'm also having the same exact problem discussed in this question: ActionBar always expanded SearchView with the icon inside This is the XML code of my SearchView: <?xml version=

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

我是研究僧i 提交于 2019-11-27 20:38:39
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. CommonsWare Yeah, I couldn't find it either -- I had to ask at Google I|O. Use startActionMode() . Here is one of their samples that demonstrates it. I need to do more work in this area myself. Jeff Axelrod To

Webview text selection not clearing

*爱你&永不变心* 提交于 2019-11-27 14:06:30
问题 I have implemented an ActionMode.Callback for custom text selection functions within a WebView . The problem that I am having is that the selection and the action mode states do not match. When I long-press, everything starts out just fine. When I interact with one of the buttons, or the WebView (excluding the actual selection) then the ActionMode should be destroyed, and the selection should disappear. In Android 4.4, KitKat, this is exactly what happens. However, this is not what is

Android compatibility contextual action bar

扶醉桌前 提交于 2019-11-27 13:03:31
问题 In trying to follow the Android Design Guidelines, I'm running into a small quandary. I want to have a list of items that I can long-press several of (multi-select), and then perform bulk actions on them. The Design Guidelines suggest using the Contextual Action Bar for this, and it sounds perfectly like what I had in mind. Problem is, I'm trying to maintain compatibility backwards to API 7 (due to my phone being 2.3.3 currently). I'm using ActionBarSherlock to get other actionbar stuff, but

Overriding the default Contextual Action Bar for text selection(in WebView) in Android

依然范特西╮ 提交于 2019-11-27 10:32:59
问题 I want to override the existing default Contextual Action Bar(CAB) for text selection. I mean, I want to display my own CAB, with my own buttons, when some text is selected on the webview. I tried implementing a CAB using Android Documentation. OnLongClickListener doesn't capture the text selection event in the web view. What is the event that captures text selection? Is it possible to hide the default CAB and display my CAB on Text selection? childWebView.setOnLongClickListener(new

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

前提是你 提交于 2019-11-27 02:54:26
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? 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 android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="match_parent" android