默认样式修改
This commit is contained in:
@@ -7,6 +7,7 @@ import android.text.TextUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.utils.language.LangUtils;
|
||||
@@ -50,8 +51,31 @@ public class DateFormatUtil {
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static String getDiffInMilliseconds(String time1, String time2) {
|
||||
return String.valueOf((Long.parseLong(time2) - Long.parseLong(time1)) / (60 * 1000));
|
||||
public static String getDiffInMilliseconds(String time1, String time2, String day, String hour, String minute) {
|
||||
return getTime(Long.parseLong(time1), Long.parseLong(time2), day, hour, minute);
|
||||
}
|
||||
|
||||
|
||||
//根据时间计算出 分钟,小时,天
|
||||
private static String getTime(Long startTime, Long endTime, String day, String hour, String minute) {
|
||||
if (startTime == null || endTime == null || startTime >= endTime) {
|
||||
return "Invalid time range";
|
||||
}
|
||||
|
||||
long diff = endTime - startTime;
|
||||
long days = TimeUnit.MILLISECONDS.toDays(diff);
|
||||
long hours = TimeUnit.MILLISECONDS.toHours(diff) - (days * 24);
|
||||
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff) - (TimeUnit.MILLISECONDS.toHours(diff) * 60);
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (days > 0) {
|
||||
stringBuilder.append(days).append(day).append(" ");
|
||||
} else if (hours > 0) {
|
||||
stringBuilder.append(hours).append(hour).append(" ");
|
||||
} else if (minutes > 0) {
|
||||
stringBuilder.append(minutes).append(minute);
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
6
common/src/main/res/drawable/background_white_5.xml
Normal file
6
common/src/main/res/drawable/background_white_5.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white" />
|
||||
<corners
|
||||
android:radius="5dp"/>
|
||||
</shape>
|
||||
Reference in New Issue
Block a user