修复 画布canvas默认白色改成默认透明

修复 画布canvas会覆盖其他View的问题
This commit is contained in:
hyb1996
2019-01-14 23:39:47 +08:00
parent a0e9dbcc2e
commit 863af6badf
5 changed files with 192 additions and 189 deletions

View 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
}