mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
Add tooltip to live photo indicator
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
76176583bd
commit
d2d7865f60
2 changed files with 9 additions and 1 deletions
|
@ -83,6 +83,7 @@ import javax.inject.Inject;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.widget.TooltipCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
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 ignoreFirstSavedState Flag to work around an unexpected behaviour of {@link FragmentStatePagerAdapter} ;
|
||||
* TODO better solution
|
||||
* TODO better solution
|
||||
*/
|
||||
public static PreviewImageFragment newInstance(@NonNull OCFile imageFile,
|
||||
boolean ignoreFirstSavedState,
|
||||
|
@ -208,6 +209,7 @@ public class PreviewImageFragment extends FileFragment implements Injectable {
|
|||
|
||||
if (livePhoto != null) {
|
||||
binding.livePhotoIndicator.setVisibility(View.VISIBLE);
|
||||
addTooltipToLivePhotoIndicator();
|
||||
|
||||
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() {
|
||||
PreviewImageActivity activity = (PreviewImageActivity) requireActivity();
|
||||
activity.toggleActionBarVisibility(true);
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
<string name="uploader_upload_files_behaviour_upload_and_delete_from_source">Delete file from source folder</string>
|
||||
<string name="file_list_seconds_ago">seconds ago</string>
|
||||
<string name="file_list_live">LIVE</string>
|
||||
<string name="live_photo_indicator_tooltip">Long-press the image to activate live photo playback</string>
|
||||
<string name="file_list_empty_headline">No files here</string>
|
||||
<string name="folder_list_empty_headline">No folders here</string>
|
||||
<string name="file_list_empty">Upload some content or sync with your devices.</string>
|
||||
|
|
Loading…
Reference in a new issue