diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java
index 16b37e3a9b..738d64563e 100644
--- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java
+++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java
@@ -808,25 +808,28 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
actionItem.setActionView(wrap);
actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
- draftsBtn = wrap.findViewById(R.id.drafts_btn);
- draftOptionsPopup = new PopupMenu(getContext(), draftsBtn);
+ draftsBtn=wrap.findViewById(R.id.drafts_btn);
+ draftOptionsPopup=new PopupMenu(getContext(), draftsBtn);
draftOptionsPopup.inflate(R.menu.compose_more);
- draftMenuItem = draftOptionsPopup.getMenu().findItem(R.id.draft);
- undraftMenuItem = draftOptionsPopup.getMenu().findItem(R.id.undraft);
- scheduleMenuItem = draftOptionsPopup.getMenu().findItem(R.id.schedule);
- unscheduleMenuItem = draftOptionsPopup.getMenu().findItem(R.id.unschedule);
+ Menu draftOptionsMenu=draftOptionsPopup.getMenu();
+ draftMenuItem=draftOptionsMenu.findItem(R.id.draft);
+ undraftMenuItem=draftOptionsMenu.findItem(R.id.undraft);
+ scheduleMenuItem=draftOptionsMenu.findItem(R.id.schedule);
+ unscheduleMenuItem=draftOptionsMenu.findItem(R.id.unschedule);
+ draftOptionsMenu.findItem(R.id.preview).setVisible(isInstanceAkkoma());
draftOptionsPopup.setOnMenuItemClickListener(i->{
- int id = i.getItemId();
- if (id == R.id.draft) updateScheduledAt(getDraftInstant());
- else if (id == R.id.schedule) pickScheduledDateTime();
- else if (id == R.id.unschedule || id == R.id.undraft) updateScheduledAt(null);
- else navigateToUnsentPosts();
+ int id=i.getItemId();
+ if(id==R.id.draft) updateScheduledAt(getDraftInstant());
+ else if(id==R.id.schedule) pickScheduledDateTime();
+ else if(id==R.id.unschedule || id==R.id.undraft) updateScheduledAt(null);
+ else if(id==R.id.drafts) navigateToUnsentPosts();
+ else if(id==R.id.preview) publish(true);
return true;
});
UiUtils.enablePopupMenuIcons(getContext(), draftOptionsPopup);
- publishButton = wrap.findViewById(R.id.publish_btn);
- languageButton = wrap.findViewById(R.id.language_btn);
+ publishButton=wrap.findViewById(R.id.publish_btn);
+ languageButton=wrap.findViewById(R.id.language_btn);
languageButton.setOnClickListener(v->showLanguageAlert());
languageButton.setOnLongClickListener(v->{
if(!getLocalPrefs().bottomEncoding){
@@ -858,13 +861,6 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
draftCheckComplete.accept(isAlreadyDraft);
}
});
- publishButton.setOnLongClickListener(v -> {
- if(isInstanceAkkoma()) {
- publish(true);
- return true;
- }
- return false;
- });
draftsBtn.setOnClickListener(v-> draftOptionsPopup.show());
draftsBtn.setOnTouchListener(draftOptionsPopup.getDragToOpenListener());
updateScheduledAt(scheduledAt != null ? scheduledAt : scheduledStatus != null ? scheduledStatus.scheduledAt : null);
@@ -1076,7 +1072,7 @@ private void publish(boolean preview){
V.setVisibilityAnimated(sendProgress, View.VISIBLE);
mediaViewController.saveAltTextsBeforePublishing(
- () -> actuallyPublish(preview),
+ ()->actuallyPublish(preview),
this::handlePublishError);
}
diff --git a/mastodon/src/main/res/drawable/ic_fluent_receipt_sparkles_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_receipt_sparkles_24_regular.xml
new file mode 100644
index 0000000000..80cd0471c7
--- /dev/null
+++ b/mastodon/src/main/res/drawable/ic_fluent_receipt_sparkles_24_regular.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/mastodon/src/main/res/menu/compose_more.xml b/mastodon/src/main/res/menu/compose_more.xml
index a471092765..d61962b47d 100644
--- a/mastodon/src/main/res/menu/compose_more.xml
+++ b/mastodon/src/main/res/menu/compose_more.xml
@@ -5,4 +5,5 @@
+
diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml
index fcb8f04ada..3f46b4cb1b 100644
--- a/mastodon/src/main/res/values/strings_sk.xml
+++ b/mastodon/src/main/res/values/strings_sk.xml
@@ -433,4 +433,5 @@
Copy latest crash log
None available… yet
Crash log copied
+ Preview post