當前位置: 首頁>>代碼示例>>Java>>正文


Java AttachStatusEnum類代碼示例

本文整理匯總了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;
        }
    });
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:26,代碼來源:SessionHelper.java

示例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);
        }
    });
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:19,代碼來源:MessageListPanelEx.java

示例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();
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:20,代碼來源:MsgViewHolderThumbBase.java

示例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);
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:23,代碼來源:MsgViewHolderThumbBase.java

示例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);
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:20,代碼來源:MsgViewHolderAudio.java

示例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();
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:20,代碼來源:MsgViewHolderThumbBase.java

示例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)));
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:19,代碼來源:MsgViewHolderThumbBase.java

示例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);
    }
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:17,代碼來源:MsgViewHolderAudio.java

示例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();
}
 
開發者ID:netease-im,項目名稱:NIM_Android_UIKit,代碼行數:20,代碼來源:MsgViewHolderThumbBase.java

示例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);
    }
}
 
開發者ID:netease-im,項目名稱:NIM_Android_UIKit,代碼行數:20,代碼來源:MsgViewHolderAudio.java

示例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);
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:14,代碼來源:MsgViewHolderSnapChat.java

示例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;
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:28,代碼來源:MsgViewHolderSnapChat.java

示例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;
        }
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:28,代碼來源:MsgViewHolderFile.java

示例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;
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:9,代碼來源:WatchSnapChatPictureActivity.java

示例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();
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:12,代碼來源:WatchSnapChatPictureActivity.java


注:本文中的com.netease.nimlib.sdk.msg.constant.AttachStatusEnum類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。