nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.15k stars 1.75k forks source link

Unexpected behavior (all files layout displayed) after clicking on details in media tab #12163

Open JonasMayerDev opened 9 months ago

JonasMayerDev commented 9 months ago

⚠️ Before posting ⚠️

Steps to reproduce

  1. Go to media tab
  2. Click on Image that is located in a folder (root images have still unexpected behavior but not all files layout)
  3. Click on three dots -> Details
  4. Click on back to leave image view First Issue: Back Arrow is visible at the top
  5. Click on back again All Files Layout including "+" button is visible. App crashes when clicking "+"-button

Expected behaviour

After exiting the detail/ image view the media tab should behave like always

Actual behaviour

The media tab has the all files layout and crashes when interacted with e.g. "+"-Button. The menu also displays "all files" as selected but media tab is still open. Screenshot_2023-11-13-16-31-53-91_367f977887f4a5f4712ef04f9b973e21

Android version

12

Device brand and model

OnePlus Nord 2

Stock or custom OS?

Stock

Nextcloud android app version

3.26.0 (and current master)

Nextcloud server version

27.1.3.2

Using a reverse proxy?

I don't know

Android logs

Cause of error

Exception in thread "main" java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.owncloud.android.datamodel.OCFile.isEncrypted()' on a null object reference
    at com.owncloud.android.ui.fragment.OCFileListBottomSheetDialog.onCreate(OCFileListBottomSheetDialog.java:107)
    at android.app.Dialog.dispatchOnCreate(Dialog.java:450)
    at android.app.Dialog.show(Dialog.java:332)
    at com.owncloud.android.ui.fragment.OCFileListFragment.lambda$registerFabListener$2(OCFileListFragment.java:503)
    at com.owncloud.android.ui.fragment.OCFileListFragment.$r8$lambda$5tKZbsun13Yjq-4N9PoDf-52bAc(Unknown Source:0)
    at com.owncloud.android.ui.fragment.OCFileListFragment$$ExternalSyntheticLambda6.onClick(Unknown Source:4)
    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)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

App information

Device information

Firmware

Server error logs

No response

Additional information

Log from crash when clicking on "+"-Button

alperozturk96 commented 9 months ago

Problem

When user tap details from image preview it navigates to file display activity then open media list again. Basically due misused navigation we are having this problem.

FileDisplayActivity -> Open Drawer -> Media -> Select Image -> Three Dots From Top Right -> Details -> Press Back -> start FileDisplayActivity again ...

Instead

We can just popback rather than push and start activity again.

Solution

I discussed with @tobiasKaminsky we want to solve problem right way rather than workaround fix. Navigation stack should be fixed via Jetpack Navigation library. Related issue