本文整理汇总了Java中org.telegram.messenger.MediaController类的典型用法代码示例。如果您正苦于以下问题:Java MediaController类的具体用法?Java MediaController怎么用?Java MediaController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MediaController类属于org.telegram.messenger包,在下文中一共展示了MediaController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateInformationForScreenshotDetector
import org.telegram.messenger.MediaController; //导入依赖的package包/类
public void updateInformationForScreenshotDetector() {
if (currentEncryptedChat == null) {
return;
}
ArrayList<Long> visibleMessages = new ArrayList<>();
if (chatListView != null) {
int count = chatListView.getChildCount();
for (int a = 0; a < count; a++) {
View view = chatListView.getChildAt(a);
MessageObject object = null;
if (view instanceof ChatMessageCell) {
ChatMessageCell cell = (ChatMessageCell) view;
object = cell.getMessageObject();
}
if (object != null && object.getId() < 0 && object.messageOwner.random_id != 0) {
visibleMessages.add(object.messageOwner.random_id);
}
}
}
MediaController.getInstance().setLastEncryptedChatParams(chatEnterTime, chatLeaveTime, currentEncryptedChat, visibleMessages);
}
示例2: createHolder
import org.telegram.messenger.MediaController; //导入依赖的package包/类
public Holder createHolder() {
PhotoAttachPhotoCell cell = new PhotoAttachPhotoCell(mContext);
cell.setDelegate(new PhotoAttachPhotoCell.PhotoAttachPhotoCellDelegate() {
@Override
public void onCheckClick(PhotoAttachPhotoCell v) {
MediaController.PhotoEntry photoEntry = v.getPhotoEntry();
if (selectedPhotos.containsKey(photoEntry.imageId)) {
selectedPhotos.remove(photoEntry.imageId);
v.setChecked(false, true);
photoEntry.imagePath = null;
photoEntry.thumbPath = null;
v.setPhotoEntry(photoEntry, (Integer) v.getTag() == MediaController.allPhotosAlbumEntry.photos.size() - 1);
} else {
selectedPhotos.put(photoEntry.imageId, photoEntry);
v.setChecked(true, true);
}
updatePhotosButton();
}
});
return new Holder(cell);
}
示例3: updateWaveform
import org.telegram.messenger.MediaController; //导入依赖的package包/类
private void updateWaveform() {
if (currentMessageObject == null || documentAttachType != DOCUMENT_ATTACH_TYPE_AUDIO) {
return;
}
for (int a = 0; a < documentAttach.attributes.size(); a++) {
TLRPC.DocumentAttribute attribute = documentAttach.attributes.get(a);
if (attribute instanceof TLRPC.TL_documentAttributeAudio) {
if (attribute.waveform == null || attribute.waveform.length == 0) {
MediaController.getInstance().generateWaveform(currentMessageObject);
}
useSeekBarWaweform = attribute.waveform != null;
seekBarWaveform.setWaveform(attribute.waveform);
break;
}
}
}
示例4: setAlbum
import org.telegram.messenger.MediaController; //导入依赖的package包/类
public void setAlbum(int a, MediaController.AlbumEntry albumEntry) {
albumEntries[a] = albumEntry;
if (albumEntry != null) {
AlbumView albumView = albumViews[a];
albumView.imageView.setOrientation(0, true);
if (albumEntry.coverPhoto != null && albumEntry.coverPhoto.path != null) {
albumView.imageView.setOrientation(albumEntry.coverPhoto.orientation, true);
if (albumEntry.coverPhoto.isVideo) {
albumView.imageView.setImage("vthumb://" + albumEntry.coverPhoto.imageId + ":" + albumEntry.coverPhoto.path, null, getContext().getResources().getDrawable(R.drawable.nophotos));
} else {
albumView.imageView.setImage("thumb://" + albumEntry.coverPhoto.imageId + ":" + albumEntry.coverPhoto.path, null, getContext().getResources().getDrawable(R.drawable.nophotos));
}
} else {
albumView.imageView.setImageResource(R.drawable.nophotos);
}
albumView.nameTextView.setText(albumEntry.bucketName);
albumView.countTextView.setText(String.format("%d", albumEntry.photos.size()));
} else {
albumViews[a].setVisibility(INVISIBLE);
}
}
示例5: getCellForIndex
import org.telegram.messenger.MediaController; //导入依赖的package包/类
private PhotoAttachPhotoCell getCellForIndex(int index) {
int count = attachPhotoRecyclerView.getChildCount();
for (int a = 0; a < count; a++) {
View view = attachPhotoRecyclerView.getChildAt(a);
if (view instanceof PhotoAttachPhotoCell) {
PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
int num = (Integer) cell.getImageView().getTag();
if (num < 0 || num >= MediaController.allPhotosAlbumEntry.photos.size()) {
continue;
}
if (num == index) {
return cell;
}
}
}
return null;
}
示例6: 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();
}
示例7: addRecentGif
import org.telegram.messenger.MediaController; //导入依赖的package包/类
public void addRecentGif(MediaController.SearchImage searchImage) {
if (searchImage == null || searchImage.document == null || recentImages == null) {
return;
}
boolean wasEmpty = recentImages.isEmpty();
for (int a = 0; a < recentImages.size(); a++) {
MediaController.SearchImage image = recentImages.get(a);
if (image.id.equals(searchImage.id)) {
recentImages.remove(a);
recentImages.add(0, image);
if (gifsAdapter != null) {
gifsAdapter.notifyDataSetChanged();
}
return;
}
}
recentImages.add(0, searchImage);
if (gifsAdapter != null) {
gifsAdapter.notifyDataSetChanged();
}
if (wasEmpty) {
updateStickerTabs();
}
}
示例8: 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();
}
示例9: 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;
}
}
if (currentHintAnimation != null) {
currentHintAnimation.cancel();
currentHintAnimation = null;
}
hintTextView.setAlpha(0.0f);
hintTextView.setVisibility(View.INVISIBLE);
attachPhotoLayoutManager.scrollToPositionWithOffset(0, 1000000);
photoAttachAdapter.clearSelectedPhotos();
baseFragment = parentFragment;
layoutManager.scrollToPositionWithOffset(0, 1000000);
updatePhotosButton();
}
示例10: getCellForIndex
import org.telegram.messenger.MediaController; //导入依赖的package包/类
private PhotoAttachPhotoCell getCellForIndex(int index) {
if (MediaController.allPhotosAlbumEntry == null) {
return null;
}
int count = attachPhotoRecyclerView.getChildCount();
for (int a = 0; a < count; a++) {
View view = attachPhotoRecyclerView.getChildAt(a);
if (view instanceof PhotoAttachPhotoCell) {
PhotoAttachPhotoCell cell = (PhotoAttachPhotoCell) view;
int num = (Integer) cell.getImageView().getTag();
if (num < 0 || num >= MediaController.allPhotosAlbumEntry.photos.size()) {
continue;
}
if (num == index) {
return cell;
}
}
}
return null;
}
示例11: 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);
}
}
}
示例12: createHolder
import org.telegram.messenger.MediaController; //导入依赖的package包/类
public Holder createHolder() {
PhotoAttachPhotoCell cell = new PhotoAttachPhotoCell(mContext);
cell.setDelegate(new PhotoAttachPhotoCell.PhotoAttachPhotoCellDelegate() {
@Override
public void onCheckClick(PhotoAttachPhotoCell v) {
MediaController.PhotoEntry photoEntry = v.getPhotoEntry();
if (selectedPhotos.containsKey(photoEntry.imageId)) {
selectedPhotos.remove(photoEntry.imageId);
v.setChecked(false, true);
photoEntry.imagePath = null;
photoEntry.thumbPath = null;
photoEntry.stickers.clear();
v.setPhotoEntry(photoEntry, (Integer) v.getTag() == MediaController.allPhotosAlbumEntry.photos.size() - 1);
} else {
selectedPhotos.put(photoEntry.imageId, photoEntry);
v.setChecked(true, true);
}
updatePhotosButton();
}
});
return new Holder(cell);
}
示例13: updateInformationForScreenshotDetector
import org.telegram.messenger.MediaController; //导入依赖的package包/类
private void updateInformationForScreenshotDetector() {
if (currentEncryptedChat == null) {
return;
}
ArrayList<Long> visibleMessages = new ArrayList<>();
if (chatListView != null) {
int count = chatListView.getChildCount();
for (int a = 0; a < count; a++) {
View view = chatListView.getChildAt(a);
MessageObject object = null;
if (view instanceof ChatMessageCell) {
ChatMessageCell cell = (ChatMessageCell) view;
object = cell.getMessageObject();
}
if (object != null && object.getId() < 0 && object.messageOwner.random_id != 0) {
visibleMessages.add(object.messageOwner.random_id);
}
}
}
MediaController.getInstance().setLastEncryptedChatParams(chatEnterTime, chatLeaveTime, currentEncryptedChat, visibleMessages);
}
示例14: PhotoPickerAlbumsCell
import org.telegram.messenger.MediaController; //导入依赖的package包/类
public PhotoPickerAlbumsCell(Context context) {
super(context);
albumEntries = new MediaController.AlbumEntry[4];
albumViews = new AlbumView[4];
for (int a = 0; a < 4; a++) {
albumViews[a] = new AlbumView(context);
addView(albumViews[a]);
albumViews[a].setVisibility(INVISIBLE);
albumViews[a].setTag(a);
albumViews[a].setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (delegate != null) {
delegate.didSelectAlbum(albumEntries[(Integer) v.getTag()]);
}
}
});
}
}
示例15: 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, ChatActivity chatActivity) {
super();
this.selectedAlbum = selectedAlbum;
this.selectedPhotos = selectedPhotos;
this.selectedWebPhotos = selectedWebPhotos;
this.type = type;
this.recentImages = recentImages;
this.singlePhoto = onlyOnePhoto;
this.chatActivity = chatActivity;
if (selectedAlbum != null && selectedAlbum.isVideo) {
singlePhoto = true;
}
}