use of carbon.internal.EditTextMenu in project Carbon by ZieIony.
the class MarshmallowEditText method createMenu.
private void createMenu(Menu menu) {
TypedValue outValue = new TypedValue();
getContext().getTheme().resolveAttribute(R.attr.carbon_editMenuTheme, outValue, true);
int theme = outValue.resourceId;
Context themedContext = new ContextThemeWrapper(getContext(), theme);
popupMenu = new EditTextMenu(themedContext);
popupMenu.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
isShowingPopup = false;
}
});
popupMenu.initCopy(menu.findItem(ID_COPY));
popupMenu.initCut(menu.findItem(ID_CUT));
popupMenu.initPaste(menu.findItem(ID_PASTE));
popupMenu.initSelectAll(menu.findItem(ID_SELECT_ALL));
//menu.clear();
/*try {
mIgnoreActionUpEventField.set(editor, true);
} catch (IllegalAccessException e) {
e.printStackTrace();
}*/
}
Aggregations