[Catalog][SplitButton] Added an onDismissListener to the popup menu to synchronize menu display and button checked state.

PiperOrigin-RevId: 748755298
This commit is contained in:
kendricku 2025-04-17 18:41:29 +00:00 committed by Naomi Koo
parent 443eaa59c0
commit bb90b2010e

View File

@ -84,6 +84,12 @@ public class SplitButtonDemoFragment extends DemoFragment {
.show();
return true;
});
popup.setOnDismissListener(
popupMenu -> {
MaterialButton button =
(MaterialButton) v.findViewById(R.id.expand_more_or_less_filled_icon_popup);
button.setChecked(false);
});
popup.show();
}