popupmenu

When should I use a ellipsis in a Menu Item

梦想的初衷 提交于 2019-12-01 00:24:16
问题 When should I put ... at the end of a menu item? I seem to remember reading some rules but can't for the life of me find them. For context - I'm adding a properties option to a right click menu and am wondering if it is appropriate to add them. 回答1: One exception to the first two answers: if the whole point of the menu command is to open a window or dialog, then you don't need an ellipsis. For example, a "Get Info" or "Properties" command shouldn't have it, even though it's opening a window

PopupMenu PopupWindow$PopupViewContainer leak

*爱你&永不变心* 提交于 2019-11-30 19:15:11
I have a PopupMenu anchored to a button in the Action Bar, and I'm getting log output about a leaked window. This occurs if my activity is stopped while the PopupMenu is open. I posted a related question here , but I've solved that issue. I've seen some similar questions, like this , but none related to PopupMenu . I'm thinking if I can get a handle on the mentioned PopupWindow$PopupViewContainer then I could remove it from the WindowManager during onPause or something like that, but I don't know how to get at it. The interface exposed by PopupMenu is pretty limited. Has anyone encountered

AppCompat PopUp menu RuntimeException

旧城冷巷雨未停 提交于 2019-11-30 08:46:48
问题 I am using following class to create iconized popup menu: public class IconizedMenu implements MenuBuilder.Callback, MenuPresenter.Callback { private Context mContext; private MenuBuilder mMenu; private View mAnchor; private MenuPopupHelper mPopup; private OnMenuItemClickListener mMenuItemClickListener; private OnDismissListener mDismissListener; /** * Callback interface used to notify the application that the menu has closed. */ public interface OnDismissListener { /** * Called when the

PopupMenu PopupWindow$PopupViewContainer leak

孤街醉人 提交于 2019-11-30 02:47:15
问题 I have a PopupMenu anchored to a button in the Action Bar, and I'm getting log output about a leaked window. This occurs if my activity is stopped while the PopupMenu is open. I posted a related question here, but I've solved that issue. I've seen some similar questions, like this, but none related to PopupMenu . I'm thinking if I can get a handle on the mentioned PopupWindow$PopupViewContainer then I could remove it from the WindowManager during onPause or something like that, but I don't

Hide item from popupmenu

社会主义新天地 提交于 2019-11-29 13:07:47
I created a popup menu. I need to hide a particular item from popup menu on condition, I tried this below code but it doesn't work and shows "unexpectedly your app has been stopped" . I used findViewById and setEnabled(false) . Is there any other way to hide an item from popup menu? Please help with this. @Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub switch(item.getItemId()){ case R.id.addMessage_Action: AddMessage(); break; case R.id.dropMenuAction: menuItemView = findViewById(R.id.dropMenuAction); PopupMenu popup = new PopupMenu(this,

AppCompat PopUp menu RuntimeException

妖精的绣舞 提交于 2019-11-29 07:59:22
I am using following class to create iconized popup menu: public class IconizedMenu implements MenuBuilder.Callback, MenuPresenter.Callback { private Context mContext; private MenuBuilder mMenu; private View mAnchor; private MenuPopupHelper mPopup; private OnMenuItemClickListener mMenuItemClickListener; private OnDismissListener mDismissListener; /** * Callback interface used to notify the application that the menu has closed. */ public interface OnDismissListener { /** * Called when the associated menu has been dismissed. * * @param menu The PopupMenu that was dismissed. */ public void

How to change the text color and size of a pop up menu in android?

﹥>﹥吖頭↗ 提交于 2019-11-29 03:57:25
Text color in pop up menu is not changing even changed in styles. Background color is changing with respect to the color in styles.xml but the text color and text size are not reflecting. //Creating the instance of PopupMenu PopupMenu popup = new PopupMenu(mContext, holder.im_overflow); //Inflating the Popup using xml file popup.getMenuInflater().inflate(R.menu.list_overflow_menu, popup.getMenu()); //registering popup with OnMenuItemClickListener popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { if( item

How to show menu popup exact below actionbar?

北战南征 提交于 2019-11-29 03:27:51
I am working on popup-menu in actionbar. But I am stuck to display exact below of actionbar(cut-to-cut).I am putting two snapshot. My issue screen shot: I want exact popup menu below of actionbar as below screenshot Correction screenshot: My code snippet: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> <item android:id="@+id/action_filter" android:icon="@drawable/ic_filter_white_18dp" android:title="@string/action_filter" app:showAsAction="ifRoom" /

Attempted to finish an input event but input event receiver has already been disposed

天大地大妈咪最大 提交于 2019-11-28 22:54:07
I have a custom adapter for my listview. The adapter contains a textview and a image button. I have implemented a popup menu on clicking the image button. Everything is working fine. But when selecting the options from popup menu, logcat displaying a single line message "Attempted to finish an input event but input event receiver has already been disposed" and nothing is happening. public class MyAdapter extends ArrayAdapter<String> { public MyAdapter(Context context, int resourceId) { super(context, resourceId); } public MyAdapter(Context context, int resourceId, List<String> string) { super

How to create a custom PopupMenu in Android

夙愿已清 提交于 2019-11-28 19:41:28
How can I replicate something like I made below in Balsamiq? I made this menu, but it is only displaying the text of the items (not the icons). Is it possible to display both the title and icon in a PopupMenu? Here is my create_post_menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_photo" android:icon="@drawable/ic_action_camera" android:title="@string/action_photo" android:showAsAction="always|withText" /> <item android:id="@+id/action_video" android:icon="@drawable/ic_action_video" android:title="