修改okhttp超时时间,.如果数值超过10000-19999的全部统一显示为1.0W-1.9W

This commit is contained in:
kehaoyuan
2018-08-30 20:16:24 +08:00
parent 3976646f39
commit b7bea01eb1
20 changed files with 94 additions and 61 deletions

View File

@ -26,6 +26,7 @@ import com.gh.common.util.ImageUtils;
import com.gh.common.util.KaiFuUtils;
import com.gh.common.util.NetworkUtils;
import com.gh.common.util.NewsUtils;
import com.gh.common.util.NumberUtils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.StringUtils;
import com.gh.common.view.DownloadDialog;
@ -47,7 +48,7 @@ import com.lightgame.utils.Utils;
import org.greenrobot.eventbus.EventBus;
import java.text.DecimalFormat;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Locale;
@ -107,14 +108,7 @@ public class BindingAdapters {
// 如果超过10000则转换为1.0W
@BindingAdapter("transSimpleCount")
public static void transSimpleCount(TextView view, int count) {
String s;
if (count > 10000) {
DecimalFormat df = new DecimalFormat("#.0W");
s = df.format(count / 10000f);
} else {
s = String.valueOf(count);
}
view.setText(s);
view.setText(NumberUtils.transSimpleCount(count));
}
@BindingAdapter({"addKaiFuView", "clickListener"})