本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_messageMediaGame方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_messageMediaGame方法的具体用法?Java TLRPC.TL_messageMediaGame怎么用?Java TLRPC.TL_messageMediaGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_messageMediaGame方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyNewText
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void applyNewText() {
if (TextUtils.isEmpty(messageOwner.message)) {
return;
}
TLRPC.User fromUser = null;
if (isFromUser()) {
fromUser = MessagesController.getInstance().getUser(messageOwner.from_id);
}
messageText = messageOwner.message;
TextPaint paint;
if (messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
paint = gameTextPaint;
} else {
paint = textPaint;
}
messageText = Emoji.replaceEmoji(messageText, paint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
generateLayout(fromUser);
}
示例2: generateLinkDescription
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void generateLinkDescription() {
if (linkDescription != null) {
return;
}
if (messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && messageOwner.media.webpage instanceof TLRPC.TL_webPage && messageOwner.media.webpage.description != null) {
linkDescription = Spannable.Factory.getInstance().newSpannable(messageOwner.media.webpage.description);
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaGame && messageOwner.media.game.description != null) {
linkDescription = Spannable.Factory.getInstance().newSpannable(messageOwner.media.game.description);
}
if (linkDescription != null) {
if (containsUrls(linkDescription)) {
try {
Linkify.addLinks((Spannable) linkDescription, Linkify.WEB_URLS);
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
linkDescription = Emoji.replaceEmoji(linkDescription, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
}
}
示例3: checkLayout
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public boolean checkLayout() {
if (type != 0 || messageOwner.to_id == null || messageText == null || messageText.length() == 0) {
return false;
}
if (layoutCreated) {
int newMinSize = AndroidUtilities.isTablet() ? AndroidUtilities.getMinTabletSide() : AndroidUtilities.displaySize.x;
if (Math.abs(generatedWithMinSize - newMinSize) > AndroidUtilities.dp(52)) {
layoutCreated = false;
}
}
if (!layoutCreated) {
layoutCreated = true;
TLRPC.User fromUser = null;
if (isFromUser()) {
fromUser = MessagesController.getInstance().getUser(messageOwner.from_id);
}
TextPaint paint;
if (messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
paint = gameTextPaint;
} else {
paint = textPaint;
}
messageText = Emoji.replaceEmoji(messageText, paint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
generateLayout(fromUser);
return true;
}
return false;
}
示例4: checkNeedDrawShareButton
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private boolean checkNeedDrawShareButton(MessageObject messageObject) {
if (messageObject.type == 13) {
return false;
} else if (messageObject.messageOwner.fwd_from != null && messageObject.messageOwner.fwd_from.channel_id != 0 && !messageObject.isOut()) {
return true;
} else if (messageObject.isFromUser()) {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty || messageObject.messageOwner.media == null || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage && !(messageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage)) {
return false;
}
TLRPC.User user = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id);
if (user != null && user.bot) {
return true;
}
if (!messageObject.isOut()) {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
return true;
}
if (messageObject.isMegagroup()) {
TLRPC.Chat chat = MessagesController.getInstance().getChat(messageObject.messageOwner.to_id.channel_id);
return chat != null && chat.username != null && chat.username.length() > 0 && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaContact) && !(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo);
}
}
} else if (messageObject.messageOwner.from_id < 0 || messageObject.messageOwner.post) {
if (messageObject.messageOwner.to_id.channel_id != 0 && (messageObject.messageOwner.via_bot_id == 0 && messageObject.messageOwner.reply_to_msg_id == 0 || messageObject.type != 13)) {
return true;
}
}
return false;
}
示例5: generatePinMessageText
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void generatePinMessageText(TLRPC.User fromUser, TLRPC.Chat chat) {
if (fromUser == null && chat == null) {
if (messageOwner.from_id > 0) {
fromUser = MessagesController.getInstance().getUser(messageOwner.from_id);
}
if (fromUser == null) {
chat = MessagesController.getInstance().getChat(messageOwner.to_id.channel_id);
}
}
if (replyMessageObject == null) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedNoText", R.string.ActionPinnedNoText), "un1", fromUser != null ? fromUser : chat);
} else {
if (replyMessageObject.isMusic()) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedMusic", R.string.ActionPinnedMusic), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.isVideo()) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedVideo", R.string.ActionPinnedVideo), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.isGif()) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedGif", R.string.ActionPinnedGif), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.isVoice()) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedVoice", R.string.ActionPinnedVoice), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.isSticker()) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedSticker", R.string.ActionPinnedSticker), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedFile", R.string.ActionPinnedFile), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedGeo", R.string.ActionPinnedGeo), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaContact) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedContact", R.string.ActionPinnedContact), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedPhoto", R.string.ActionPinnedPhoto), "un1", fromUser != null ? fromUser : chat);
} else if (replyMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
messageText = replaceWithLink(LocaleController.formatString("ActionPinnedGame", R.string.ActionPinnedGame, "\uD83C\uDFAE " + replyMessageObject.messageOwner.media.game.title), "un1", fromUser != null ? fromUser : chat);
messageText = Emoji.replaceEmoji(messageText, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
} else if (replyMessageObject.messageText != null && replyMessageObject.messageText.length() > 0) {
CharSequence mess = replyMessageObject.messageText;
if (mess.length() > 20) {
mess = mess.subSequence(0, 20) + "...";
}
mess = Emoji.replaceEmoji(mess, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
messageText = replaceWithLink(LocaleController.formatString("ActionPinnedText", R.string.ActionPinnedText, mess), "un1", fromUser != null ? fromUser : chat);
} else {
messageText = replaceWithLink(LocaleController.getString("ActionPinnedNoText", R.string.ActionPinnedNoText), "un1", fromUser != null ? fromUser : chat);
}
}
}
示例6: setType
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setType() {
int oldType = type;
if (messageOwner instanceof TLRPC.TL_message || messageOwner instanceof TLRPC.TL_messageForwarded_old2) {
if (isMediaEmpty()) {
type = 0;
if (messageText == null || messageText.length() == 0) {
messageText = "Empty message";
}
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) {
type = 1;
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaGeo || messageOwner.media instanceof TLRPC.TL_messageMediaVenue) {
type = 4;
} else if (isVideo()) {
type = 3;
} else if (isVoice()) {
type = 2;
} else if (isMusic()) {
type = 14;
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaContact) {
type = 12;
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaUnsupported) {
type = 0;
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
if (messageOwner.media.document != null && messageOwner.media.document.mime_type != null) {
if (isGifDocument(messageOwner.media.document)) {
type = 8;
} else if (messageOwner.media.document.mime_type.equals("image/webp") && isSticker()) {
type = 13;
} else {
type = 9;
}
} else {
type = 9;
}
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaGame) {
type = 0;
}
} else if (messageOwner instanceof TLRPC.TL_messageService) {
if (messageOwner.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
type = 0;
} else if (messageOwner.action instanceof TLRPC.TL_messageActionChatEditPhoto || messageOwner.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) {
contentType = 1;
type = 11;
} else if (messageOwner.action instanceof TLRPC.TL_messageEncryptedAction) {
if (messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionScreenshotMessages || messageOwner.action.encryptedAction instanceof TLRPC.TL_decryptedMessageActionSetMessageTTL) {
contentType = 1;
type = 10;
} else {
contentType = -1;
type = -1;
}
} else if (messageOwner.action instanceof TLRPC.TL_messageActionHistoryClear) {
contentType = -1;
type = -1;
} else {
contentType = 1;
type = 10;
}
}
if (oldType != 1000 && oldType != type) {
generateThumbs(false);
}
}
示例7: isGameMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isGameMessage(TLRPC.Message message) {
return message.media instanceof TLRPC.TL_messageMediaGame;
}