| | |
| | | act.runOnUiThread { |
| | | act.dismissDialog() |
| | | callback.onResult(uploadSingle) |
| | | file.delete() |
| | | if (file.path != this@uploadWithCompress) |
| | | file.delete() |
| | | } |
| | | }).start() |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | 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()) |