use of forpdateam.ru.forpda.ui.fragments.theme.ThemeFragment in project ForPDA by RadiationX.
the class EditPostFragment method sendMessage.
private void sendMessage() {
messagePanel.setProgressState(true);
postForm.setMessage(messagePanel.getMessage());
List<AttachmentItem> attachments = messagePanel.getAttachments();
postForm.getAttachments().clear();
for (AttachmentItem item : attachments) {
postForm.addAttachment(item);
}
subscribe(RxApi.EditPost().sendPost(postForm), s -> {
messagePanel.setProgressState(false);
if (s.getId() != 0) {
TabFragment fragment = TabManager.get().get(getParentTag());
if (fragment != null) {
if (fragment instanceof ThemeFragment) {
ThemeFragment themeFragment = (ThemeFragment) fragment;
if (postForm.getType() == TYPE_EDIT_POST) {
themeFragment.onEditPostCompleted(s);
} else {
themeFragment.onSendPostCompleted(s);
}
}
}
TabManager.get().remove(EditPostFragment.this);
}
}, new ThemePage(), v -> loadData());
}
use of forpdateam.ru.forpda.ui.fragments.theme.ThemeFragment in project ForPDA by RadiationX.
the class EditPostFragment method onBackPressed.
@Override
public boolean onBackPressed() {
super.onBackPressed();
if (messagePanel.onBackPressed())
return true;
if (showExitDialog()) {
return true;
}
// Синхронизация с полем в фрагменте темы
TabFragment fragment = TabManager.get().get(getParentTag());
if (fragment != null && fragment instanceof ThemeFragment) {
ThemeFragment themeFragment = (ThemeFragment) fragment;
showSyncDialog(themeFragment);
return true;
}
return false;
}
Aggregations