修复 画布canvas默认白色改成默认透明
修复 画布canvas会覆盖其他View的问题
This commit is contained in:
13
common/src/main/java/com/stardust/ext/Common.kt
Normal file
13
common/src/main/java/com/stardust/ext/Common.kt
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.stardust.ext
|
||||
|
||||
import kotlin.reflect.KMutableProperty0
|
||||
|
||||
fun <R, T : KMutableProperty0<R?>> T.ifNull(provider: () -> R): R {
|
||||
val value = this.get()
|
||||
if (value != null) {
|
||||
return value
|
||||
}
|
||||
val newValue = provider()
|
||||
set(newValue)
|
||||
return newValue
|
||||
}
|
||||
Reference in New Issue
Block a user