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


Java MediaController.SearchImage方法代码示例

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


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

示例1: calcGifsHash

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
private int calcGifsHash(ArrayList<MediaController.SearchImage> arrayList) {
    if (arrayList == null) {
        return 0;
    }
    long acc = 0;
    for (int a = 0; a < Math.min(200, arrayList.size()); a++) {
        MediaController.SearchImage searchImage = arrayList.get(a);
        if (searchImage.document == null) {
            continue;
        }
        int high_id = (int) (searchImage.document.id >> 32);
        int lower_id = (int) searchImage.document.id;
        acc = ((acc * 20261) + 0x80000000L + high_id) % 0x80000000L;
        acc = ((acc * 20261) + 0x80000000L + lower_id) % 0x80000000L;
    }
    return (int) acc;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:EmojiView.java

示例2: didReceivedNotification

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void didReceivedNotification(int id, Object... args) {
    if (id == NotificationCenter.stickersDidLoaded) {
        updateStickerTabs();
        reloadStickersAdapter();
    } else if (id == NotificationCenter.recentImagesDidLoaded) {
        if ((Integer) args[0] == 2) {
            int previousCount = recentImages != null ? recentImages.size() : 0;
            recentImages = (ArrayList<MediaController.SearchImage>) args[1];
            loadingRecent = false;
            if (gifsAdapter != null) {
                gifsAdapter.notifyDataSetChanged();
            }
            if (previousCount != recentImages.size()) {
                updateStickerTabs();
            }
            loadRecentGif();
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:EmojiView.java

示例3: 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;
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:14,代码来源:PhotoPickerActivity.java

示例4: didReceivedNotification

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void didReceivedNotification(int id, Object... args) {
    if (id == NotificationCenter.closeChats) {
        removeSelfFromStack();
    } else if (id == NotificationCenter.recentImagesDidLoaded) {
        if (selectedAlbum == null && type == (Integer) args[0]) {
            recentImages = (ArrayList<MediaController.SearchImage>) args[1];
            loadingRecent = false;
            updateSearchInterface();
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:14,代码来源:PhotoPickerActivity.java

示例5: getCellForIndex

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
private PhotoPickerPhotoCell getCellForIndex(int index) {
    int count = listView.getChildCount();

    for (int a = 0; a < count; a++) {
        View view = listView.getChildAt(a);
        if (view instanceof PhotoPickerPhotoCell) {
            PhotoPickerPhotoCell cell = (PhotoPickerPhotoCell) view;
            int num = (Integer) cell.photoImage.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) {
                return cell;
            }
        }
    }
    return null;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:31,代码来源:PhotoPickerActivity.java

示例6: willSwitchFromPhoto

import org.telegram.messenger.MediaController; //导入方法依赖的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

示例7: isPhotoChecked

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public boolean isPhotoChecked(int index) {
    if (selectedAlbum != null) {
        return !(index < 0 || index >= selectedAlbum.photos.size()) && selectedPhotos.containsKey(selectedAlbum.photos.get(index).imageId);
    } else {
        ArrayList<MediaController.SearchImage> array;
        if (searchResult.isEmpty() && lastSearchString == null) {
            array = recentImages;
        } else {
            array = searchResult;
        }
        return !(index < 0 || index >= array.size()) && selectedWebPhotos.containsKey(array.get(index).id);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:15,代码来源:PhotoPickerActivity.java

示例8: 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 MediaController.SearchImage) {
        caption = ((MediaController.SearchImage) object).caption;
    }
    if (caption == null || caption.length() == 0) {
        captionEditText.setFieldText("");
    } else {
        captionEditText.setFieldText(caption);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:14,代码来源:PhotoViewer.java

示例9: openPhotoPicker

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
private void openPhotoPicker(MediaController.AlbumEntry albumEntry, int type) {
    ArrayList<MediaController.SearchImage> recentImages = null;
    if (albumEntry == null) {
        if (type == 0) {
            recentImages = recentWebImages;
        } else if (type == 1) {
            recentImages = recentGifImages;
        }
    }
    PhotoPickerActivity fragment = new PhotoPickerActivity(type, albumEntry, selectedPhotos, selectedWebPhotos, recentImages, singlePhoto, chatActivity);
    fragment.setDelegate(new PhotoPickerActivity.PhotoPickerActivityDelegate() {
        @Override
        public void selectedPhotosChanged() {
            if (pickerBottomLayout != null) {
                pickerBottomLayout.updateSelectedCount(selectedPhotos.size() + selectedWebPhotos.size(), true);
            }
        }

        @Override
        public void actionButtonPressed(boolean canceled) {
            removeSelfFromStack();
            if (!canceled) {
                sendSelectedPhotos();
            }
        }

        @Override
        public boolean didSelectVideo(String path) {
            removeSelfFromStack();
            return delegate.didSelectVideo(path);
        }
    });
    presentFragment(fragment);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:35,代码来源:PhotoAlbumPickerActivity.java

示例10: openPhotoPicker

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
private void openPhotoPicker(MediaController.AlbumEntry albumEntry, int type) {
    ArrayList<MediaController.SearchImage> recentImages = null;
    if (albumEntry == null) {
        if (type == 0) {
            recentImages = recentWebImages;
        } else if (type == 1) {
            recentImages = recentGifImages;
        }
    }
    PhotoPickerActivity fragment = new PhotoPickerActivity(type, albumEntry, selectedPhotos, selectedWebPhotos, recentImages, singlePhoto, allowCaption, chatActivity);
    fragment.setDelegate(new PhotoPickerActivity.PhotoPickerActivityDelegate() {
        @Override
        public void selectedPhotosChanged() {
            if (pickerBottomLayout != null) {
                pickerBottomLayout.updateSelectedCount(selectedPhotos.size() + selectedWebPhotos.size(), true);
            }
        }

        @Override
        public void actionButtonPressed(boolean canceled) {
            removeSelfFromStack();
            if (!canceled) {
                sendSelectedPhotos();
            }
        }

        @Override
        public boolean didSelectVideo(String path) {
            removeSelfFromStack();
            return delegate.didSelectVideo(path);
        }
    });
    presentFragment(fragment);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:35,代码来源:PhotoAlbumPickerActivity.java

示例11: onBindViewHolder

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int i) {
    MediaController.SearchImage photoEntry = recentImages.get(i);
    if (photoEntry.document != null) {
        ((ContextLinkCell) viewHolder.itemView).setGif(photoEntry.document, false);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:8,代码来源:EmojiView.java

示例12: 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

示例13: 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

示例14: 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

示例15: addRecentGif

import org.telegram.messenger.MediaController; //导入方法依赖的package包/类
public void addRecentGif(MediaController.SearchImage searchImage) {
    if (emojiView == null) {
        return;
    }
    emojiView.addRecentGif(searchImage);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:7,代码来源:ChatActivityEnterView.java


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