nextcloud / android

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

Automatically switch to grid view for folders that contain only files of type media #2646

Open godfuture opened 6 years ago

godfuture commented 6 years ago

Actual behaviour

With Nextcloud I started to share quite a lot of my photos. Others upload photos as well. So I start having more and more folders filled with photos. As there are close to non open source webdav based gallery apps out there, the Nextcloud for android gets my primary photo gallery app. But it still has a drawback. I manually have to switch folders to grid view even there are no other files than photos. The grid view is by far the best view to watch photos. Other file functions are (luckily) also available in this view.

Expected behaviour

The Nextcloud android app checks the type of all files that should be displayed in the current folder. If all files are from type "media", switch to the grid view automatically. Also nice: for someone who doesnt like this smart detection, an option in settings could prevent it.

Steps to reproduce

  1. Create a folder on the server
  2. Upload only fotos
  3. Navigate in the android app to this folder
  4. Check if the folder is open in grid view

Environment data

Android version: 7.1.2

Device model: BQ X5P

Stock or customized system: LineageOS

Nextcloud app version: 3.1.0

Nextcloud server version: 13.0.1

Logs

Web server error log

-

Nextcloud log (data/nextcloud.log)

-
AndyScherzinger commented 6 years ago

Thanks for the report @godfuture

This is in my opinion a bug then since this is actually how the client should behave and has behaved in the past.

@tobiasKaminsky maybe we lost this feature with the move to per-folder view/sorting options while then without an explicitly set view type (by the user) the app should to the detection and choose the right view type. What do you think?

tobiasKaminsky commented 6 years ago

Afaik this is something we never had in it nor discussed this. What we have is that if you specify a folder as "grid view" then all subfolders are also shown as "grid view" unless you manually override this.

However, this idea is nice and should easily extend the above behaviour:

But this then would clash with our current "if no layout is specified for current folder, then take it from parent (up to root)":

--> do we override then the decision made by the user that he always wants to have list view? Of course, if he clicks one time on list view, it is remembered…

While thinking about it, I guess it is ok to enforce it for the first time.

AndyScherzinger commented 6 years ago

Soudns good to me. @tobiasKaminsky: I always thought that you did implement this back in the oC days but I might have been mistaken.

mario commented 6 years ago

I'm never sure about this. We already have so much complexity regarding list/grid...do we really want more? xD

tobiasKaminsky commented 6 years ago

It boils down to this: https://github.com/nextcloud/android/blob/b7a45a8ce8c6b1cde5acb492946b879641b707c1/src/main/java/com/owncloud/android/db/PreferenceManager.java#L228-L259

I think we have far more complex things in it ;-)