mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
Improve UX, toggle actionbar, disable auto play
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
d2a8005a30
commit
76176583bd
2 changed files with 12 additions and 6 deletions
|
@ -211,9 +211,6 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|||
|
||||
OCFile videoOfLivePhoto = getFile().videoOfLivePhoto;
|
||||
|
||||
// Automatically play live photo
|
||||
playLivePhoto(videoOfLivePhoto);
|
||||
|
||||
// For replay functionality setOnLongClickListener
|
||||
binding.image.setOnLongClickListener(v -> {
|
||||
playLivePhoto(videoOfLivePhoto);
|
||||
|
@ -222,9 +219,9 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|||
}
|
||||
}
|
||||
|
||||
private void toggleActionBarVisibility(boolean hide) {
|
||||
private void hideActionBar() {
|
||||
PreviewImageActivity activity = (PreviewImageActivity) requireActivity();
|
||||
activity.toggleActionBarVisibility(hide);
|
||||
activity.toggleActionBarVisibility(true);
|
||||
}
|
||||
|
||||
private void playLivePhoto(OCFile file) {
|
||||
|
@ -232,7 +229,7 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|||
return;
|
||||
}
|
||||
|
||||
toggleActionBarVisibility(true);
|
||||
hideActionBar();
|
||||
|
||||
Fragment mediaFragment = PreviewMediaFragment.newInstance(file, accountManager.getUser(), 0, true, true);
|
||||
FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
|
||||
|
|
|
@ -390,9 +390,18 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
|
|||
return;
|
||||
}
|
||||
|
||||
showActionBar();
|
||||
|
||||
requireActivity().getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
|
||||
private void showActionBar() {
|
||||
Activity currentActivity = requireActivity();
|
||||
if (currentActivity instanceof PreviewImageActivity activity) {
|
||||
activity.toggleActionBarVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void setupVideoView() {
|
||||
binding.exoplayerView.setPlayer(exoPlayer);
|
||||
LinearLayout linearLayout = binding.exoplayerView.findViewById(R.id.exo_center_controls);
|
||||
|
|
Loading…
Reference in a new issue