本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例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());
}
}
}
示例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);
}
}