nextcloud / android

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

Grid view with pictures bombs #10837

Closed jrhellriegeljr closed 2 years ago

jrhellriegeljr commented 2 years ago

⚠️ Before posting ⚠️

Steps to reproduce

Using new Nextcloud Android app open a folder that has pictures, turn on grid view.

Expected behaviour

Grid view displays thumbnails of pictures.

Actual behaviour

App crashes.

Cause of error

Exception in thread "main" java.lang.ClassCastException: com.owncloud.android.ui.adapter.OCFileListGridImageViewHolder cannot be cast to com.owncloud.android.ui.adapter.ListGridImageViewHolder
    at com.owncloud.android.ui.adapter.OCFileListAdapter.onBindViewHolder(OCFileListAdapter.java:362)
    at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7254)
    at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7337)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6194)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6460)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6300)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6296)
    at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2330)
    at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:572)
    at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
    at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
    at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
    at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
    at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4012)
    at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4578)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:689)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:374)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:312)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
    at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1818)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1584)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:148)
    at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
    at com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:2227)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at androidx.drawerlayout.widget.DrawerLayout.onLayout(DrawerLayout.java:1263)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:374)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:312)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:374)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:312)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:374)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:312)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:374)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:312)
    at com.android.internal.policy.DecorView.onLayout(DecorView.java:1331)
    at android.view.View.layout(View.java:24461)
    at android.view.ViewGroup.layout(ViewGroup.java:7412)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:4614)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4036)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2924)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10513)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108)
    at android.view.Choreographer.doCallbacks(Choreographer.java:866)
    at android.view.Choreographer.doFrame(Choreographer.java:797)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8751)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

App information

Device information

Firmware

Android version

12

Device brand and model

Samsung Galaxy S21 Ultra

Stock or custom OS?

Stock

Nextcloud android app version

3.22.0

Nextcloud server version

24.0.6

Using a reverse proxy?

No

Android logs

No response

Server error logs

No response

Additional information

Doesn't seem to matter whether pictures arwon local or remote storage. My use case involves an SMB share but simply uploading four random pictures to a newly created folder right inside Nextcloud (no SMB storage) results in the issue as well.

List view works fine. It's grid view that's broken.

hebbet commented 2 years ago

Possible duplicate of https://github.com/nextcloud/android/issues/10825

jrhellriegeljr commented 2 years ago

Possible duplicate of https://github.com/nextcloud/android/issues/10825

Sure looks like it, sorry about that.

I hope this gets fixed quick as it really impacts the usability of the app. I'd be happy to help test for sure.

Thanks for a great product!

AlvaroBrey commented 2 years ago

Duplicate of #10825

I hope this gets fixed quick as it really impacts the usability of the app. I'd be happy to help test for sure.

Already fixed on #10829 , you can test the QA version there if you want. I will release a stable fix version this week as well