类 EaseUtils
- java.lang.Object
-
- io.agora.chat.uikit.utils.EaseUtils
-
public class EaseUtils extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 EaseUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static booleancanEdit(io.agora.chat.ChatMessage message)Whether the message can be edited.static io.agora.chat.ChatMessagecreateExpressionMessage(java.lang.String toChatUsername, java.lang.String expressioName, java.lang.String identityCode)static floatdip2px(android.content.Context context, float value)dip to pxstatic booleangetBooleanResource(android.content.Context context, int resourceId)Get the boolean settings from resourcestatic EaseChatTypegetChatType(io.agora.chat.Conversation conversation)get chat type by conversation typestatic io.agora.chat.Conversation.ConversationTypegetConversationType(int chatType)change the chat type to EMConversationTypestatic io.agora.chat.Conversation.ConversationTypegetConversationType(EaseChatType chatType)change the chat type to EMConversationTypestatic java.lang.StringgetLetter(java.lang.String name)Get initialsstatic java.lang.StringgetMessageDigest(io.agora.chat.ChatMessage message, android.content.Context context)Get digest according message type and contentstatic float[]getScreenInfo(android.content.Context context)Get basic information of the screenstatic java.lang.StringgetTopActivity(android.content.Context context)get top contextstatic java.lang.StringhandleBigNum(android.content.Context context, int count)Used to handle message unreadstatic booleanhasHoneycomb()static booleanisAdmin(io.agora.chat.Group group)Whether is chatRoom ownerstatic booleanisGroupOwnerOrAdmin(io.agora.chat.ChatMessage message)static booleanisNetWorkConnected(android.content.Context context)check if network avalablestatic booleanisOwner(io.agora.chat.Group group)static booleanisSdcardExist()check if sdcard existstatic booleanisSender(io.agora.chat.ChatMessage message)static booleanisSilentMessage(io.agora.chat.ChatMessage message)\~chinese Determine whether it is a do not disturb message, if it is in the app, it should not prompt the user for a new messagestatic booleanisTimestamp(java.lang.String time)Determine whether it is a timestampstatic voidsetUserInitialLetter(EaseUser user)set initial letter of according user's nickname( username if no nickname)static floatsp2px(android.content.Context context, float value)sp to px
-
-
-
方法详细资料
-
isNetWorkConnected
public static boolean isNetWorkConnected(android.content.Context context)
check if network avalable- 参数:
context-- 返回:
-
isSdcardExist
public static boolean isSdcardExist()
check if sdcard exist- 返回:
-
createExpressionMessage
public static io.agora.chat.ChatMessage createExpressionMessage(java.lang.String toChatUsername, java.lang.String expressioName, java.lang.String identityCode)
-
getMessageDigest
public static java.lang.String getMessageDigest(io.agora.chat.ChatMessage message, android.content.Context context)Get digest according message type and content- 参数:
message-context-- 返回:
-
getTopActivity
public static java.lang.String getTopActivity(android.content.Context context)
get top context- 参数:
context-- 返回:
-
setUserInitialLetter
public static void setUserInitialLetter(EaseUser user)
set initial letter of according user's nickname( username if no nickname)- 参数:
user-
-
getConversationType
public static io.agora.chat.Conversation.ConversationType getConversationType(int chatType)
change the chat type to EMConversationType- 参数:
chatType-- 返回:
-
getConversationType
public static io.agora.chat.Conversation.ConversationType getConversationType(EaseChatType chatType)
change the chat type to EMConversationType- 参数:
chatType-- 返回:
-
getChatType
public static EaseChatType getChatType(io.agora.chat.Conversation conversation)
get chat type by conversation type- 参数:
conversation-- 返回:
-
isSilentMessage
public static boolean isSilentMessage(io.agora.chat.ChatMessage message)
\~chinese Determine whether it is a do not disturb message, if it is in the app, it should not prompt the user for a new message- 参数:
message- return \~english check if the message is kind of slient message, if that's it, app should not play tone or vibratemessage-- 返回:
-
getScreenInfo
public static float[] getScreenInfo(android.content.Context context)
Get basic information of the screen- 参数:
context-- 返回:
-
dip2px
public static float dip2px(android.content.Context context, float value)dip to px- 参数:
context-value-- 返回:
-
sp2px
public static float sp2px(android.content.Context context, float value)sp to px- 参数:
context-value-- 返回:
-
isTimestamp
public static boolean isTimestamp(java.lang.String time)
Determine whether it is a timestamp- 参数:
time-- 返回:
-
getLetter
public static java.lang.String getLetter(java.lang.String name)
Get initials- 参数:
name-- 返回:
-
getBooleanResource
public static boolean getBooleanResource(android.content.Context context, @BoolRes int resourceId)Get the boolean settings from resource- 参数:
context-resourceId-- 返回:
-
hasHoneycomb
public static boolean hasHoneycomb()
-
handleBigNum
public static java.lang.String handleBigNum(android.content.Context context, int count)Used to handle message unread- 参数:
context-count-- 返回:
-
canEdit
public static boolean canEdit(io.agora.chat.ChatMessage message)
Whether the message can be edited.- 参数:
message-- 返回:
-
isGroupOwnerOrAdmin
public static boolean isGroupOwnerOrAdmin(io.agora.chat.ChatMessage message)
-
isSender
public static boolean isSender(io.agora.chat.ChatMessage message)
-
isOwner
public static boolean isOwner(io.agora.chat.Group group)
-
isAdmin
public static boolean isAdmin(io.agora.chat.Group group)
Whether is chatRoom owner- 返回:
-
-