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


Java TLRPC.TL_photoSizeEmpty方法代码示例

本文整理汇总了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();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:58,代码来源:SharedDocumentCell.java


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