本文整理汇总了Java中org.telegram.messenger.SendMessagesHelper.prepareSendingDocuments方法的典型用法代码示例。如果您正苦于以下问题:Java SendMessagesHelper.prepareSendingDocuments方法的具体用法?Java SendMessagesHelper.prepareSendingDocuments怎么用?Java SendMessagesHelper.prepareSendingDocuments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.messenger.SendMessagesHelper
的用法示例。
在下文中一共展示了SendMessagesHelper.prepareSendingDocuments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: didSelectDialog
import org.telegram.messenger.SendMessagesHelper; //导入方法依赖的package包/类
@Override
public void didSelectDialog(DialogsActivity dialogsFragment, long dialog_id, boolean param) {
if (dialog_id != 0) {
int lower_part = (int)dialog_id;
int high_id = (int)(dialog_id >> 32);
Bundle args = new Bundle();
args.putBoolean("scrollToTopOnResume", true);
if (!AndroidUtilities.isTablet()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats);
}
if (lower_part != 0) {
if (high_id == 1) {
args.putInt("chat_id", lower_part);
} else {
if (lower_part > 0) {
args.putInt("user_id", lower_part);
} else if (lower_part < 0) {
args.putInt("chat_id", -lower_part);
}
}
} else {
args.putInt("enc_id", high_id);
}
if (!MessagesController.checkCanOpenChat(args, dialogsFragment)) {
return;
}
ChatActivity fragment = ChitSettings.instance(args);
if (videoPath != null) {
if(android.os.Build.VERSION.SDK_INT >= 16) {
if (AndroidUtilities.isTablet()) {
actionBarLayout.presentFragment(fragment, false, true, true);
} else {
actionBarLayout.addFragmentToStack(fragment, actionBarLayout.fragmentsStack.size() - 1);
}
if (!fragment.openVideoEditor(videoPath, dialogsFragment != null, false) && dialogsFragment != null) {
if (!AndroidUtilities.isTablet()) {
dialogsFragment.finishFragment(true);
}
}
} else {
actionBarLayout.presentFragment(fragment, dialogsFragment != null, dialogsFragment == null, true);
SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id, null);
}
} else {
actionBarLayout.presentFragment(fragment, dialogsFragment != null, dialogsFragment == null, true);
if (photoPathsArray != null) {
ArrayList<String> captions = null;
if (sendingText != null && photoPathsArray.size() == 1) {
captions = new ArrayList<>();
captions.add(sendingText);
sendingText = null;
}
SendMessagesHelper.prepareSendingPhotos(null, photoPathsArray, dialog_id, null, captions);
}
if (sendingText != null) {
SendMessagesHelper.prepareSendingText(sendingText, dialog_id);
}
if (documentsPathsArray != null || documentsUrisArray != null) {
SendMessagesHelper.prepareSendingDocuments(documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, documentsMimeType, dialog_id, null);
}
if (contactsToSend != null && !contactsToSend.isEmpty()) {
for (TLRPC.User user : contactsToSend) {
SendMessagesHelper.getInstance().sendMessage(user, dialog_id, null, null, null);
}
}
}
photoPathsArray = null;
videoPath = null;
sendingText = null;
documentsPathsArray = null;
documentsOriginalPathsArray = null;
contactsToSend = null;
}
}
示例2: didSelectDialog
import org.telegram.messenger.SendMessagesHelper; //导入方法依赖的package包/类
@Override
public void didSelectDialog(DialogsActivity dialogsFragment, long dialog_id, boolean param) {
if (dialog_id != 0) {
int lower_part = (int) dialog_id;
int high_id = (int) (dialog_id >> 32);
Bundle args = new Bundle();
args.putBoolean("scrollToTopOnResume", true);
if (!AndroidUtilities.isTablet()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats);
}
if (lower_part != 0) {
if (high_id == 1) {
args.putInt("chat_id", lower_part);
} else {
if (lower_part > 0) {
args.putInt("user_id", lower_part);
} else if (lower_part < 0) {
args.putInt("chat_id", -lower_part);
}
}
} else {
args.putInt("enc_id", high_id);
}
if (!MessagesController.checkCanOpenChat(args, dialogsFragment)) {
return;
}
ChatActivity fragment = new ChatActivity(args);
if (videoPath != null) {
if (android.os.Build.VERSION.SDK_INT >= 16) {
if (AndroidUtilities.isTablet()) {
actionBarLayout.presentFragment(fragment, false, true, true);
} else {
actionBarLayout.addFragmentToStack(fragment, actionBarLayout.fragmentsStack.size() - 1);
}
if (!fragment.openVideoEditor(videoPath, dialogsFragment != null, false) && dialogsFragment != null) {
if (!AndroidUtilities.isTablet()) {
dialogsFragment.finishFragment(true);
}
}
} else {
actionBarLayout.presentFragment(fragment, dialogsFragment != null, dialogsFragment == null, true);
SendMessagesHelper.prepareSendingVideo(videoPath, 0, 0, 0, 0, null, dialog_id, null, null);
}
} else {
actionBarLayout.presentFragment(fragment, dialogsFragment != null, dialogsFragment == null, true);
if (photoPathsArray != null) {
ArrayList<String> captions = null;
if (sendingText != null && sendingText.length() <= 200 && photoPathsArray.size() == 1) {
captions = new ArrayList<>();
captions.add(sendingText);
sendingText = null;
}
SendMessagesHelper.prepareSendingPhotos(null, photoPathsArray, dialog_id, null, captions, null);
}
if (sendingText != null) {
SendMessagesHelper.prepareSendingText(sendingText, dialog_id);
}
if (documentsPathsArray != null || documentsUrisArray != null) {
SendMessagesHelper.prepareSendingDocuments(documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, documentsMimeType, dialog_id, null);
}
if (contactsToSend != null && !contactsToSend.isEmpty()) {
for (TLRPC.User user : contactsToSend) {
SendMessagesHelper.getInstance().sendMessage(user, dialog_id, null, null, null);
}
}
}
photoPathsArray = null;
videoPath = null;
sendingText = null;
documentsPathsArray = null;
documentsOriginalPathsArray = null;
contactsToSend = null;
}
}
示例3: didSelectDialogs
import org.telegram.messenger.SendMessagesHelper; //导入方法依赖的package包/类
@Override
public void didSelectDialogs(DialogsActivity dialogsFragment, ArrayList<Long> dids, CharSequence message, boolean param) {
long did = dids.get(0);
int lower_part = (int) did;
int high_id = (int) (did >> 32);
Bundle args = new Bundle();
args.putBoolean("scrollToTopOnResume", true);
if (!AndroidUtilities.isTablet()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats);
}
if (lower_part != 0) {
if (high_id == 1) {
args.putInt("chat_id", lower_part);
} else {
if (lower_part > 0) {
args.putInt("user_id", lower_part);
} else if (lower_part < 0) {
args.putInt("chat_id", -lower_part);
}
}
} else {
args.putInt("enc_id", high_id);
}
if (!MessagesController.checkCanOpenChat(args, dialogsFragment)) {
return;
}
ChatActivity fragment = new ChatActivity(args);
actionBarLayout.presentFragment(fragment, dialogsFragment != null, dialogsFragment == null, true);
if (videoPath != null) {
fragment.openVideoEditor(videoPath, sendingText);
sendingText = null;
}
if (photoPathsArray != null) {
if (sendingText != null && sendingText.length() <= 200 && photoPathsArray.size() == 1) {
photoPathsArray.get(0).caption = sendingText;
}
SendMessagesHelper.prepareSendingMedia(photoPathsArray, did, null, null, false, false);
}
if (sendingText != null) {
SendMessagesHelper.prepareSendingText(sendingText, did);
}
if (documentsPathsArray != null || documentsUrisArray != null) {
SendMessagesHelper.prepareSendingDocuments(documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, documentsMimeType, did, null, null);
}
if (contactsToSend != null && !contactsToSend.isEmpty()) {
for (TLRPC.User user : contactsToSend) {
SendMessagesHelper.getInstance().sendMessage(user, did, null, null, null);
}
}
photoPathsArray = null;
videoPath = null;
sendingText = null;
documentsPathsArray = null;
documentsOriginalPathsArray = null;
contactsToSend = null;
}