Open z3phyro opened 7 years ago
Agree, instead of $AlertDialog.Result I would call it $AlertDialog.Selector, and this selector. The values $AlertDialog.PositivieButtonPressed cannot be used because it is a boolean for the ifs-selectors, but probably an ENUM with similar name can be used.
AlertDialogs in Declex are really easy using
$AlertDialog().message(R.string.rate) .positiveButton(R.string.yes) .negativeButton(R.string.no) .neutralButton(R.string.ask);
and then handling the answer like if ($AlertDialog.PositiveButtonPressed){ // some code here } if ($AlertDialog.NegativeButtonPressed){ // some code here } if ($AlertDialog.NeutralButtonPressed){ // some code here }
but it could be nicer if the answer was handled like this: switch ($AlertDialog.Result){ case $AlertDialog.PositiveButtonPressed: // some code here break; case $AlertDialog.NegativeButtonPressed: // some code here break; case $AlertDialog.NeutralButtonPressed: // some code here break; }