From 2eb712cec24c7c6bb8c64dd332aa625efd8b7abe Mon Sep 17 00:00:00 2001
From: liugl <liugl@sinata.cn>
Date: 星期二, 21 七月 2020 11:56:17 +0800
Subject: [PATCH] first commit

---
 app/src/main/java/com/okgoincar/utils/UtilKt.kt |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/src/main/java/com/okgoincar/utils/UtilKt.kt b/app/src/main/java/com/okgoincar/utils/UtilKt.kt
index 7defe80..e42e00d 100644
--- a/app/src/main/java/com/okgoincar/utils/UtilKt.kt
+++ b/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))
@@ -305,8 +309,8 @@
 
 fun getNowTimeBlack():Boolean{
     var hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY)
-//    if (hour < 7 || hour >= 18){
-        if (hour < 7 || hour >= 12){
+    if (hour < 7 || hour >= 18){
+//        if (hour < 7 || hour >= 12){
             return true
     }
     return false

--
Gitblit v1.7.1