8.6
liugl
2020-08-06 4cbf791d9d1f5f729c45441ffd0c896235bfdbce
app/src/main/java/com/okgoincar/utils/UtilKt.kt
@@ -229,6 +229,11 @@
}
fun TextView.setDrawableNull() {
    this.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
}
fun TextView.setDrawableBottom(drawableResourseId: Int) {
    val topAct: Drawable = context.resources.getDrawable(drawableResourseId)
    this.setCompoundDrawablesWithIntrinsicBounds(null, null, null, topAct)
@@ -243,7 +248,6 @@
    val topAct: Drawable = context.resources.getDrawable(drawableResourseId)
    this.setCompoundDrawablesWithIntrinsicBounds(null, topAct, null, null)
}
fun TextView.setColor(context: Context, resourse: Int) {
    this.setTextColor(ContextCompat.getColor(context, resourse))
@@ -303,10 +307,12 @@
//    }
//})
fun getNowTimeBlack():Boolean{
    var hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY)
    if (hour < 7 || hour >= 18){
        return true
            return true
    }
    return false
}