Contextual Action Bar (CAB) passing touch events to Action Bar - android

In my Activity i have an ActionBar with two action items. In this same activity i display contextual action bar with one action item for selecting multiple items and deleting them.
The problem i am facing is contextual action bar is passing the touch events to the action bar lying behind. So when i click on the contextual action bar the touch event is getting passed to action bar and it is processing onOptionItemSelected.
How do i avoid this?
One way i can think of is storing the ActionMode as a field in the activity and then using that to find if the action mode is visible and decide whether to process the onOptionItemSelected call.
Any other way that this can be avoided?

Related

Android Accessibility: ActionMode actionBar items not read instead underlying action bar items are read

When I select items in my list the contextual action bar appears. This bar has a number of action items that will be applicable to the selected items from the list.
When i turn on TalkBack and navigate to this contextual action bar, the focus appears to be on the contextual action bar but TalkBack actually reads out the items on the original actionBar (i presume this is underneath the contextual action bar).
How can i get talkback to only navigate through the contextual action bar items and never read out the actionBar items when the contextual action bar is visible.
Just get a handle on the underlying toolbar and set it to invisible. Showing and hiding the support actionbar will not work as the content will slide up under the action mode bar.

WebViewAdd Custom Menu Item in Contextual Action Bar with overriding existing

I need to add some custom menu items in contextual action bar for WebView. My current research shows that only one of the following two things can be done.
Override action mode to supply custom action items. In this case default items are gone.
Use system provided action mode. In this way, I can't add my menu items.
May this will solve your problem.
https://github.com/TheFinestArtist/FinestWebView-Android

Split Action Bar only in Action Mode (CAB)

It is possible to have a split Action Bar only in Action Mode?
My application have only the top action bar, but it's Contextual Action Bar needs to be splitted in two (top/bottom).
I found this:
The contextual action bar is not necessarily associated with the action bar. They operate independently, even though the contextual action bar visually overtakes the action bar position.
on http://developer.android.com/guide/topics/ui/menus.html#CAB. So i think it's possible, but how?
I'm pretty confident it's not possible - and even if it is - i would cringe to see the hack.
The cab is a crafty beast that offers a lot of convenience out of the box but doesn't like to be tampered with.
The platform takes care of you fantastically by placing a CAB at the bottom if required or collapsing items , but as far as UI designs go, you should avoid relying on the bottom bar.
see https://stackoverflow.com/a/8609144/1593156 .

Removing Toast from Action bar sherlock

I'm having action bar which display application Name, search and more action menu item, though i'm using sherlock library for that. I want to disable the toast of search and more item when i performing long press event in the action bar. Did anyone knows how to disable / redefine long press event.
This is a feature of the native action bar. It cannot be removed.

Action Bar Sherlock - Hide Actions on Collapse

I have three actions with the property SHOW_AS_ACTION_ALWAYS since I want to have the three of them always showing. However one of them has a collapse action view, and I wan't to hide the other two to have the full action bar for my layout when I click the action. Is there any way to do this?
This only seems to work if I use SHOW_AS_ACTION_IF_ROOM but this way I only get two items on the action bar instead of three.

Categories

Resources