类 EaseUtils


  • public class EaseUtils
    extends java.lang.Object
    • 构造器概要

      构造器 
      构造器 说明
      EaseUtils()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static boolean canEdit​(io.agora.chat.ChatMessage message)
      Whether the message can be edited.
      static io.agora.chat.ChatMessage createExpressionMessage​(java.lang.String toChatUsername, java.lang.String expressioName, java.lang.String identityCode)  
      static float dip2px​(android.content.Context context, float value)
      dip to px
      static boolean getBooleanResource​(android.content.Context context, int resourceId)
      Get the boolean settings from resource
      static EaseChatType getChatType​(io.agora.chat.Conversation conversation)
      get chat type by conversation type
      static io.agora.chat.Conversation.ConversationType getConversationType​(int chatType)
      change the chat type to EMConversationType
      static io.agora.chat.Conversation.ConversationType getConversationType​(EaseChatType chatType)
      change the chat type to EMConversationType
      static java.lang.String getLetter​(java.lang.String name)
      Get initials
      static java.lang.String getMessageDigest​(io.agora.chat.ChatMessage message, android.content.Context context)
      Get digest according message type and content
      static float[] getScreenInfo​(android.content.Context context)
      Get basic information of the screen
      static java.lang.String getTopActivity​(android.content.Context context)
      get top context
      static java.lang.String handleBigNum​(android.content.Context context, int count)
      Used to handle message unread
      static boolean hasHoneycomb()  
      static boolean isAdmin​(io.agora.chat.Group group)
      Whether is chatRoom owner
      static boolean isGroupOwnerOrAdmin​(io.agora.chat.ChatMessage message)  
      static boolean isNetWorkConnected​(android.content.Context context)
      check if network avalable
      static boolean isOwner​(io.agora.chat.Group group)  
      static boolean isSdcardExist()
      check if sdcard exist
      static boolean isSender​(io.agora.chat.ChatMessage message)  
      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
      static boolean isTimestamp​(java.lang.String time)
      Determine whether it is a timestamp
      static void setUserInitialLetter​(EaseUser user)
      set initial letter of according user's nickname( username if no nickname)
      static float sp2px​(android.content.Context context, float value)
      sp to px
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • EaseUtils

        public EaseUtils()
    • 方法详细资料

      • 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 vibrate
        message -
        返回:
      • 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
        返回: