Tabnine Logo
AVIMTypedMessage.getMessageType
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessageType
method
in
com.avos.avoscloud.im.v2.AVIMTypedMessage

Best Java code snippets using com.avos.avoscloud.im.v2.AVIMTypedMessage.getMessageType (Showing top 3 results out of 315)

origin: BaaSBeginner/leanchat-android

 /**
  * 判断是什么消息类型
  */

 @Override
 public int getItemViewType(int position) {
  AVIMMessage message = messageList.get(position);
  if (null != message && message instanceof AVIMTypedMessage) {
   AVIMTypedMessage typedMessage = (AVIMTypedMessage) message;
   boolean isMe = fromMe(typedMessage);
   if (typedMessage.getMessageType() == LCIMRedPacketMessage.RED_PACKET_MESSAGE_TYPE) {
    return isMe ? ITEM_RIGHT_TEXT_RED_PACKET : ITEM_LEFT_TEXT_RED_PACKET;
   } else if (typedMessage.getMessageType() == LCIMRedPacketAckMessage.RED_PACKET_ACK_MESSAGE_TYPE) {
//        return RedPacketUtils.getInstance().receiveRedPacketAckMsg((LCIMRedPacketAckMessage) typedMessage,ITEM_TEXT_RED_PACKET_NOTIFY,ITEM_TEXT_RED_PACKET_NOTIFY_MEMBER);
   } else if (typedMessage.getMessageType() == LCIMTransferMessage.TRANSFER_MESSAGE_TYPE) {
    return isMe ? ITEM_RIGHT_TEXT_TRANSFER : ITEM_LEFT_TEXT_TRANSFER;
   }
  }
  return super.getItemViewType(position);
 }
}
origin: cn.leancloud.android/avoscloud-push

@Override
public final String getContent() {
 JSONObject json = new JSONObject();
 json.put("_lctype", this.getMessageType());
 if (!fieldCache.contains(this.getClass())) {
  computeFieldAttribute(this.getClass());
 }
 Map<String, FieldAttribute> classFieldAttributesMap = fieldCache.get(this.getClass());
 for (FieldAttribute fieldAttribute : classFieldAttributesMap.values()) {
  Object fieldValue = fieldAttribute.get(this);
  json.put(fieldAttribute.getAliaName(), fieldValue);
 }
 return json.toJSONString();
}
origin: WuXiaolong/WoChat

@Override
public int getItemViewType(int position) {
  AVIMMessage message = messageList.get(position);
  if (null != message && message instanceof AVIMTypedMessage) {
    AVIMTypedMessage typedMessage = (AVIMTypedMessage) message;
    boolean isMe = message.getFrom().equals(AVImClientManager.getInstance().getClientId());
    if (typedMessage.getMessageType() == AVIMReservedMessageType.TextMessageType.getType()) {
      return isMe ? ITEM_RIGHT_TEXT : ITEM_LEFT_TEXT;
    } else {
      return isMe ? ITEM_RIGHT : ITEM_LEFT;
    }
  }
  return 8888;
}
com.avos.avoscloud.im.v2AVIMTypedMessagegetMessageType

Popular methods of AVIMTypedMessage

  • getFrom
  • computeFieldAttribute
  • getField
  • getMessage
  • initMessageType
  • parseMessage
    从 conversation 数据中解析 lastMessage

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now