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


Java MediaController.PhotoEntry方法代码示例

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


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

示例1: updatePhotoAtIndex

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public void updatePhotoAtIndex(int index) {
    PhotoAttachPhotoCell cell = getCellForIndex(index);
    if (cell != null) {
        cell.getImageView().setOrientation(0, true);
        MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(index);
        if (photoEntry.thumbPath != null) {
            cell.getImageView().setImage(photoEntry.thumbPath, null, cell.getContext().getResources().getDrawable(R.drawable.nophotos));
        } else if (photoEntry.path != null) {
            cell.getImageView().setOrientation(photoEntry.orientation, true);
            cell.getImageView().setImage("thumb://" + photoEntry.imageId + ":" + photoEntry.path, null, cell.getContext().getResources().getDrawable(R.drawable.nophotos));
        } else {
            cell.getImageView().setImageResource(R.drawable.nophotos);
        }
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:17,代码来源:ChatAttachView.java

示例2: onBindViewHolder

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (!deviceHasGoodCamera || position != 0) {
        if (deviceHasGoodCamera) {
            position--;
        }
        PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) holder.itemView;
        MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(position);
        cell.setPhotoEntry(photoEntry, position == MediaController.allPhotosAlbumEntry.photos.size() - 1);
        cell.setChecked(selectedPhotos.containsKey(photoEntry.imageId), false);
        cell.getImageView().setTag(position);
        cell.setTag(position);
    } else if (deviceHasGoodCamera && position == 0) {
        if (cameraView != null && cameraView.isInitied()) {
            holder.itemView.setVisibility(View.INVISIBLE);
        } else {
            holder.itemView.setVisibility(View.VISIBLE);
        }
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:21,代码来源:ChatAttachAlert.java

示例3: setPhotoEntry

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void setPhotoEntry(MediaController.PhotoEntry entry, boolean last) {
    pressed = false;
    photoEntry = entry;
    isLast = last;
    if (photoEntry.thumbPath != null) {
        imageView.setImage(photoEntry.thumbPath, null, getResources().getDrawable(R.drawable.nophotos));
    } else if (photoEntry.path != null) {
        imageView.setOrientation(photoEntry.orientation, true);
        imageView.setImage("thumb://" + photoEntry.imageId + ":" + photoEntry.path, null, getResources().getDrawable(R.drawable.nophotos));
    } else {
        imageView.setImageResource(R.drawable.nophotos);
    }
    boolean showing = PhotoViewer.getInstance().isShowingImage(photoEntry.path);
    imageView.getImageReceiver().setVisible(!showing, true);
    checkBox.setVisibility(showing ? View.INVISIBLE : View.VISIBLE);
    requestLayout();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:PhotoAttachPhotoCell.java

示例4: setPhotoChecked

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public void setPhotoChecked(int index) {
    boolean add = true;
    if (index < 0 || index >= MediaController.allPhotosAlbumEntry.photos.size()) {
        return;
    }
    MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(index);
    if (photoAttachAdapter.getSelectedPhotos().containsKey(photoEntry.imageId)) {
        photoAttachAdapter.getSelectedPhotos().remove(photoEntry.imageId);
        add = false;
    } else {
        photoAttachAdapter.getSelectedPhotos().put(photoEntry.imageId, photoEntry);
    }
    int count = attachPhotoRecyclerView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = attachPhotoRecyclerView.getChildAt(a);
        int num = (Integer) view.getTag();
        if (num == index) {
            ((PhotoAttachPhotoCell) view).setChecked(add, false);
            break;
        }
    }
    updatePhotosButton();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:25,代码来源:ChatAttachAlert.java

示例5: init

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void init() {
    if (MediaController.allPhotosAlbumEntry != null) {
        for (int a = 0; a < Math.min(100, MediaController.allPhotosAlbumEntry.photos.size()); a++) {
            MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(a);
            photoEntry.caption = null;
            photoEntry.imagePath = null;
            photoEntry.thumbPath = null;
            photoEntry.stickers.clear();
        }
    }
    if (currentHintAnimation != null) {
        currentHintAnimation.cancel();
        currentHintAnimation = null;
    }
    hintTextView.setAlpha(0.0f);
    hintTextView.setVisibility(View.INVISIBLE);
    attachPhotoLayoutManager.scrollToPositionWithOffset(0, 1000000);
    photoAttachAdapter.clearSelectedPhotos();
    layoutManager.scrollToPositionWithOffset(0, 1000000);
    updatePhotosButton();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:22,代码来源:ChatAttachAlert.java

示例6: sendPhoto

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void sendPhoto(MediaController.PhotoEntry photoEntry) {
    if (photoEntry.imagePath != null) {
        SendMessagesHelper.prepareSendingPhoto(photoEntry.imagePath, null, dialog_id, replyingMessageObject, photoEntry.caption);
        showReplyPanel(false, null, null, null, false, true);
        DraftQuery.cleanDraft(dialog_id, true);
    } else if (photoEntry.path != null) {
        SendMessagesHelper.prepareSendingPhoto(photoEntry.path, null, dialog_id, replyingMessageObject, photoEntry.caption);
        showReplyPanel(false, null, null, null, false, true);
        DraftQuery.cleanDraft(dialog_id, true);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:12,代码来源:ChatActivity.java

示例7: clearSelectedPhotos

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void clearSelectedPhotos() {
    if (!selectedPhotos.isEmpty()) {
        for (HashMap.Entry<Integer, MediaController.PhotoEntry> entry : selectedPhotos.entrySet()) {
            MediaController.PhotoEntry photoEntry = entry.getValue();
            photoEntry.imagePath = null;
            photoEntry.thumbPath = null;
            photoEntry.caption = null;
            photoEntry.stickers.clear();
        }
        selectedPhotos.clear();
        updatePhotosButton();
        notifyDataSetChanged();
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:15,代码来源:ChatAttachAlert.java

示例8: sendButtonPressed

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public void sendButtonPressed(int index) {
    if (photoAttachAdapter.getSelectedPhotos().isEmpty()) {
        if (index < 0 || index >= MediaController.allPhotosAlbumEntry.photos.size()) {
            return;
        }
        MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(index);
        photoAttachAdapter.getSelectedPhotos().put(photoEntry.imageId, photoEntry);
    }
    delegate.didPressedButton(7);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:12,代码来源:ChatAttachAlert.java

示例9: clearSelectedPhotos

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void clearSelectedPhotos() {
    if (!selectedPhotos.isEmpty()) {
        for (HashMap.Entry<Integer, MediaController.PhotoEntry> entry : selectedPhotos.entrySet()) {
            MediaController.PhotoEntry photoEntry = entry.getValue();
            photoEntry.imagePath = null;
            photoEntry.thumbPath = null;
            photoEntry.caption = null;
        }
        selectedPhotos.clear();
        updatePhotosButton();
        notifyDataSetChanged();
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:14,代码来源:ChatAttachAlert.java

示例10: onBindViewHolder

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (!deviceHasGoodCamera || position != 0) {
        if (deviceHasGoodCamera) {
            position--;
        }
        PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) holder.itemView;
        MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(position);
        cell.setPhotoEntry(photoEntry, position == MediaController.allPhotosAlbumEntry.photos.size() - 1);
        cell.setChecked(selectedPhotos.containsKey(photoEntry.imageId), false);
        cell.getImageView().setTag(position);
        cell.setTag(position);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:15,代码来源:ChatAttachAlert.java

示例11: PhotoPickerActivity

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public PhotoPickerActivity(int type, MediaController.AlbumEntry selectedAlbum, HashMap<Integer, MediaController.PhotoEntry> selectedPhotos, HashMap<String, MediaController.SearchImage> selectedWebPhotos, ArrayList<MediaController.SearchImage> recentImages, boolean onlyOnePhoto, boolean allowCaption, ChatActivity chatActivity) {
    super();
    this.selectedAlbum = selectedAlbum;
    this.selectedPhotos = selectedPhotos;
    this.selectedWebPhotos = selectedWebPhotos;
    this.type = type;
    this.recentImages = recentImages;
    this.singlePhoto = onlyOnePhoto;
    this.chatActivity = chatActivity;
    this.allowCaption = allowCaption;
    if (selectedAlbum != null && selectedAlbum.isVideo) {
        singlePhoto = true;
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:15,代码来源:PhotoPickerActivity.java

示例12: updateCaptionTextForCurrentPhoto

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
private void updateCaptionTextForCurrentPhoto(Object object) {
    CharSequence caption = null;
    if (object instanceof MediaController.PhotoEntry) {
        caption = ((MediaController.PhotoEntry) object).caption;
    } else if (object instanceof TLRPC.BotInlineResult) {
        //caption = ((TLRPC.BotInlineResult) object).send_message.caption;
    } else if (object instanceof MediaController.SearchImage) {
        caption = ((MediaController.SearchImage) object).caption;
    }
    if (caption == null || caption.length() == 0) {
        captionEditText.setFieldText("");
    } else {
        captionEditText.setFieldText(caption);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:16,代码来源:PhotoViewer.java

示例13: init

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void init(ChatActivity parentFragment) {
    if (MediaController.allPhotosAlbumEntry != null) {
        for (int a = 0; a < Math.min(100, MediaController.allPhotosAlbumEntry.photos.size()); a++) {
            MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(a);
            photoEntry.caption = null;
            photoEntry.imagePath = null;
            photoEntry.thumbPath = null;
        }
    }
    attachPhotoLayoutManager.scrollToPositionWithOffset(0, 1000000);
    photoAttachAdapter.clearSelectedPhotos();
    baseFragment = parentFragment;
    updatePhotosButton();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:15,代码来源:ChatAttachView.java

示例14: getSelectedPhotos

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public HashMap<Integer, MediaController.PhotoEntry> getSelectedPhotos() {
    return selectedPhotos;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:4,代码来源:ChatAttachView.java

示例15: closeCaptionEnter

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
private void closeCaptionEnter(boolean apply) {
    Object object = imagesArrLocals.get(currentIndex);
    if (apply) {
        if (object instanceof MediaController.PhotoEntry) {
            ((MediaController.PhotoEntry) object).caption = captionEditText.getFieldCharSequence();
        } else if (object instanceof MediaController.SearchImage) {
            ((MediaController.SearchImage) object).caption = captionEditText.getFieldCharSequence();
        }

        if (captionEditText.getFieldCharSequence().length() != 0 && !placeProvider.isPhotoChecked(currentIndex)) {
            placeProvider.setPhotoChecked(currentIndex);
            checkImageView.setChecked(placeProvider.isPhotoChecked(currentIndex), true);
            updateSelectedCount();
        }
    }
    cropItem.setVisibility(View.VISIBLE);
    captionItem.setVisibility(View.VISIBLE);
    if (Build.VERSION.SDK_INT >= 16) {
        tuneItem.setVisibility(View.VISIBLE);
    }
    if (sendPhotoType == 0) {
        checkImageView.setVisibility(View.VISIBLE);
    }
    captionDoneItem.setVisibility(View.GONE);
    pickerView.setVisibility(View.VISIBLE);

    FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) captionEditText.getLayoutParams();
    layoutParams.bottomMargin = -AndroidUtilities.dp(400);
    captionEditText.setLayoutParams(layoutParams);

    layoutParams = (FrameLayout.LayoutParams) mentionListView.getLayoutParams();
    layoutParams.bottomMargin = -AndroidUtilities.dp(400);
    mentionListView.setLayoutParams(layoutParams);

    if (lastTitle != null) {
        actionBar.setTitle(lastTitle);
        lastTitle = null;
    }

    updateCaptionTextForCurrentPhoto(object);
    setCurrentCaption(captionEditText.getFieldCharSequence());
    if (captionEditText.isPopupShowing()) {
        captionEditText.hidePopup();
    } else {
        captionEditText.closeKeyboard();
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:48,代码来源:PhotoViewer.java


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