Skip to content

Commit

Permalink
fix(photo-viewer-menu-icons): readd share button on non-status media …
Browse files Browse the repository at this point in the history
…viewers
  • Loading branch information
LucasGGamerM committed May 5, 2024
1 parent a59c20d commit 6f89dd7
Showing 1 changed file with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6f89dd7

Please sign in to comment.