本文整理汇总了Java中com.netease.nimlib.sdk.msg.constant.AttachStatusEnum类的典型用法代码示例。如果您正苦于以下问题:Java AttachStatusEnum类的具体用法?Java AttachStatusEnum怎么用?Java AttachStatusEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttachStatusEnum类属于com.netease.nimlib.sdk.msg.constant包,在下文中一共展示了AttachStatusEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerMsgForwardFilter
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
/**
* 消息转发过滤器
*/
private static void registerMsgForwardFilter() {
NimUIKit.setMsgForwardFilter(new MsgForwardFilter() {
@Override
public boolean shouldIgnore(IMMessage message) {
if (message.getDirect() == MsgDirectionEnum.In
&& (message.getAttachStatus() == AttachStatusEnum.transferring
|| message.getAttachStatus() == AttachStatusEnum.fail)) {
// 接收到的消息,附件没有下载成功,不允许转发
return true;
} else if (message.getMsgType() == MsgTypeEnum.custom && message.getAttachment() != null
&& (message.getAttachment() instanceof SnapChatAttachment
|| message.getAttachment() instanceof RTSAttachment
|| message.getAttachment() instanceof RedPacketAttachment)) {
// 白板消息和阅后即焚消息,红包消息 不允许转发
return true;
} else if (message.getMsgType() == MsgTypeEnum.robot && message.getAttachment() != null && ((RobotAttachment) message.getAttachment()).isRobotSend()) {
return true; // 如果是机器人发送的消息 不支持转发
}
return false;
}
});
}
示例2: longClickItemVoidToText
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
private void longClickItemVoidToText(final IMMessage item, CustomAlertDialog alertDialog, MsgTypeEnum msgType) {
if (msgType != MsgTypeEnum.audio) return;
if (item.getDirect() == MsgDirectionEnum.In
&& item.getAttachStatus() != AttachStatusEnum.transferred)
return;
if (item.getDirect() == MsgDirectionEnum.Out
&& item.getAttachStatus() != AttachStatusEnum.transferred)
return;
alertDialog.addItem(container.activity.getString(R.string.voice_to_text), new CustomAlertDialog.onSeparateItemClickListener() {
@Override
public void onClick() {
onVoiceToText(item);
}
});
}
示例3: bindContentView
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void bindContentView() {
FileAttachment msgAttachment = (FileAttachment) message.getAttachment();
String path = msgAttachment.getPath();
String thumbPath = msgAttachment.getThumbPath();
if (!TextUtils.isEmpty(thumbPath)) {
loadThumbnailImage(thumbPath, false);
} else if (!TextUtils.isEmpty(path)) {
loadThumbnailImage(thumbFromSourceFile(path), true);
} else {
loadThumbnailImage(null, false);
if (message.getAttachStatus() == AttachStatusEnum.transferred
|| message.getAttachStatus() == AttachStatusEnum.def) {
downloadAttachment();
}
}
refreshStatus();
}
示例4: refreshStatus
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
private void refreshStatus() {
FileAttachment attachment = (FileAttachment) message.getAttachment();
if (TextUtils.isEmpty(attachment.getPath()) && TextUtils.isEmpty(attachment.getThumbPath())) {
if (message.getAttachStatus() == AttachStatusEnum.fail || message.getStatus() == MsgStatusEnum.fail) {
alertButton.setVisibility(View.VISIBLE);
} else {
alertButton.setVisibility(View.GONE);
}
}
if (message.getStatus() == MsgStatusEnum.sending
|| (isReceivedMessage() && message.getAttachStatus() == AttachStatusEnum.transferring)) {
progressCover.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.VISIBLE);
progressLabel.setVisibility(View.VISIBLE);
progressLabel.setText(StringUtil.getPercentString(getMsgAdapter().getProgress(message)));
} else {
progressCover.setVisibility(View.GONE);
progressBar.setVisibility(View.GONE);
progressLabel.setVisibility(View.GONE);
}
}
示例5: onItemClick
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void onItemClick() {
if (audioControl != null) {
if (message.getDirect() == MsgDirectionEnum.In && message.getAttachStatus() != AttachStatusEnum.transferred) {
return;
}
if (message.getStatus() != MsgStatusEnum.read) {
// 将未读标识去掉,更新数据库
unreadIndicator.setVisibility(View.GONE);
}
initPlayAnim(); // 设置语音播放动画
audioControl.startPlayAudioDelay(CLICK_TO_PLAY_AUDIO_DELAY, message, onPlayListener);
audioControl.setPlayNext(true, adapter, message);
}
}
示例6: bindContentView
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void bindContentView() {
FileAttachment msgAttachment = (FileAttachment) message.getAttachment();
String path = msgAttachment.getPath();
String thumbPath = msgAttachment.getThumbPath();
if (!TextUtils.isEmpty(thumbPath)) {
loadThumbnailImage(thumbPath);
} else if (!TextUtils.isEmpty(path)) {
loadThumbnailImage(thumbFromSourceFile(path));
} else {
loadThumbnailImage(null);
if (message.getAttachStatus() == AttachStatusEnum.transferred
|| message.getAttachStatus() == AttachStatusEnum.def) {
downloadAttachment();
}
}
refreshStatus();
}
示例7: refreshStatus
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
private void refreshStatus() {
FileAttachment attachment = (FileAttachment) message.getAttachment();
if (TextUtils.isEmpty(attachment.getPath()) && TextUtils.isEmpty(attachment.getThumbPath())) {
if (message.getAttachStatus() == AttachStatusEnum.fail || message.getStatus() == MsgStatusEnum.fail) {
alertButton.setVisibility(View.VISIBLE);
} else {
alertButton.setVisibility(View.GONE);
}
}
if (message.getStatus() == MsgStatusEnum.sending || message.getAttachStatus() == AttachStatusEnum.transferring) {
progressCover.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.VISIBLE);
} else {
progressCover.setVisibility(View.GONE);
}
progressLabel.setText(StringUtil.getPercentString(getAdapter().getProgress(message)));
}
示例8: onItemClick
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void onItemClick() {
if (audioControl != null) {
if (message.getDirect() == MsgDirectionEnum.In && message.getAttachStatus() != AttachStatusEnum.transferred) {
return;
}
if (message.getStatus() != MsgStatusEnum.read) {
// 将未读标识去掉,更新数据库
unreadIndicator.setVisibility(View.GONE);
}
audioControl.startPlayAudioDelay(CLICK_TO_PLAY_AUDIO_DELAY, message, onPlayListener);
audioControl.setPlayNext(true, adapter, message);
}
}
示例9: bindContentView
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void bindContentView() {
FileAttachment msgAttachment = (FileAttachment) message.getAttachment();
String path = msgAttachment.getPath();
String thumbPath = msgAttachment.getThumbPath();
if (!TextUtils.isEmpty(thumbPath)) {
loadThumbnailImage(thumbPath, false, msgAttachment.getExtension());
} else if (!TextUtils.isEmpty(path)) {
loadThumbnailImage(thumbFromSourceFile(path), true, msgAttachment.getExtension());
} else {
loadThumbnailImage(null, false, msgAttachment.getExtension());
if (message.getAttachStatus() == AttachStatusEnum.transferred
|| message.getAttachStatus() == AttachStatusEnum.def) {
downloadAttachment();
}
}
refreshStatus();
}
示例10: onItemClick
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void onItemClick() {
if (audioControl != null) {
if (message.getDirect() == MsgDirectionEnum.In && message.getAttachStatus() != AttachStatusEnum.transferred) {
return;
}
if (message.getStatus() != MsgStatusEnum.read) {
// 将未读标识去掉,更新数据库
unreadIndicator.setVisibility(View.GONE);
}
initPlayAnim(); // 设置语音播放动画
audioControl.startPlayAudioDelay(CLICK_TO_PLAY_AUDIO_DELAY, message, onPlayListener);
audioControl.setPlayNext(!NimUIKitImpl.getOptions().disableAutoPlayNextAudio, adapter, message);
}
}
示例11: refreshStatus
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
private void refreshStatus() {
thumbnailImageView.setBackgroundResource(isReceivedMessage() ? R.drawable.message_view_holder_left_snapchat : R.drawable.message_view_holder_right_snapchat);
if (message.getStatus() == MsgStatusEnum.sending || message.getAttachStatus() == AttachStatusEnum.transferring) {
progressCover.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.VISIBLE);
} else {
progressCover.setVisibility(View.GONE);
}
progressLabel.setText(StringUtil.getPercentString(getMsgAdapter().getProgress(message)));
readReceiptTextView.setVisibility(View.GONE);
}
示例12: onTouch
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
v.getParent().requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
v.getParent().requestDisallowInterceptTouchEvent(false);
WatchSnapChatPictureActivity.destroy();
// 删除这条消息,当然你也可以将其标记为已读,同时删除附件内容,然后不让再查看
if (isLongClick && message.getAttachStatus() == AttachStatusEnum.transferred) {
// 物理删除
NIMClient.getService(MsgService.class).deleteChattingHistory(message);
AttachmentStore.delete(((SnapChatAttachment) message.getAttachment()).getPath());
AttachmentStore.delete(((SnapChatAttachment) message.getAttachment()).getThumbPath());
getMsgAdapter().deleteItem(message, true);
isLongClick = false;
}
break;
}
return false;
}
示例13: bindContentView
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
protected void bindContentView() {
msgAttachment = (FileAttachment) message.getAttachment();
String path = msgAttachment.getPath();
initDisplay();
if (!TextUtils.isEmpty(path)) {
loadImageView();
} else {
AttachStatusEnum status = message.getAttachStatus();
switch (status) {
case def:
updateFileStatusLabel();
break;
case transferring:
fileStatusLabel.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
int percent = (int) (getMsgAdapter().getProgress(message) * 100);
progressBar.setProgress(percent);
break;
case transferred:
case fail:
updateFileStatusLabel();
break;
}
}
}
示例14: isOriginImageHasDownloaded
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
private boolean isOriginImageHasDownloaded(final IMMessage message) {
if (message.getAttachStatus() == AttachStatusEnum.transferred &&
!TextUtils.isEmpty(((SnapChatAttachment) message.getAttachment()).getPath())) {
return true;
}
return false;
}
示例15: onEvent
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; //导入依赖的package包/类
@Override
public void onEvent(IMMessage msg) {
if (!msg.isTheSame(message) || isDestroyedCompatible()) {
return;
}
if (msg.getAttachStatus() == AttachStatusEnum.transferred && isOriginImageHasDownloaded(msg)) {
onDownloadSuccess(msg);
} else if (msg.getAttachStatus() == AttachStatusEnum.fail) {
onDownloadFailed();
}
}