maxkeppeler / sheets

⭐ ‎‎‎‏‏‎ ‎Offers a range of beautiful sheets (dialogs & bottom sheets) for quick use in your project. Includes many ways to customize sheets.
https://maxkeppeler.github.io/sheets/
Apache License 2.0
921 stars 77 forks source link

Multiple Instances with Fragments #11

Closed irvine752 closed 3 years ago

irvine752 commented 3 years ago

For some reason I'm getting multiple instances of the OptionSheet. For instance, if I open up FragmentX & then open up the OptionSheet, the next time I open up another instance FragmentX & open up the OptionSheet again. I will have have to deal with 2 instances of the OptionSheet.

maxkeppeler commented 3 years ago

Where do you show the OptionsSheet within your Fragment?

irvine752 commented 3 years ago

It's getting triggered from a menu selection, and the call happens from onOptionsItemSelected within the fragment. I only have one main activity that replaces fragments in a framelayout container. Each of those fragments can have smaller subcomponents such as tabs & etcs. The particular fragment is a tab through the com.ogaclejapan.smarttablayout.SmartTabLayout library.

maxkeppeler commented 3 years ago

Could you show me your project or a basic sample that has this behavior so that I can debug it? I would check it out right after work this evening.

irvine752 commented 3 years ago

That works for me. Do you have an email so I can send a sample of the code?

maxkeppeler commented 3 years ago

Yes sure - me@maxkeppeler.com

maxkeppeler commented 3 years ago

It was not a bug in the library. onOptionsItemSelected was called multiple times due to returning super.onOptionMenuSelected.