本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_photoSizeEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_photoSizeEmpty方法的具体用法?Java TLRPC.TL_photoSizeEmpty怎么用?Java TLRPC.TL_photoSizeEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_photoSizeEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDocument
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setDocument(MessageObject messageObject, boolean divider) {
needDivider = divider;
message = messageObject;
loaded = false;
loading = false;
if (messageObject != null && messageObject.getDocument() != null) {
int idx;
String name = null;
if (messageObject.isMusic()) {
TLRPC.Document document;
if (messageObject.type == 0) {
document = messageObject.messageOwner.media.webpage.document;
} else {
document = messageObject.messageOwner.media.document;
}
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeAudio) {
if (attribute.performer != null && attribute.performer.length() != 0 || attribute.title != null && attribute.title.length() != 0) {
name = messageObject.getMusicAuthor() + " - " + messageObject.getMusicTitle();
}
}
}
}
String fileName = FileLoader.getDocumentFileName(messageObject.getDocument());
if (name == null) {
name = fileName;
}
nameTextView.setText(name);
placeholderImabeView.setVisibility(VISIBLE);
extTextView.setVisibility(VISIBLE);
placeholderImabeView.setImageResource(getThumbForNameOrMime(fileName, messageObject.getDocument().mime_type));
extTextView.setText((idx = fileName.lastIndexOf('.')) == -1 ? "" : fileName.substring(idx + 1).toLowerCase());
if (messageObject.getDocument().thumb instanceof TLRPC.TL_photoSizeEmpty || messageObject.getDocument().thumb == null) {
thumbImageView.setVisibility(INVISIBLE);
thumbImageView.setImageBitmap(null);
} else {
thumbImageView.setVisibility(VISIBLE);
thumbImageView.setImage(messageObject.getDocument().thumb.location, "40_40", (Drawable) null);
}
long date = (long) messageObject.messageOwner.date * 1000;
dateTextView.setText(String.format("%s, %s", AndroidUtilities.formatFileSize(messageObject.getDocument().size), LocaleController.formatString("formatDateAtTime", R.string.formatDateAtTime, LocaleController.getInstance().formatterYear.format(new Date(date)), LocaleController.getInstance().formatterDay.format(new Date(date)))));
} else {
nameTextView.setText("");
extTextView.setText("");
dateTextView.setText("");
placeholderImabeView.setVisibility(VISIBLE);
extTextView.setVisibility(VISIBLE);
thumbImageView.setVisibility(INVISIBLE);
thumbImageView.setImageBitmap(null);
}
setWillNotDraw(!needDivider);
progressView.setProgress(0, false);
updateFileExistIcon();
}