I'm trying to customize the settings menu or create something with that functionality. I currently have a Toolbar with the title and a Settings button (with custom icon). This button opens a PopupMenu this way:
btnOpenMenu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
PopupMenu popupMenu = new PopupMenu(HomeActivity.this, view){
@Override
public void setOnMenuItemClickListener(@Nullable OnMenuItemClickListener listener) {
super.setOnMenuItemClickListener(listener);
}
};
popupMenu.inflate(R.menu.menu);
popupMenu.show();
}
});
The popup menu is working but I need now to customize the view, at least to make it full width and center the text, as shown in the image:
Is it possible to do this with a popup menu? how can I extend the width of the menu and make it full width?
Thanks in advance.