mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +01:00
Redirect user to ViewPostDetailActivity after submitting a gallery post.
This commit is contained in:
parent
e877b2e439
commit
840383b30f
@ -68,6 +68,7 @@ import ml.docilealligator.infinityforreddit.asynctasks.LoadSubredditIcon;
|
||||
import ml.docilealligator.infinityforreddit.bottomsheetfragments.FlairBottomSheetFragment;
|
||||
import ml.docilealligator.infinityforreddit.bottomsheetfragments.SelectOrCaptureImageBottomSheetFragment;
|
||||
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
|
||||
import ml.docilealligator.infinityforreddit.events.SubmitGalleryPostEvent;
|
||||
import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent;
|
||||
import ml.docilealligator.infinityforreddit.services.SubmitPostService;
|
||||
import ml.docilealligator.infinityforreddit.utils.JSONUtils;
|
||||
@ -684,4 +685,25 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
|
||||
public void onAccountSwitchEvent(SwitchAccountEvent event) {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSubmitGalleryPostEvent(SubmitGalleryPostEvent submitGalleryPostEvent) {
|
||||
isPosting = false;
|
||||
mPostingSnackbar.dismiss();
|
||||
if (submitGalleryPostEvent.postSuccess) {
|
||||
Intent intent = new Intent(this, LinkResolverActivity.class);
|
||||
intent.setData(Uri.parse(submitGalleryPostEvent.postUrl));
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} else {
|
||||
mMemu.findItem(R.id.action_send_post_gallery_activity).setEnabled(true);
|
||||
mMemu.findItem(R.id.action_send_post_gallery_activity).getIcon().setAlpha(255);
|
||||
if (submitGalleryPostEvent.errorMessage == null || submitGalleryPostEvent.errorMessage.equals("")) {
|
||||
Snackbar.make(coordinatorLayout, R.string.post_failed, Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Snackbar.make(coordinatorLayout, submitGalleryPostEvent.errorMessage.substring(0, 1).toUpperCase()
|
||||
+ submitGalleryPostEvent.errorMessage.substring(1), Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user