摘要:
val Int.dp: Float get()= this.toFloat().dp val Int.dpi: Int get() = this.toFloat().dpi val Float.dp: Float get(){ val displayMetrics: DisplayMetrics = 阅读全文
摘要:
import java.math.RoundingMode import java.text.NumberFormat import java.util.* /** 支持设置舍入模式的类型小数 */ inline fun Any?.formatDecimalRoundingMode( decimal 阅读全文
摘要:
import com.google.gson.Gson import com.google.gson.GsonBuilder import com.google.gson.ToNumberStrategy import com.google.gson.reflect.TypeToken import 阅读全文
摘要:
fun Number?.safeDiv(divisions: Number?, default: Double=0.0): Double { val value = divisions?.toDouble() ?: 0.0 if (value == 0.0) { return default } r 阅读全文
摘要:
import android.view.View import android.view.ViewGroup import android.view.ViewGroup.MarginLayoutParams import android.view.ViewTreeObserver import an 阅读全文
摘要:
` import android.content.Context import android.view.LayoutInflater import androidx.lifecycle.* import androidx.viewbinding.ViewBinding import java.la 阅读全文