-
Notifications
You must be signed in to change notification settings - Fork 15
Milestone
Description
Description
Instead of generating a custom
singleton pattern for every icon, we could use the built-in
lazy functionality.
For example:
val ArrowLeft: ImageVector
get() {
if (_ArrowLeft != null) {
return _ArrowLeft!!
}
_ArrowLeft = ImageVector.Builder(....).build()
return _ArrowLeft!!
}
private var _ArrowLeft: ImageVector? = null
becomes
val ArrowLeft: ImageVector by lazy {
ImageVector.Builder(....).build()
}
A minor thing to be sure but it does:
- Reduce indentation by one level
- Make the singleton pattern clearer
- Reduce the lines of code by
8 / per file
which across something like300
icons becomes significant
P.S. Love the plugin!
egorikftp
Metadata
Metadata
Assignees
Labels
No labels