admin管理员组文章数量:1531443
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));
}
本文标签: 示例代码方法getnextJavaJava
版权声明:本文标题:java getnext_Java Conversation.getNextCounterpart方法代码示例 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1725456362a1024238.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论