|
@@ -83,6 +83,7 @@ import javax.inject.Inject;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.StringRes;
|
|
import androidx.annotation.StringRes;
|
|
|
|
+import androidx.appcompat.widget.TooltipCompat;
|
|
import androidx.core.content.ContextCompat;
|
|
import androidx.core.content.ContextCompat;
|
|
import androidx.core.content.res.ResourcesCompat;
|
|
import androidx.core.content.res.ResourcesCompat;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.Fragment;
|
|
@@ -140,7 +141,7 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|
*
|
|
*
|
|
* @param imageFile An {@link OCFile} to preview as an image in the fragment
|
|
* @param imageFile An {@link OCFile} to preview as an image in the fragment
|
|
* @param ignoreFirstSavedState Flag to work around an unexpected behaviour of {@link FragmentStatePagerAdapter} ;
|
|
* @param ignoreFirstSavedState Flag to work around an unexpected behaviour of {@link FragmentStatePagerAdapter} ;
|
|
- * TODO better solution
|
|
|
|
|
|
+ * TODO better solution
|
|
*/
|
|
*/
|
|
public static PreviewImageFragment newInstance(@NonNull OCFile imageFile,
|
|
public static PreviewImageFragment newInstance(@NonNull OCFile imageFile,
|
|
boolean ignoreFirstSavedState,
|
|
boolean ignoreFirstSavedState,
|
|
@@ -208,6 +209,7 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|
|
|
|
|
if (livePhoto != null) {
|
|
if (livePhoto != null) {
|
|
binding.livePhotoIndicator.setVisibility(View.VISIBLE);
|
|
binding.livePhotoIndicator.setVisibility(View.VISIBLE);
|
|
|
|
+ addTooltipToLivePhotoIndicator();
|
|
|
|
|
|
OCFile videoOfLivePhoto = getFile().videoOfLivePhoto;
|
|
OCFile videoOfLivePhoto = getFile().videoOfLivePhoto;
|
|
|
|
|
|
@@ -219,6 +221,11 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void addTooltipToLivePhotoIndicator() {
|
|
|
|
+ TooltipCompat.setTooltipText(binding.livePhotoIndicator, requireContext().getString(R.string.live_photo_indicator_tooltip));
|
|
|
|
+ binding.livePhotoIndicator.setOnClickListener(v -> binding.livePhotoIndicator.performLongClick());
|
|
|
|
+ }
|
|
|
|
+
|
|
private void hideActionBar() {
|
|
private void hideActionBar() {
|
|
PreviewImageActivity activity = (PreviewImageActivity) requireActivity();
|
|
PreviewImageActivity activity = (PreviewImageActivity) requireActivity();
|
|
activity.toggleActionBarVisibility(true);
|
|
activity.toggleActionBarVisibility(true);
|