-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels