Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Photo #12139

Merged
merged 118 commits into from
Dec 8, 2023
Merged

Live Photo #12139

merged 118 commits into from
Dec 8, 2023

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Nov 6, 2023

Resolves #12124

Live Photo Indicator List View:
list_

Live Photo Indicator Grid View:
grid_

Live Photo Indicator List View SFSymbol Alternative:
1

Live Photo Indicator Grid View SFSymbol Alternative:
2

@nextcloud/designers How does the live photo indicator look? I think the position and color can be better, but nothing come in my mind in this regard.

  • Tests written, or not not needed

Signed-off-by: alperozturk <[email protected]>
@AndyScherzinger
Copy link
Member

@alperozturk96 the icon is: https://developer.apple.com/live-photos/ So I would just use that, no?

See https://thenounproject.com/browse/icons/term/live-photo/ for svg resources, maybe @jancborchardt or @nimishavijay can pick one? :)

@alperozturk96
Copy link
Collaborator Author

@AndyScherzinger I agree that icon more suitable. @tobiasKaminsky suggested that icon. If it's okay for all of us I can change.

@jancborchardt
Copy link
Member

This icon seems to be the closest to Apple’s live photo icon: https://thenounproject.com/icon/play-live-photo-710577/

@alperozturk96
Copy link
Collaborator Author

Icons updated @AndyScherzinger @jancborchardt

@jancborchardt
Copy link
Member

@alperozturk96 sorry, the actual icon Apple uses is https://thenounproject.com/icon/live-photo-710576/, not the one with the play icon, my mistake.

Also, the iOS Photos app only shows the "Live" indicator when in the photo detail view, not overlaid on each photo as this makes the grid view very busy. I would say we should do it similarly to keep it clean and focused on the photos.

https://support.apple.com/en-gb/HT207310

android:paddingStart="@dimen/standard_half_padding"
android:paddingEnd="@dimen/alternate_padding"
android:src="@drawable/ic_checkbox_blank_outline" />

<ImageView
android:id="@+id/overflow_menu"
android:layout_width="48dp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

48dp is needed for Accessibility, icon hitboxes need to be at least 48dp in size

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a dimens value for that also 👍

@AndyScherzinger
Copy link
Member

@jancborchardt i.e. amazon is showing it, which I think makes sense, since we are not the Apple Image viewer but a general EFSS in this case, so if we then hide the mov file in these file lists than we might want to indicate a live photo as such, no?

@AndyScherzinger
Copy link
Member

For the overlay in the grid view this definitely needs a background container to "punch out" the icon, else it is extremely hard to spot. So I would suggest just using the background color (surface), semi-transparent might look strange, on the other hand the share icon has the same issue too.

@jancborchardt

@jancborchardt
Copy link
Member

Ok, then if we show it I would say

  • Position: bottom left of the preview, with some padding to the sides
  • Style-wise do it like Apple, semi-transparent grey backdrop so the icon has contrast

@AndyScherzinger
Copy link
Member

Style-wise do it like Apple, semi-transparent grey backdrop so the icon has contrast

@jancborchardt can maybe @marcoambrosini check how Apple displays it on dark mode (since I only have Android)

@marcoambrosini
Copy link
Member

@AndyScherzinger is this what you need?

Screenshot 2023-11-07 at 10 46 49

@AndyScherzinger
Copy link
Member

@AndyScherzinger is this what you need?

perfect, yes, thanks @marcoambrosini 👍

@@ -35,7 +35,7 @@
*/
public class ProviderMeta {
public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 73;
public static final int DB_VERSION = 75;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB version bump by 2? Also where is the new json schema for DB?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was testing. Multiple times I came across with conflict and I was increasing one by one whenever I got that issue. I remember first one was 74 then I put 75 nevertheless after complete all implementation I am going to check all changes. Thanks for the early notice.

Signed-off-by: tobiasKaminsky <[email protected]>
@JonasMayerDev
Copy link
Collaborator

Hi, I noticed some bugs.

  1. Live icon seems odd to me when live photo is opened (is there supposed to be a text?)
  2. Clicking on live icon multiple times when opened crashes app (and leads to unexpected behavior) -> Just not listen to clicks when video is playing?
Record_2023-12-06-12-04-08.mp4
  1. Options Button in opened live photo crashes the app for me.
Record_2023-12-06-12-04-31.mp4

Copy link
Collaborator

@JonasMayerDev JonasMayerDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix described bugs

@alperozturk96
Copy link
Collaborator Author

Hi, I noticed some bugs.

  1. Live icon seems odd to me when live photo is opened (is there supposed to be a text?)
  2. Clicking on live icon multiple times when opened crashes app (and leads to unexpected behavior) -> Just not listen to clicks when video is playing?

Record_2023-12-06-12-04-08.mp4
3. Options Button in opened live photo crashes the app for me.

Record_2023-12-06-12-04-31.mp4

Could you share crash report?

@JonasMayerDev
Copy link
Collaborator

For 2.:
2023-12-06 13:11:22.543 14499-14499 AndroidRuntime com.nextcloud.android.qa E FATAL EXCEPTION: main Process: com.nextcloud.android.qa, PID: 14499 java.lang.NullPointerException: Attempt to read from field 'com.google.android.exoplayer2.ui.StyledPlayerView com.owncloud.android.databinding.FragmentPreviewMediaBinding.exoplayerView' on a null object reference in method 'void com.owncloud.android.ui.preview.PreviewMediaFragment.lambda$onStart$1()' at com.owncloud.android.ui.preview.PreviewMediaFragment.lambda$onStart$1(PreviewMediaFragment.java:370) at com.owncloud.android.ui.preview.PreviewMediaFragment.$r8$lambda$AkxMJlf2KgePzqOIh5h57BVdLW8(Unknown Source:0) at com.owncloud.android.ui.preview.PreviewMediaFragment$$ExternalSyntheticLambda0.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

For 3.:
2023-12-06 13:14:26.365 12650-12650 AndroidRuntime com.nextcloud.android.qa E at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at android.app.Activity.onMenuItemSelected(Activity.java:4404) at androidx.activity.ComponentActivity.onMenuItemSelected(ComponentActivity.java:528) at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:264) at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:269) at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:110) at androidx.appcompat.app.AppCompatDelegateImpl.onMenuItemSelected(AppCompatDelegateImpl.java:1259) at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:836) at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:159) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:987) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:977) at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:625) at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:156) at android.view.View.performClick(View.java:7498) at android.view.View.performClickInternal(View.java:7471) at android.view.View.access$3700(View.java:843) at android.view.View$PerformClick.run(View.java:29098) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) 2023-12-06 13:14:26.365 12650-12650 AndroidRuntime com.nextcloud.android.qa E at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

I get "com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226)" a hundred time befor app actually crashes for some reason (or logger bug?)

@alperozturk96
Copy link
Collaborator Author

For 2.: 2023-12-06 13:11:22.543 14499-14499 AndroidRuntime com.nextcloud.android.qa E FATAL EXCEPTION: main Process: com.nextcloud.android.qa, PID: 14499 java.lang.NullPointerException: Attempt to read from field 'com.google.android.exoplayer2.ui.StyledPlayerView com.owncloud.android.databinding.FragmentPreviewMediaBinding.exoplayerView' on a null object reference in method 'void com.owncloud.android.ui.preview.PreviewMediaFragment.lambda$onStart$1()' at com.owncloud.android.ui.preview.PreviewMediaFragment.lambda$onStart$1(PreviewMediaFragment.java:370) at com.owncloud.android.ui.preview.PreviewMediaFragment.$r8$lambda$AkxMJlf2KgePzqOIh5h57BVdLW8(Unknown Source:0) at com.owncloud.android.ui.preview.PreviewMediaFragment$$ExternalSyntheticLambda0.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

For 3.: 2023-12-06 13:14:26.365 12650-12650 AndroidRuntime com.nextcloud.android.qa E at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226) at android.app.Activity.onMenuItemSelected(Activity.java:4404) at androidx.activity.ComponentActivity.onMenuItemSelected(ComponentActivity.java:528) at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:264) at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:269) at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:110) at androidx.appcompat.app.AppCompatDelegateImpl.onMenuItemSelected(AppCompatDelegateImpl.java:1259) at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:836) at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:159) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:987) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:977) at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:625) at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:156) at android.view.View.performClick(View.java:7498) at android.view.View.performClickInternal(View.java:7471) at android.view.View.access$3700(View.java:843) at android.view.View$PerformClick.run(View.java:29098) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8248) at java.lang.reflect.Method.invoke(Native Method) 2023-12-06 13:14:26.365 12650-12650 AndroidRuntime com.nextcloud.android.qa E at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

I get "com.owncloud.android.ui.preview.PreviewImageActivity.onOptionsItemSelected(PreviewImageActivity.java:226)" a hundred time befor app actually crashes for some reason (or logger bug?)

This bug fixed in this PR already

Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Copy link

github-actions bot commented Dec 8, 2023

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12139.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Copy link

github-actions bot commented Dec 8, 2023

Codacy

Lint

TypemasterPR
Warnings7573
Errors33

SpotBugs

CategoryBaseNew
Bad practice2626
Correctness6868
Dodgy code360360
Experimental22
Internationalization99
Malicious code vulnerability22
Multithreaded correctness99
Performance5855
Security1818
Total552549

@tobiasKaminsky tobiasKaminsky merged commit fa07aad into master Dec 8, 2023
19 of 20 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feature/live-photo branch December 8, 2023 13:17
@tobiasKaminsky
Copy link
Member

/backport to stable-3.27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement live photo
6 participants