fix
lmw
2024-11-09 d1a9e3312387b6c47e6186af506787a8a66369d1
app/src/main/java/com/sinata/xqmuse/utils/extention/WeparkEx.kt
@@ -38,7 +38,8 @@
                    act.runOnUiThread {
                        act.dismissDialog()
                        callback.onResult(uploadSingle)
                        file.delete()
                        if (file.path != this@uploadWithCompress)
                            file.delete()
                    }
                }).start()
            }
@@ -97,30 +98,4 @@
        })
}
fun String.getStarIcon() = when(this){
    "水瓶座"-> R.mipmap.shuipingzuo
    "金牛座"-> R.mipmap.jinniuzuo
    "白羊座"-> R.mipmap.baiyangzuo
    "双鱼座"-> R.mipmap.double_fish
    "摩羯座"-> R.mipmap.mojiezuo
    "狮子座"-> R.mipmap.shizizuo
    "双子座"-> R.mipmap.twis
    "巨蟹座"-> R.mipmap.juxiezuo
    "处女座"-> R.mipmap.chunvzuo
    "天秤座"-> R.mipmap.tianpingzuo
    "射手座"-> R.mipmap.shooter
    "天蝎座"-> R.mipmap.tianhezuo
    else -> R.mipmap.tianhezuo
}
fun String.getArrowIcon():Int{
    if (isNullOrEmpty())
        return 0
    try {
        if (toDouble() == 0.0)
            return 0
        return if (startsWith("-")) R.mipmap.icondown else R.mipmap.iconup
    }catch (e:Exception){
        return 0
    }
}
fun Double.formatDistance() = if(this>1000) "%.2fkm".format(this/1000) else "%dm".format(this.toInt())