当前位置: 首页>>代码示例>>Java>>正文


Java ChatMessageCell.getMessageObject方法代码示例

本文整理汇总了Java中org.telegram.ui.Cells.ChatMessageCell.getMessageObject方法的典型用法代码示例。如果您正苦于以下问题:Java ChatMessageCell.getMessageObject方法的具体用法?Java ChatMessageCell.getMessageObject怎么用?Java ChatMessageCell.getMessageObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.ui.Cells.ChatMessageCell的用法示例。


在下文中一共展示了ChatMessageCell.getMessageObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateInformationForScreenshotDetector

import org.telegram.ui.Cells.ChatMessageCell; //导入方法依赖的package包/类
public void updateInformationForScreenshotDetector() {
    if (currentEncryptedChat == null) {
        return;
    }
    ArrayList<Long> visibleMessages = new ArrayList<>();
    if (chatListView != null) {
        int count = chatListView.getChildCount();
        for (int a = 0; a < count; a++) {
            View view = chatListView.getChildAt(a);
            MessageObject object = null;
            if (view instanceof ChatMessageCell) {
                ChatMessageCell cell = (ChatMessageCell) view;
                object = cell.getMessageObject();
            }
            if (object != null && object.getId() < 0 && object.messageOwner.random_id != 0) {
                visibleMessages.add(object.messageOwner.random_id);
            }
        }
    }
    MediaController.getInstance().setLastEncryptedChatParams(chatEnterTime, chatLeaveTime, currentEncryptedChat, visibleMessages);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:ChatActivity.java

示例2: updateInformationForScreenshotDetector

import org.telegram.ui.Cells.ChatMessageCell; //导入方法依赖的package包/类
private void updateInformationForScreenshotDetector() {
    if (currentEncryptedChat == null) {
        return;
    }
    ArrayList<Long> visibleMessages = new ArrayList<>();
    if (chatListView != null) {
        int count = chatListView.getChildCount();
        for (int a = 0; a < count; a++) {
            View view = chatListView.getChildAt(a);
            MessageObject object = null;
            if (view instanceof ChatMessageCell) {
                ChatMessageCell cell = (ChatMessageCell) view;
                object = cell.getMessageObject();
            }
            if (object != null && object.getId() < 0 && object.messageOwner.random_id != 0) {
                visibleMessages.add(object.messageOwner.random_id);
            }
        }
    }
    MediaController.getInstance().setLastEncryptedChatParams(chatEnterTime, chatLeaveTime, currentEncryptedChat, visibleMessages);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:22,代码来源:ChatActivity.java

示例3: onViewAttachedToWindow

import org.telegram.ui.Cells.ChatMessageCell; //导入方法依赖的package包/类
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    if (holder.itemView instanceof ChatMessageCell) {
        final ChatMessageCell messageCell = (ChatMessageCell) holder.itemView;
        MessageObject message = messageCell.getMessageObject();

        boolean selected = false;
        boolean disableSelection = false;
        messageCell.setBackgroundDrawable(null);
        messageCell.setCheckPressed(!disableSelection, disableSelection && selected);

        messageCell.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                messageCell.getViewTreeObserver().removeOnPreDrawListener(this);

                int height = chatListView.getMeasuredHeight();
                int top = messageCell.getTop();
                int bottom = messageCell.getBottom();
                int viewTop = top >= 0 ? 0 : -top;
                int viewBottom = messageCell.getMeasuredHeight();
                if (viewBottom > height) {
                    viewBottom = viewTop + height;
                }
                messageCell.setVisiblePart(viewTop, viewBottom - viewTop);

                return true;
            }
        });
        messageCell.setHighlighted(false);
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:33,代码来源:ChannelAdminLogActivity.java

示例4: updateInformationForScreenshotDetector

import org.telegram.ui.Cells.ChatMessageCell; //导入方法依赖的package包/类
private void updateInformationForScreenshotDetector() {
    if (currentUser == null) {
        return;
    }
    ArrayList<Long> visibleMessages;
    int messageId = 0;
    if (currentEncryptedChat != null) {
        visibleMessages = new ArrayList<>();
        if (chatListView != null) {
            int count = chatListView.getChildCount();
            for (int a = 0; a < count; a++) {
                View view = chatListView.getChildAt(a);
                MessageObject object = null;
                if (view instanceof ChatMessageCell) {
                    ChatMessageCell cell = (ChatMessageCell) view;
                    object = cell.getMessageObject();
                }
                if (object != null && object.getId() < 0 && object.messageOwner.random_id != 0) {
                    visibleMessages.add(object.messageOwner.random_id);
                }
            }
        }
        MediaController.getInstance().setLastVisibleMessageIds(chatEnterTime, chatLeaveTime, currentUser, currentEncryptedChat, visibleMessages, messageId);
    } else {
        SecretMediaViewer viewer = SecretMediaViewer.getInstance();
        MessageObject messageObject = viewer.getCurrentMessageObject();
        if (messageObject != null && !messageObject.isOut()) {
            MediaController.getInstance().setLastVisibleMessageIds(viewer.getOpenTime(), viewer.getCloseTime(), currentUser, null, null, messageObject.getId());
        }
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:32,代码来源:ChatActivity.java

示例5: onViewAttachedToWindow

import org.telegram.ui.Cells.ChatMessageCell; //导入方法依赖的package包/类
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    if (holder.itemView instanceof ChatMessageCell) {
        final ChatMessageCell messageCell = (ChatMessageCell) holder.itemView;
        MessageObject message = messageCell.getMessageObject();

        boolean selected = false;
        boolean disableSelection = false;
        if (actionBar.isActionModeShowed()) {
            MessageObject messageObject = chatActivityEnterView != null ? chatActivityEnterView.getEditingMessageObject() : null;
            int idx = message.getDialogId() == dialog_id ? 0 : 1;
            if (messageObject == message || selectedMessagesIds[idx].containsKey(message.getId())) {
                setCellSelectionBackground(message, messageCell, idx);
                selected = true;
            } else {
                messageCell.setBackgroundDrawable(null);
            }
            disableSelection = true;
        } else {
            messageCell.setBackgroundDrawable(null);
        }
        messageCell.setCheckPressed(!disableSelection, disableSelection && selected);

        messageCell.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                messageCell.getViewTreeObserver().removeOnPreDrawListener(this);

                int height = chatListView.getMeasuredHeight();
                int top = messageCell.getTop();
                int bottom = messageCell.getBottom();
                int viewTop = top >= 0 ? 0 : -top;
                int viewBottom = messageCell.getMeasuredHeight();
                if (viewBottom > height) {
                    viewBottom = viewTop + height;
                }
                messageCell.setVisiblePart(viewTop, viewBottom - viewTop);

                return true;
            }
        });
        messageCell.setHighlighted(highlightMessageId != Integer.MAX_VALUE && messageCell.getMessageObject().getId() == highlightMessageId);
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:45,代码来源:ChatActivity.java


注:本文中的org.telegram.ui.Cells.ChatMessageCell.getMessageObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。