contextual-action-bar

RecyclerView: how to start Contextual Action Bar CAB with a Checkbox?

夙愿已清 提交于 2019-12-02 16:38:30
问题 I have a RecyclerView list of CardViews and am using AppCompatActivity. Each CardView has a checkbox. When I click on the checkbox I would like to start a Contextual Action Bar. I would like to use an OnCheckedChangeListener and am having no luck. The checkmark correctly becomes visible when the "chkSelected" Checkbox is clicked on and it becomes invisible when the "chkSelected is clicked on again. What am I missing here? public class MyRecylerAdapter extends RecyclerView.Adapter<RecyclerView

RecyclerView: how to start Contextual Action Bar CAB with a Checkbox?

梦想与她 提交于 2019-12-02 13:29:13
I have a RecyclerView list of CardViews and am using AppCompatActivity. Each CardView has a checkbox. When I click on the checkbox I would like to start a Contextual Action Bar. I would like to use an OnCheckedChangeListener and am having no luck. The checkmark correctly becomes visible when the "chkSelected" Checkbox is clicked on and it becomes invisible when the "chkSelected is clicked on again. What am I missing here? public class MyRecylerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { ... private static ActionMode.Callback actionModeCallback = new ActionMode.Callback() {

Activate CAB menu when OnClickEvent happens in Android

耗尽温柔 提交于 2019-12-01 06:52:16
Trying to activate CAB menu when clicking on MenuItem from ActionBar. Here is how I set the GridView for listening to Multi Choice. The multiModeChoiceListener is working fine when I long press on Any item in the GridView. It is working fine. Now I have a requirement to activate the CAB menu when do press on a menu item in Action Bar. Once it is pressed, the CAB menu should read that 0 items are selected. After that it should allow me to select items from GridView on single clicks. How can I achieve this feature? GridView set listener: gv.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL); gv

Hiding contexual action bar while navigation drawer is open

强颜欢笑 提交于 2019-11-30 18:43:14
The question is similar to this except for the fact that instead of using a View Pager (VP) I want to use a Navigation Drawer (ND). I have a list of elements that activates a Contextual Action Bar (CAB) when one/several items are selected through long press actions. When the ND is opened I want to hide temporarily the CAB and show the basic action bar, while when it is closed to show again the CAB with the selected items. The feature is specified in the ND official documentation "Hide contextual action bars while the drawer is visible.". So far I couldn't find anywhere how to make it in a nice

OnItemLongClickListener is not working in a custom listview

…衆ロ難τιáo~ 提交于 2019-11-30 18:41:56
I want context menu to appear after long clicking an item in a custom list view. I am using the ActionBarSherlock . Trying to debug using Toast notifications I have discovered that Long click event is not fired. How to resolve this issue ? m_vwJokeLayout=(ListView)findViewById(R.id.jokeListViewGroup); m_vwJokeLayout.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method stub if(m_vwActionMode!=null) { Toast.makeText(getApplicationContext(), "Inside

Change Status Bar color when entering Contextual Action Mode

久未见 提交于 2019-11-30 04:51:51
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 don't see any theme attribute that would work here. private int statusBarColor; @Override public

OnItemLongClickListener is not working in a custom listview

扶醉桌前 提交于 2019-11-30 02:56:44
问题 I want context menu to appear after long clicking an item in a custom list view. I am using the ActionBarSherlock. Trying to debug using Toast notifications I have discovered that Long click event is not fired. How to resolve this issue ? m_vwJokeLayout=(ListView)findViewById(R.id.jokeListViewGroup); m_vwJokeLayout.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { // TODO

Contextual Action Bar in Honeycomb

﹥>﹥吖頭↗ 提交于 2019-11-30 02:46:10
问题 I'm looking to copy the action bar implementation from the gmail app in Honeycomb Unfortunately I can't post an image because I'm new here. Basically, when you select an email or more your action bar animates into a different action bar with: 1.Contextual buttons 2.A new "Done" button appears over the Home icon. Does anyone have any idea how to do this? 回答1: Call the startActionMode method available on any View or your Activity. This method accepts an ActionMode.Callback object that will

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

我的梦境 提交于 2019-11-30 00:04:26
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 instead of overlaying it; it seems that the CAB will only overlay the true ActionBar by default. As show

Android expanded SearchView makes other ActionBar items disappear

大憨熊 提交于 2019-11-29 11:17:02
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="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=