完善个人主页相关数据
This commit is contained in:
@ -46,6 +46,7 @@ import com.lightgame.utils.Utils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -96,6 +97,19 @@ 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);
|
||||
}
|
||||
|
||||
@BindingAdapter({"addKaiFuView", "clickListener"})
|
||||
public static void addKaiFuView(LinearLayout view, List<KaiFuCalendarEntity> list, OnViewClickListener listener) {
|
||||
if (list == null) return;
|
||||
|
||||
Reference in New Issue
Block a user