java getnext_Java Conversation.getNextCounterpart方法代码示例

编程知识 更新时间:2023-05-02 21:07:00

import eu.siacs.conversations.entities.Conversation; //导入方法依赖的package包/类

public void updateSendButton() {

final Conversation c = this.conversation;

final SendButtonAction action;

final int status;

final boolean empty = this.mEditMessage == null || this.mEditMessage.getText().length() == 0;

final boolean conference = c.getMode() == Conversation.MODE_MULTI;

if (conference && !c.getAccount().httpUploadAvailable()) {

if (empty && c.getNextCounterpart() != null) {

action = SendButtonAction.CANCEL;

} else {

action = SendButtonAction.TEXT;

}

} else {

if (empty) {

if (conference && c.getNextCounterpart() != null) {

action = SendButtonAction.CANCEL;

} else {

String setting = activity.getPreferences().getString("quick_action", "recent");

if (!setting.equals("none") && UIHelper.receivedLocationQuestion(conversation.getLatestMessage())) {

setting = "location";

} else if (setting.equals("recent")) {

setting = activity.getPreferences().getString("recently_used_quick_action", "text");

}

switch (setting) {

case "photo":

action = SendButtonAction.TAKE_PHOTO;

break;

case "location":

action = SendButtonAction.SEND_LOCATION;

break;

case "voice":

action = SendButtonAction.RECORD_VOICE;

break;

case "picture":

action = SendButtonAction.CHOOSE_PICTURE;

break;

default:

action = SendButtonAction.TEXT;

break;

}

}

} else {

action = SendButtonAction.TEXT;

}

}

if (activity.useSendButtonToIndicateStatus() && c != null

&& c.getAccount().getStatus() == Account.State.ONLINE) {

if (c.getMode() == Conversation.MODE_SINGLE) {

status = c.getContact().getMostAvailableStatus();

} else {

status = c.getMucOptions().online() ? Presences.ONLINE : Presences.OFFLINE;

}

} else {

status = Presences.OFFLINE;

}

this.mSendButton.setTag(action);

this.mSendButton.setImageResource(getSendButtonImageResource(action, status));

}

更多推荐

java getnext_Java Conversation.getNextCounterpart方法代码示例

本文发布于:2023-04-28 16:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/af3f34a656f1453548fe254f6c19b9c7.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:示例   代码   方法   getnext_Java   java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 109072文章数
  • 27697阅读数
  • 0评论数