Package ai.nexconn.chatui.utils.text
Class ChatUIDateUtils
-
- All Implemented Interfaces:
public class ChatUIDateUtils
-
-
Constructor Summary
Constructors Constructor Description ChatUIDateUtils()
-
Method Summary
Modifier and Type Method Description static intjudgeDate(Context context, Date date)static booleanisTime24Hour(Context context)static StringgetConversationListFormatDate(long dateMillis, Context context)static StringgetConversationFormatDate(long dateMillis, Context context)static booleanisShowChatTime(Context context, long currentTime, long preTime, int interval)static voidpreloadDateFormats(Context context)Preloads commonly used date formatters to avoid ANR caused by first-time creation on the main thread. static StringformatDate(Context context, Date date, String fromat)-
-
Method Detail
-
judgeDate
static int judgeDate(Context context, Date date)
-
isTime24Hour
static boolean isTime24Hour(Context context)
-
getConversationListFormatDate
static String getConversationListFormatDate(long dateMillis, Context context)
-
getConversationFormatDate
static String getConversationFormatDate(long dateMillis, Context context)
-
isShowChatTime
static boolean isShowChatTime(Context context, long currentTime, long preTime, int interval)
- Parameters:
currentTime- current timepreTime- a previous timeinterval- time interval- Returns:
true if the gap is greater than interval seconds, false otherwise
-
preloadDateFormats
static void preloadDateFormats(Context context)
Preloads commonly used date formatters to avoid ANR caused by first-time creation on the main thread. Recommended to be called during initialization. Supports multiple invocations; only the first preload is actually executed.
- Parameters:
context- Context
-
formatDate
static String formatDate(Context context, Date date, String fromat)
-
-
-
-