contextual-action-bar

Contextual action bar weird behavior for menu item

白昼怎懂夜的黑 提交于 2019-12-06 22:14:51
问题 I have some weird behavior in the contextual action bar. Firstly: One menu item is only shown every second time I click on the overflow button: Secondly / thirdly: Is there a way that the icons do not use so much space? When I change add property android:showAsAction="always" to all items, there is actually enough space to show all icons - but my share icon is not clickable anymore: Clean Project does not help. I use Android 4.2.2 on my test device (Galaxy S3). I even tried to completely

Remove Title from Contextual Action Bar

孤街醉人 提交于 2019-12-06 10:15:50
问题 I want to remove the view that is allocated for the title in a contextual action bar. Please note that I do not want to set the title; I want the View entirely gone. This is to allow more room so that actions can be displayed on the menu bar rather than being dropped into the overflow menu. Also note that I do not want to set android:showAsAction="always" . I want Android to decide how much space there is for the icons. I just want there to be more space by removing the blank area that is

ListFragment multi-choice does not show selection

本秂侑毒 提交于 2019-12-06 08:28:09
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 does not change! It seems like some other people were running into this problem when using the Fragments

Hiding/showing the contextual action bar programmatically

烈酒焚心 提交于 2019-12-06 02:38:20
问题 My use case: I have an activity with a ViewPager as its only view element, set up with three Fragment s for its three pages (using a FragmentPagerAdapter ). One of these fragments is a ListFragment , while the other two regular Fragment s containing some infographics. The list in the ListFragment allows "checking" elements, and checking elements brings up the contextual action bar, presenting a list of actions possible on the selected/checked items. My problem: When I select a couple of list

Contextual action bar weird behavior for menu item

限于喜欢 提交于 2019-12-05 01:31:27
I have some weird behavior in the contextual action bar. Firstly: One menu item is only shown every second time I click on the overflow button: Secondly / thirdly: Is there a way that the icons do not use so much space? When I change add property android:showAsAction="always" to all items, there is actually enough space to show all icons - but my share icon is not clickable anymore: Clean Project does not help. I use Android 4.2.2 on my test device (Galaxy S3). I even tried to completely flash a new ROM on my XXX GS3 ( CyanogenMod 10.1 now, before SlimBean , also removed the navigationbar at

Remove Title from Contextual Action Bar

天大地大妈咪最大 提交于 2019-12-04 16:58:05
I want to remove the view that is allocated for the title in a contextual action bar. Please note that I do not want to set the title; I want the View entirely gone. This is to allow more room so that actions can be displayed on the menu bar rather than being dropped into the overflow menu. Also note that I do not want to set android:showAsAction="always" . I want Android to decide how much space there is for the icons. I just want there to be more space by removing the blank area that is reserved for a title. UPDATE Things I have tried: ActionMode.setCustomView(null) ActionMode

Hiding/showing the contextual action bar programmatically

我只是一个虾纸丫 提交于 2019-12-04 08:36:58
My use case: I have an activity with a ViewPager as its only view element, set up with three Fragment s for its three pages (using a FragmentPagerAdapter ). One of these fragments is a ListFragment , while the other two regular Fragment s containing some infographics. The list in the ListFragment allows "checking" elements, and checking elements brings up the contextual action bar, presenting a list of actions possible on the selected/checked items. My problem: When I select a couple of list items, the CAB shows up. But when I switch pages, the CAB stays visible, presenting the actions. To

How to make the Contextual ActionMode Bar overlay the appcompat-v7 Toolbar but not the navigation drawer?

我的梦境 提交于 2019-12-03 18:43:58
问题 I have an activity with an app bar and a navigation drawer. The app bar is implemented using the new Toolbar class from appcompat-v7 library version 21.+, and the navigation drawer is displayed in front of it. The activity contains a list view with items which can be selected, so I am showing a contextual action bar (CAB). It is started by calling: ActionBarActivity.startSupportActionMode(android.support.v7.view.ActionMode.Callback callback) By default, the CAB is inserted above the Toolbar

How to select an ListView item after long click?

谁说我不能喝 提交于 2019-12-03 05:10:07
问题 I've got a silly little problem. I've registered a ListFragment both as OnItemClickListener and OnItemLongClickListener of its own ListView . When the onItemClick event is called, an intent for the detail view activity of that item is started, no problems there. When the onItemLongClick event happens, I want to accomplish the following things: Create a CAB Keep the long-pressed item selected Code: @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id

How to select an ListView item after long click?

孤街浪徒 提交于 2019-12-02 19:30:26
I've got a silly little problem. I've registered a ListFragment both as OnItemClickListener and OnItemLongClickListener of its own ListView . When the onItemClick event is called, an intent for the detail view activity of that item is started, no problems there. When the onItemLongClick event happens, I want to accomplish the following things: Create a CAB Keep the long-pressed item selected Code: @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { if(this.cabMode != null) return false; this.cabMode = getActivity().startActionMode