本文整理汇总了Java中org.telegram.messenger.query.SharedMediaQuery类的典型用法代码示例。如果您正苦于以下问题:Java SharedMediaQuery类的具体用法?Java SharedMediaQuery怎么用?Java SharedMediaQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SharedMediaQuery类属于org.telegram.messenger.query包,在下文中一共展示了SharedMediaQuery类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFirstHoles
import org.telegram.messenger.query.SharedMediaQuery; //导入依赖的package包/类
public static void createFirstHoles(long did, SQLitePreparedStatement state5, SQLitePreparedStatement state6, int messageId) throws Exception {
state5.requery();
state5.bindLong(1, did);
state5.bindInteger(2, messageId == 1 ? 1 : 0);
state5.bindInteger(3, messageId);
state5.step();
for (int b = 0; b < SharedMediaQuery.MEDIA_TYPES_COUNT; b++) {
state6.requery();
state6.bindLong(1, did);
state6.bindInteger(2, b);
state6.bindInteger(3, messageId == 1 ? 1 : 0);
state6.bindInteger(4, messageId);
state6.step();
}
}
示例2: onFragmentCreate
import org.telegram.messenger.query.SharedMediaQuery; //导入依赖的package包/类
@Override
public boolean onFragmentCreate() {
super.onFragmentCreate();
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaDidLoaded);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messagesDeleted);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.didReceivedNewMessages);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messageReceivedByServer);
dialog_id = getArguments().getLong("dialog_id", 0);
for (int a = 0; a < sharedMediaData.length; a++) {
sharedMediaData[a] = new SharedMediaData();
sharedMediaData[a].max_id[0] = ((int)dialog_id) == 0 ? Integer.MIN_VALUE : Integer.MAX_VALUE;
if (mergeDialogId != 0 && info != null) {
sharedMediaData[a].max_id[1] = info.migrated_from_max_id;
sharedMediaData[a].endReached[1] = false;
}
}
sharedMediaData[0].loading = true;
SharedMediaQuery.loadMedia(dialog_id, 0, 50, 0, SharedMediaQuery.MEDIA_PHOTOVIDEO, true, classGuid);
return true;
}
示例3: onFragmentCreate
import org.telegram.messenger.query.SharedMediaQuery; //导入依赖的package包/类
@Override
public boolean onFragmentCreate() {
super.onFragmentCreate();
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaDidLoaded);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messagesDeleted);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.didReceivedNewMessages);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messageReceivedByServer);
dialog_id = getArguments().getLong("dialog_id", 0);
for (int a = 0; a < sharedMediaData.length; a++) {
sharedMediaData[a] = new SharedMediaData();
sharedMediaData[a].max_id[0] = ((int)dialog_id) == 0 ? Integer.MIN_VALUE : Integer.MAX_VALUE;
if (mergeDialogId != 0 && info != null) {
sharedMediaData[a].max_id[1] = info.migrated_from_max_id;
sharedMediaData[a].endReached[1] = false;
}
}
sharedMediaData[0].loading = true;
SharedMediaQuery.loadMedia(dialog_id, 50, 0, SharedMediaQuery.MEDIA_PHOTOVIDEO, true, classGuid);
return true;
}
示例4: setPlaylist
import org.telegram.messenger.query.SharedMediaQuery; //导入依赖的package包/类
public boolean setPlaylist(ArrayList<MessageObject> messageObjects, MessageObject current, boolean loadMusic) {
if (playingMessageObject == current) {
return playMessage(current);
}
forceLoopCurrentPlaylist = !loadMusic;
playMusicAgain = !playlist.isEmpty();
playlist.clear();
for (int a = messageObjects.size() - 1; a >= 0; a--) {
MessageObject messageObject = messageObjects.get(a);
if (messageObject.isMusic()) {
playlist.add(messageObject);
}
}
currentPlaylistNum = playlist.indexOf(current);
if (currentPlaylistNum == -1) {
playlist.clear();
shuffledPlaylist.clear();
currentPlaylistNum = playlist.size();
playlist.add(current);
}
if (current.isMusic()) {
if (shuffleMusic) {
buildShuffledPlayList();
currentPlaylistNum = 0;
}
if (loadMusic) {
SharedMediaQuery.loadMusic(current.getDialogId(), playlist.get(0).getIdWithChannel());
}
}
return playMessage(current);
}
示例5: setPlaylist
import org.telegram.messenger.query.SharedMediaQuery; //导入依赖的package包/类
public boolean setPlaylist(ArrayList<MessageObject> messageObjects, MessageObject current, boolean loadMusic) {
if (playingMessageObject == current) {
return playAudio(current);
}
forceLoopCurrentPlaylist = !loadMusic;
playMusicAgain = !playlist.isEmpty();
playlist.clear();
for (int a = messageObjects.size() - 1; a >= 0; a--) {
MessageObject messageObject = messageObjects.get(a);
if (messageObject.isMusic()) {
playlist.add(messageObject);
}
}
currentPlaylistNum = playlist.indexOf(current);
if (currentPlaylistNum == -1) {
playlist.clear();
shuffledPlaylist.clear();
currentPlaylistNum = playlist.size();
playlist.add(current);
}
if (current.isMusic()) {
if (shuffleMusic) {
buildShuffledPlayList();
currentPlaylistNum = 0;
}
if (loadMusic) {
SharedMediaQuery.loadMusic(current.getDialogId(), playlist.get(0).getId());
}
}
return playAudio(current);
}
示例6: onFragmentCreate
import org.telegram.messenger.query.SharedMediaQuery; //导入依赖的package包/类
@Override
public boolean onFragmentCreate() {
super.onFragmentCreate();
NotificationCenter.getInstance().addObserver(this, NotificationCenter.mediaDidLoaded);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messagesDeleted);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.didReceivedNewMessages);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messageReceivedByServer);
dialog_id = getArguments().getLong("dialog_id", 0);
selectedMode = getArguments().getInt("selected_mode", 0);
/*SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
int sm = preferences.getInt("mediaSelectedMode", 0);
if(selectedMode == 0 && selectedMode != sm){
selectedMode = sm;
}*/
for (int a = 0; a < sharedMediaData.length; a++) {
sharedMediaData[a] = new SharedMediaData();
sharedMediaData[a].max_id[0] = ((int)dialog_id) == 0 ? Integer.MIN_VALUE : Integer.MAX_VALUE;
if (mergeDialogId != 0 && info != null) {
sharedMediaData[a].max_id[1] = info.migrated_from_max_id;
sharedMediaData[a].endReached[1] = false;
}
}
sharedMediaData[0].loading = true;
SharedMediaQuery.loadMedia(dialog_id, 0, 50, 0, SharedMediaQuery.MEDIA_PHOTOVIDEO, true, classGuid);
return true;
}