contextual-action-bar

Passing id of ListView item to ActionMode.Callback object

醉酒当歌 提交于 2019-12-12 12:49:58
问题 So my problem right now is that right now I am long clicking an item in a ListView which brings up a contextual action bar. The id passed into onItemLongClick is the variable that I would like to use in the mActionModeCallback's on ActionItemClicked() method. This seems like it would be a fairly common procedure since if a user is editing a list of items, you would want to access the id of that row in the database somehow when the user clicked an "edit" or a "delete" action. listView

How do I disable sliding tabs when in contextual action bar, by making the tabs not clickable/swipeable?

旧城冷巷雨未停 提交于 2019-12-12 11:21:51
问题 I have a toolbar, to which I have attached a sliding tab layout, using these two classes: SlidingTabLayout, SlidingTabStrip. When I long press an item, the contextual action bar appears and overlays the toolbar, using <item name="windowActionModeOverlay">true</item> in my styles.xml. The problem is that the Tabs are still clickable, and swipable. I have tried setClickable(false) , which didn't work. How do I make the tabs not clickable, so that I can then change the "state look" of the tabs

ActionBar changes colour after changing phone orientation and closing Contextual Action Bar

末鹿安然 提交于 2019-12-11 13:14:48
问题 Problem First my ActionBar (with custom menu) is purple, then: Trigger CAB by long-click on my ListView Change phone orientation Cancel CAB ActionBar becomes white. This does not happen without phone orientation change. I have tried this on android 4.4.4 , minSdkVersion="19" , targetSdkVersion="26" . Can you please advise me, why this could happen? UPDATE: Tried on API 25 emulator, and this does not happen. Sources Activity layout: <android.support.constraint.ConstraintLayout xmlns:android=

Contextual ActionBar hides when I click on hardware backbutton and the keyboard is out

久未见 提交于 2019-12-11 11:16:48
问题 I am using the Contextual ActionBar for editing and when I have the keyboard shown and I want to hide it by pressing the hardware back button, it hides the keyboard but it also cancels the contextual actionbar and I really can´t find a way how to keep it on. Anyone? 回答1: You should try to override the Back Key hardware, and handle the expected behaviour with a boolean as follows: // boolean isVisible to retrieve the state of the SoftKeyboard private boolean isVisible = false; // isVisible

remove back/home button from action mode on long press in android

我的梦境 提交于 2019-12-11 04:40:18
问题 I have implemented contextual action mode on long press inside recycler view . For that i have called ActionModeCallback from creating action mode . While creating action mode , back arrow is showing by default . Check below : On click back arrow , action mode will close. Now i want to hide or remove that default back button which is coming along with action mode in android . Note : Already tried getActionBar().setDisplayHomeAsUpEnabled(false). but it's not working . Kindly help. Edited :

Contextual Actionbar with DialogFragment

蓝咒 提交于 2019-12-10 14:15:23
问题 I've been trying to implement a contextual action bar along with a dialog fragment. Similar to the downloads widget in android. I've tried to set android:windowActionModeOverlay to be true in the theme. But it doesnt seem to work. Is there any way I can achieve it?? 回答1: The downloads window that you have in your screenshot is actually an Activity using the @android:style/Theme.Holo.Dialog theme which makes it look like a dialog. To achieve the same look as the downloads window, your Activity

ListFragment multi-choice does not show selection

浪子不回头ぞ 提交于 2019-12-10 11:33:23
问题 I'm trying to implement the contextual action bar in my app. I'm extending a ListFragment and I have a custom ArrayAdapter and list item xml defined. Clicking on items works fine and the background color changes on the list item. Where I'm running into trouble is when selecting multiple items. The contextual action bar comes up and I can tell I'm actually selecting items when I touch them because I'm having it log which items are selected, but the background highlight color on the list item

CAB overflow menu custom style

杀马特。学长 韩版系。学妹 提交于 2019-12-10 03:38:26
问题 In my application I am showing a contextual action bar and because I don't have room for all the actions, some of them are accessed under the overflow menu button. Now I want to style the overflow menu and change its background. My theme inherits from Theme.AppCompat, and I have these styles defined: <item name="android:popupMenuStyle">@style/PopupMenu</item> <item name="android:listPopupWindowStyle">@style/PopupMenu</item> <item name="android:dropDownListViewStyle">@style/DropDownListView<

Nested Contextual Action Bars

十年热恋 提交于 2019-12-08 12:24:41
问题 I am creating custom contextual action bars (CAB) within a custom WebView . My requirements are such that selecting a particular option from the first CAB will open a second CAB. This is the end goal: I have made this happen, but the selection is not working correctly. I know it looks correct, but if the user taps any of the other three icons, this is the result: If the user touches the selection after pressing any of the four initial icons, the app crashes due to a null pointer exception.

How to change the overflow button when in CAB?

和自甴很熟 提交于 2019-12-07 08:27:26
I have 2 different backgrounds to the Action bar. One light and another dark. One for the default title and another for the CAB (when some of the elements are selected/activated). I would like to have 2 different overflow when in those different states. I tried the selector but couldn't find the state to represent when in CAB mode. Any idea how to provide different overflow buttons? On a more general note, where can I start exploring the Action Bar so I could find the answers myself instead of finding bits and pieces all over the inet? I would expect Google/Android to provide a starting point.