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


Java TLRPC.FileLocation方法代码示例

本文整理汇总了Java中org.telegram.tgnet.TLRPC.FileLocation方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.FileLocation方法的具体用法?Java TLRPC.FileLocation怎么用?Java TLRPC.FileLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.tgnet.TLRPC的用法示例。


在下文中一共展示了TLRPC.FileLocation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPlaceForPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        int coords[] = new int[2];
        cell.getImageView().getLocationInWindow(coords);
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1];
        object.parentView = attachPhotoRecyclerView;
        object.imageReceiver = cell.getImageView().getImageReceiver();
        object.thumb = object.imageReceiver.getBitmap();
        object.scale = cell.getImageView().getScaleX();
        cell.getCheckBox().setVisibility(View.GONE);
        return object;
    }
    return null;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:19,代码来源:ChatAttachAlert.java

示例2: updateAvatarLayout

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateAvatarLayout() {
    if (nameTextView == null) {
        return;
    }
    TLRPC.User user = MessagesController.getInstance().getUser(user_id);
    if (user == null) {
        return;
    }
    nameTextView.setText(PhoneFormat.getInstance().format("+" + user.phone));
    onlineTextView.setText(LocaleController.formatUserStatus(user));

    TLRPC.FileLocation photo = null;
    if (user.photo != null) {
        photo = user.photo.photo_small;
    }
    avatarImage.setImage(photo, "50_50", new AvatarDrawable(user));
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:18,代码来源:ContactAddActivity.java

示例3: getPlaceForPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        int coords[] = new int[2];
        cell.getImageView().getLocationInWindow(coords);
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1] - (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
        object.parentView = attachPhotoRecyclerView;
        object.imageReceiver = cell.getImageView().getImageReceiver();
        object.thumb = object.imageReceiver.getBitmap();
        object.scale = ViewProxy.getScaleX(cell.getImageView());
        object.clipBottomAddition = (Build.VERSION.SDK_INT >= 21 ? 0 : -AndroidUtilities.statusBarHeight);
        cell.getCheckBox().setVisibility(View.GONE);
        return object;
    }
    return null;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:20,代码来源:ChatAttachView.java

示例4: updateUserData

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateUserData() {
    TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
    TLRPC.FileLocation photo = null;
    TLRPC.FileLocation photoBig = null;
    if (user.photo != null) {
        photo = user.photo.photo_small;
        photoBig = user.photo.photo_big;
    }
    AvatarDrawable avatarDrawable = new AvatarDrawable(user, true);
    //avatarDrawable.setColor(Theme.ACTION_BAR_MAIN_AVATAR_COLOR);
    avatarDrawable.setColor(AndroidUtilities.getIntDef("prefAvatarColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x10)));
    int radius = AndroidUtilities.dp(AndroidUtilities.getIntDef("prefAvatarRadius", 32));
    avatarImage.getImageReceiver().setRoundRadius(radius);
    avatarDrawable.setRadius(radius);
    if (avatarImage != null) {
        avatarImage.setImage(photo, "50_50", avatarDrawable);
        avatarImage.getImageReceiver().setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);

        nameTextView.setText(UserObject.getUserName(user));
        onlineTextView.setText(LocaleController.getString("Online", R.string.Online));

        avatarImage.getImageReceiver().setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:25,代码来源:takSettings.java

示例5: getPlaceForPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    if (messageObject == null || listView == null || selectedMode != 0) {
        return null;
    }
    int count = listView.getChildCount();

    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view instanceof SharedPhotoVideoCell) {
            SharedPhotoVideoCell cell = (SharedPhotoVideoCell) view;
            for (int i = 0; i < 6; i++) {
                MessageObject message = cell.getMessageObject(i);
                if (message == null) {
                    break;
                }
                BackupImageView imageView = cell.getImageView(i);
                if (message.getId() == messageObject.getId()) {
                    int coords[] = new int[2];
                    imageView.getLocationInWindow(coords);
                    PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
                    object.viewX = coords[0];
                    object.viewY = coords[1] - AndroidUtilities.statusBarHeight;
                    object.parentView = listView;
                    object.imageReceiver = imageView.getImageReceiver();
                    object.thumb = object.imageReceiver.getBitmap();
                    object.parentView.getLocationInWindow(coords);
                    object.clipTopAddition = AndroidUtilities.dp(40);
                    return object;
                }
            }
        }
    }
    return null;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:36,代码来源:AllMediaActivity.java

示例6: replaceImageInCache

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void replaceImageInCache(final String oldKey, final String newKey, final TLRPC.FileLocation newLocation, boolean post) {
    if (post) {
        AndroidUtilities.runOnUIThread(new Runnable() {
            @Override
            public void run() {
                replaceImageInCacheInternal(oldKey, newKey, newLocation);
            }
        });
    } else {
        replaceImageInCacheInternal(oldKey, newKey, newLocation);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:13,代码来源:ImageLoader.java

示例7: setUser

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setUser(TLRPC.User user) {
    nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
    avatarDrawable.setInfo(user);
    TLRPC.FileLocation photo = null;
    if (user != null && user.photo != null) {
        photo = user.photo.photo_small;
    }
    imageView.setImage(photo, "50_50", avatarDrawable);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:10,代码来源:JoinSheetUserCell.java

示例8: willSwitchFromPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    int count = listView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view.getTag() == null) {
            continue;
        }
        PhotoPickerPhotoCell cell = (PhotoPickerPhotoCell) view;
        int num = (Integer) view.getTag();
        if (selectedAlbum != null) {
            if (num < 0 || num >= selectedAlbum.photos.size()) {
                continue;
            }
        } else {
            ArrayList<MediaController.SearchImage> array;
            if (searchResult.isEmpty() && lastSearchString == null) {
                array = recentImages;
            } else {
                array = searchResult;
            }
            if (num < 0 || num >= array.size()) {
                continue;
            }
        }
        if (num == index) {
            cell.checkBox.setVisibility(View.VISIBLE);
            break;
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:32,代码来源:PhotoPickerActivity.java

示例9: getPlaceForPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public PhotoViewer.PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    if (fileLocation == null) {
        return null;
    }

    TLRPC.FileLocation photoBig = null;
    if (user_id != 0) {
        TLRPC.User user = MessagesController.getInstance().getUser(user_id);
        if (user != null && user.photo != null && user.photo.photo_big != null) {
            photoBig = user.photo.photo_big;
        }
    } else if (chat_id != 0) {
        TLRPC.Chat chat = MessagesController.getInstance().getChat(chat_id);
        if (chat != null && chat.photo != null && chat.photo.photo_big != null) {
            photoBig = chat.photo.photo_big;
        }
    }

    if (photoBig != null && photoBig.local_id == fileLocation.local_id && photoBig.volume_id == fileLocation.volume_id && photoBig.dc_id == fileLocation.dc_id) {
        int coords[] = new int[2];
        avatarImage.getLocationInWindow(coords);
        PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject();
        object.viewX = coords[0];
        object.viewY = coords[1] - AndroidUtilities.statusBarHeight;
        object.parentView = avatarImage;
        object.imageReceiver = avatarImage.getImageReceiver();
        object.dialogId = user_id;
        object.thumb = object.imageReceiver.getBitmap();
        object.size = -1;
        object.radius = avatarImage.getImageReceiver().getRoundRadius();
        return object;
    }
    return null;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:36,代码来源:DialogsActivity.java

示例10: setDialog

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setDialog(int uid, boolean checked, CharSequence name) {
    dialog_id = uid;
    TLRPC.FileLocation photo = null;
    if (uid > 0) {
        TLRPC.User user = MessagesController.getInstance().getUser(uid);
        if (name != null) {
            nameTextView.setText(name);
        } else if (user != null) {
            nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
        } else {
            nameTextView.setText("");
        }
        avatarDrawable.setInfo(user);
        if (user != null && user.photo != null) {
            photo = user.photo.photo_small;
        }
    } else {
        TLRPC.Chat chat = MessagesController.getInstance().getChat(-uid);
        if (name != null) {
            nameTextView.setText(name);
        } else if (chat != null) {
            nameTextView.setText(chat.title);
        } else {
            nameTextView.setText("");
        }
        avatarDrawable.setInfo(chat);
        if (chat != null && chat.photo != null) {
            photo = chat.photo.photo_small;
        }
    }
    imageView.setImage(photo, "50_50", avatarDrawable);
    checkUnreadCounter(0);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:34,代码来源:HintDialogCell.java

示例11: willSwitchFromPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { }
 
开发者ID:MLNO,项目名称:airgram,代码行数:3,代码来源:MediaActivity.java

示例12: isShowingImage

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public boolean isShowingImage(TLRPC.FileLocation object) {
    return isVisible && !disableShowCheck && object != null && currentFileLocation != null && object.local_id == currentFileLocation.local_id && object.volume_id == currentFileLocation.volume_id && object.dc_id == currentFileLocation.dc_id;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:PhotoViewer.java

示例13: getThumbForPhoto

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public Bitmap getThumbForPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) {
    return null;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:5,代码来源:SettingsActivity.java

示例14: update

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void update(int mask) {
    TLRPC.FileLocation photo = null;
    if (user != null) {
        if (user.photo != null) {
            photo = user.photo.photo_small;
        }
        avatarDrawable.setInfo(user);
    } else if (chat != null) {
        if (chat.photo != null) {
            photo = chat.photo.photo_small;
        }
        avatarDrawable.setInfo(chat);
    } else {
        avatarDrawable.setInfo(0, null, null, false);
    }

    if (mask != 0) {
        boolean continueUpdate = false;
        if ((mask & MessagesController.UPDATE_MASK_AVATAR) != 0 && user != null || (mask & MessagesController.UPDATE_MASK_CHAT_AVATAR) != 0 && chat != null) {
            if (lastAvatar != null && photo == null || lastAvatar == null && photo != null && lastAvatar != null && photo != null && (lastAvatar.volume_id != photo.volume_id || lastAvatar.local_id != photo.local_id)) {
                continueUpdate = true;
            }
        }
        if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_STATUS) != 0 && user != null) {
            int newStatus = 0;
            if (user.status != null) {
                newStatus = user.status.expires;
            }
            if (newStatus != lastStatus) {
                continueUpdate = true;
            }
        }
        if (!continueUpdate && ((mask & MessagesController.UPDATE_MASK_NAME) != 0 && user != null) || (mask & MessagesController.UPDATE_MASK_CHAT_NAME) != 0 && chat != null) {
            String newName;
            if (user != null) {
                newName = user.first_name + user.last_name;
            } else {
                newName = chat.title;
            }
            if (!newName.equals(lastName)) {
                continueUpdate = true;
            }
        }
        if (!continueUpdate && drawCount && (mask & MessagesController.UPDATE_MASK_READ_DIALOG_MESSAGE) != 0) {
            TLRPC.TL_dialog dialog = MessagesController.getInstance().dialogs_dict.get(dialog_id);
            if (dialog != null && dialog.unread_count != lastUnreadCount) {
                continueUpdate = true;
            }
        }

        if (!continueUpdate) {
            return;
        }
    }

    if (user != null) {
        if (user.status != null) {
            lastStatus = user.status.expires;
        } else {
            lastStatus = 0;
        }
        lastName = user.first_name + user.last_name;
    } else if (chat != null) {
        lastName = chat.title;
    }


    lastAvatar = photo;
    avatarImage.setImage(photo, "50_50", avatarDrawable, null, false);

    if (getMeasuredWidth() != 0 || getMeasuredHeight() != 0) {
        buildLayout();
    } else {
        requestLayout();
    }
    postInvalidate();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:78,代码来源:ProfileSearchCell.java

示例15: isUserDataChanged

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private boolean isUserDataChanged() {
    if (currentMessageObject != null && (!hasLinkPreview && currentMessageObject.messageOwner.media != null && currentMessageObject.messageOwner.media.webpage instanceof TLRPC.TL_webPage)) {
        return true;
    }
    if (currentMessageObject == null || currentUser == null && currentChat == null) {
        return false;
    }
    if (lastSendState != currentMessageObject.messageOwner.send_state) {
        return true;
    }
    if (lastDeleteDate != currentMessageObject.messageOwner.destroyTime) {
        return true;
    }
    if (lastViewsCount != currentMessageObject.messageOwner.views) {
        return true;
    }

    TLRPC.User newUser = null;
    TLRPC.Chat newChat = null;
    if (currentMessageObject.isFromUser()) {
        newUser = MessagesController.getInstance().getUser(currentMessageObject.messageOwner.from_id);
    } else if (currentMessageObject.messageOwner.from_id < 0) {
        newChat = MessagesController.getInstance().getChat(-currentMessageObject.messageOwner.from_id);
    } else if (currentMessageObject.messageOwner.post) {
        newChat = MessagesController.getInstance().getChat(currentMessageObject.messageOwner.to_id.channel_id);
    }
    TLRPC.FileLocation newPhoto = null;

    if (isAvatarVisible) {
        if (newUser != null && newUser.photo != null){
            newPhoto = newUser.photo.photo_small;
        } else if (newChat != null && newChat.photo != null) {
            newPhoto = newChat.photo.photo_small;
        }
    }

    if (replyTextLayout == null && currentMessageObject.replyMessageObject != null) {
        return true;
    }

    if (currentPhoto == null && newPhoto != null || currentPhoto != null && newPhoto == null || currentPhoto != null && newPhoto != null && (currentPhoto.local_id != newPhoto.local_id || currentPhoto.volume_id != newPhoto.volume_id)) {
        return true;
    }

    TLRPC.FileLocation newReplyPhoto = null;

    if (currentMessageObject.replyMessageObject != null) {
        TLRPC.PhotoSize photoSize = FileLoader.getClosestPhotoSizeWithSize(currentMessageObject.replyMessageObject.photoThumbs, 80);
        if (photoSize != null && currentMessageObject.replyMessageObject.type != 13) {
            newReplyPhoto = photoSize.location;
        }
    }

    if (currentReplyPhoto == null && newReplyPhoto != null) {
        return true;
    }

    String newNameString = null;
    if (drawName && isChat && !currentMessageObject.isOutOwner()) {
        if (newUser != null) {
            newNameString = UserObject.getUserName(newUser);
        } else if (newChat != null) {
            newNameString = newChat.title;
        }
    }

    if (currentNameString == null && newNameString != null || currentNameString != null && newNameString == null || currentNameString != null && newNameString != null && !currentNameString.equals(newNameString)) {
        return true;
    }

    if (drawForwardedName) {
        newNameString = currentMessageObject.getForwardedName();
        return currentForwardNameString == null && newNameString != null || currentForwardNameString != null && newNameString == null || currentForwardNameString != null && newNameString != null && !currentForwardNameString.equals(newNameString);
    }
    return false;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:77,代码来源:ChatMessageCell.java


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