diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java index 5278a7152c..7a83da275b 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java @@ -206,17 +206,35 @@ public void onPageSelected(int position){ toolbarWrap=uiOverlay.findViewById(R.id.toolbar_wrap); toolbar=uiOverlay.findViewById(R.id.toolbar); toolbar.setNavigationOnClickListener(v->onStartSwipeToDismissTransition(0)); - if(status!=null) - toolbar.getMenu().add(R.string.info).setIcon(R.drawable.ic_fluent_info_24_regular).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); - else - toolbar.getMenu().add(R.string.download).setIcon(R.drawable.ic_fluent_arrow_download_24_regular).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); - toolbar.setOnMenuItemClickListener(item->{ - if(status!=null) - showInfoSheet(); - else - saveCurrentFile(); - return true; - }); + + if(status!=null) { + toolbar.getMenu() + .add(R.string.info) + .setIcon(R.drawable.ic_fluent_info_24_regular) + .setOnMenuItemClickListener(item -> { + showInfoSheet(); + return true; + }) + .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); + } else { + toolbar.getMenu() + .add(R.string.download) + .setIcon(R.drawable.ic_fluent_arrow_download_24_regular) + .setOnMenuItemClickListener(item -> { + saveCurrentFile(); + return true; + }) + .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); + toolbar.getMenu() + .add(R.string.button_share) + .setIcon(R.drawable.ic_fluent_share_24_regular) + .setOnMenuItemClickListener(item -> { + shareCurrentFile(); + return true; + }) + .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); + } + uiOverlay.setAlpha(0f); videoControls=uiOverlay.findViewById(R.id.video_player_controls); videoSeekBar=uiOverlay.findViewById(R.id.seekbar);