use of org.telegram.ui.PassportActivity in project Telegram-FOSS by Telegram-FOSS-Team.
the class ChatAttachAlert method openDocumentsLayout.
private void openDocumentsLayout(boolean show) {
if (documentLayout == null) {
layouts[4] = documentLayout = new ChatAttachAlertDocumentLayout(this, getContext(), false, resourcesProvider);
documentLayout.setDelegate(new ChatAttachAlertDocumentLayout.DocumentSelectActivityDelegate() {
@Override
public void didSelectFiles(ArrayList<String> files, String caption, ArrayList<MessageObject> fmessages, boolean notify, int scheduleDate) {
if (baseFragment instanceof ChatActivity) {
((ChatActivity) baseFragment).didSelectFiles(files, caption, fmessages, notify, scheduleDate);
} else if (baseFragment instanceof PassportActivity) {
((PassportActivity) baseFragment).didSelectFiles(files, caption, notify, scheduleDate);
}
}
@Override
public void didSelectPhotos(ArrayList<SendMessagesHelper.SendingMediaInfo> photos, boolean notify, int scheduleDate) {
if (baseFragment instanceof ChatActivity) {
((ChatActivity) baseFragment).didSelectPhotos(photos, notify, scheduleDate);
} else if (baseFragment instanceof PassportActivity) {
((PassportActivity) baseFragment).didSelectPhotos(photos, notify, scheduleDate);
}
}
@Override
public void startDocumentSelectActivity() {
if (baseFragment instanceof ChatActivity) {
((ChatActivity) baseFragment).startDocumentSelectActivity();
} else if (baseFragment instanceof PassportActivity) {
((PassportActivity) baseFragment).startDocumentSelectActivity();
}
}
@Override
public void startMusicSelectActivity() {
openAudioLayout(true);
}
});
}
if (baseFragment instanceof ChatActivity) {
ChatActivity chatActivity = (ChatActivity) baseFragment;
TLRPC.Chat currentChat = chatActivity.getCurrentChat();
documentLayout.setMaxSelectedFiles(currentChat != null && !ChatObject.hasAdminRights(currentChat) && currentChat.slowmode_enabled || editingMessageObject != null ? 1 : -1);
} else {
documentLayout.setMaxSelectedFiles(maxSelectedPhotos);
documentLayout.setCanSelectOnlyImageFiles(true);
}
if (show) {
showLayout(documentLayout);
}
}
Aggregations