Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

allow alerts to be cancelable #405

Merged
merged 3 commits into from
Nov 15, 2017
Merged

allow alerts to be cancelable #405

merged 3 commits into from
Nov 15, 2017

Conversation

deva666
Copy link
Contributor

@deva666 deva666 commented Jun 9, 2017

as requested #397

@@ -74,6 +74,8 @@ interface AlertBuilder<out D : DialogInterface> {
fun items(items: List<CharSequence>, onItemSelected: (dialog: DialogInterface, index: Int) -> Unit)
fun <T> items(items: List<T>, onItemSelected: (dialog: DialogInterface, item: T, index: Int) -> Unit)

fun isCancelable(canCancel: Boolean)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would make more sense as a property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, makes more sense. Done.

Copy link

@ch4vi ch4vi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that you could add cancelable as a property.
The cancelable parameter on the interface would look like:

var cancellable: Boolean
        @Deprecated(AnkoInternals.NO_GETTER, level = DeprecationLevel.ERROR) get

and the implementation

override var cancellable : Boolean
        @Deprecated(AnkoInternals.NO_GETTER, level = DeprecationLevel.ERROR) get() = AnkoInternals.noGetter()
        set(value) {
            builder.setCancelable(value)
        }

@4u7 4u7 merged commit 2c7c805 into Kotlin:master Nov 15, 2017
@4u7
Copy link
Contributor

4u7 commented Nov 15, 2017

Thanks for the contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants