本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_documentAttributeSticker方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_documentAttributeSticker方法的具体用法?Java TLRPC.TL_documentAttributeSticker怎么用?Java TLRPC.TL_documentAttributeSticker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_documentAttributeSticker方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isStickerDocument
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isStickerDocument(TLRPC.Document document) {
if (document != null) {
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
return true;
}
}
}
return false;
}
示例2: getInputStickerSet
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.InputStickerSet getInputStickerSet(TLRPC.Message message) {
if (message.media != null && message.media.document != null) {
for (TLRPC.DocumentAttribute attribute : message.media.document.attributes) {
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
if (attribute.stickerset instanceof TLRPC.TL_inputStickerSetEmpty) {
return null;
}
return attribute.stickerset;
}
}
}
return null;
}
示例3: getStrickerChar
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public String getStrickerChar() {
if (messageOwner.media != null && messageOwner.media.document != null) {
for (TLRPC.DocumentAttribute attribute : messageOwner.media.document.attributes) {
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
return attribute.alt;
}
}
}
return null;
}
示例4: getStickerEmoji
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public String getStickerEmoji() {
for (int a = 0; a < messageOwner.media.document.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = messageOwner.media.document.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
return attribute.alt != null && attribute.alt.length() > 0 ? attribute.alt : null;
}
}
return null;
}
示例5: getStickerSetId
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static long getStickerSetId(TLRPC.Document document) {
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
if (attribute.stickerset instanceof TLRPC.TL_inputStickerSetID) {
return attribute.stickerset.id;
}
break;
}
}
return -1;
}
示例6: setSticker
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setSticker(TLRPC.Document document, boolean showEmoji) {
if (document != null) {
sticker = document;
if (document.thumb != null) {
imageView.setImage(document.thumb.location, null, "webp", null);
}
if (showEmoji) {
boolean set = false;
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
if (attribute.alt != null && attribute.alt.length() > 0) {
emojiTextView.setText(Emoji.replaceEmoji(attribute.alt, emojiTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(16), false));
set = true;
}
break;
}
}
if (!set) {
emojiTextView.setText(Emoji.replaceEmoji(StickersQuery.getEmojiForSticker(sticker.id), emojiTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(16), false));
}
emojiTextView.setVisibility(VISIBLE);
} else {
emojiTextView.setVisibility(INVISIBLE);
}
}
}
示例7: isMaskDocument
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isMaskDocument(TLRPC.Document document) {
if (document != null) {
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeSticker && attribute.mask) {
return true;
}
}
}
return false;
}
示例8: StickerView
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public StickerView(Context context, Point position, float angle, float scale, Size baseSize, TLRPC.Document sticker) {
super(context, position);
setRotation(angle);
setScale(scale);
this.sticker = sticker;
this.baseSize = baseSize;
for (int a = 0; a < sticker.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = sticker.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
if (attribute.mask_coords != null)
anchor = attribute.mask_coords.n;
break;
}
}
containerView = new FrameLayoutDrawer(context);
addView(containerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
centerImage.setAspectFit(true);
centerImage.setInvalidateAll(true);
centerImage.setParentView(containerView);
centerImage.setImage(sticker, null, sticker.thumb.location, null, "webp", true);
updatePosition();
}