hide material you theme for older versions

This commit is contained in:
sk 2022-12-17 23:22:51 +01:00
parent f7ced7f253
commit 673ea40238
1 changed files with 1 additions and 0 deletions

View File

@ -699,6 +699,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
button=findViewById(R.id.color_picker_button); button=findViewById(R.id.color_picker_button);
popupMenu=new PopupMenu(getActivity(), button, Gravity.CENTER_HORIZONTAL); popupMenu=new PopupMenu(getActivity(), button, Gravity.CENTER_HORIZONTAL);
popupMenu.inflate(R.menu.color_picker); popupMenu.inflate(R.menu.color_picker);
popupMenu.getMenu().findItem(R.id.m3_color).setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S);
popupMenu.setOnMenuItemClickListener(SettingsFragment.this::onColorPreferenceClick); popupMenu.setOnMenuItemClickListener(SettingsFragment.this::onColorPreferenceClick);
button.setOnTouchListener(popupMenu.getDragToOpenListener()); button.setOnTouchListener(popupMenu.getDragToOpenListener());
button.setOnClickListener(v->popupMenu.show()); button.setOnClickListener(v->popupMenu.show());