You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in order to retrieve the value from the CalcDialog, the owner (an activity or a fragment) needs to implement the CalcDialog.CalcDialogCallback interface.
In the newer versions of the fragment library, the Fragment Result API is available, which I believe is a better way to implement the communication between the dialog and the owner. (Fragment Result API)
It's usage would be something like this:
setFragmentResultListener("calcDialogKey") { requestKey, bundle ->
val enteredValue = bundle.getSerializableExtra("enteredValueKey") as BigDecimal
// Handle the result...
}
Some utility functions could also be created to simplify even more this process, resulting in something like:
setCalculatorResultListener { enteredValue: BigDecimal ->
// Handle the result...
}
If this seems like a good idea, I can work on this feature and open a PR with the changes required.
The text was updated successfully, but these errors were encountered:
Currently, in order to retrieve the value from the
CalcDialog
, the owner (an activity or a fragment) needs to implement theCalcDialog.CalcDialogCallback
interface.In the newer versions of the fragment library, the Fragment Result API is available, which I believe is a better way to implement the communication between the dialog and the owner. (Fragment Result API)
It's usage would be something like this:
Some utility functions could also be created to simplify even more this process, resulting in something like:
If this seems like a good idea, I can work on this feature and open a PR with the changes required.
The text was updated successfully, but these errors were encountered: