-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Alert builder system #53
Changes from 1 commit
5cf9d45
bff29a9
8fe2f73
afe040d
4ec7084
10df591
10b8071
9836d77
1530979
88e4c8c
15a3109
9689a53
977ba0e
0f78c8b
97c3a32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,6 @@ Copyright 2019 Splendo Consulting B.V. The Netherlands | |
|
||
*/ | ||
|
||
inline fun <T> T.applyIf(condition: Boolean, block: T.() -> Unit): T = apply { | ||
if (condition) block(this) | ||
} | ||
|
||
actual class AlertBuilder(private val context: Context) : BaseAlertBuilder() { | ||
override fun create() = AlertInterface(createAlert(), context) | ||
} | ||
|
@@ -33,6 +29,10 @@ actual class AlertInterface( | |
private val context: Context | ||
) : BaseAlertPresenter(alert) { | ||
|
||
private inline fun <T> T.applyIf(condition: Boolean, block: T.() -> Unit): T = apply { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would also only have this ones if we put it in a good spot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I put it in Components, then Alerts has to bring all dependencies which we have in Components. So it's better to make for example Utils component in dependency free stuff? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to fulfil all dependencies but end up with circular one. I'd like to leave it here for now, so Alerts will be released and puck up #16 as next one |
||
if (condition) block(this) | ||
} | ||
|
||
private var alertDialog: AlertDialog? = null | ||
|
||
private companion object { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍