Git Product home page Git Product logo

Comments (19)

csoni111 avatar csoni111 commented on August 20, 2024 3

According to me this would not be a good idea. Let's suppose you have hundreds of folders inside folders, storing a boolean for all of them in SharedPreferences does not look good. A better way could be to have an internal database in the app preferably Realm or sqlite. This will also be scalable so that one can store more data in the app if required in the future.

Also consider a case where two folder in different directories have same name, so differentiating them in SharedPreferences would be difficult.

Another issue would occur when a folder will be deleted from the share, how would you know to remove it from SharedPreferences too?

from android.

csoni111 avatar csoni111 commented on August 20, 2024 3

Realm is a much better option than sqlite, with that we can save the model objects as is in the db. No need to declare any tables/columns. Also writing queries is much easier as it's all in java and gives a cleaner code to maintain. If you have never used Realm before just read the docs once, it's quite easy to use.

PS: I can help if you need any.

from android.

octacode avatar octacode commented on August 20, 2024 1

@mehtamanan0 Any progress on this issue?

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024 1

@octacode yes im using sharedPreferences to store a boolean value that will determine the sorting option.

from android.

octacode avatar octacode commented on August 20, 2024 1

@mehtamanan0 I too would have done the same. 👍

from android.

arihant-001 avatar arihant-001 commented on August 20, 2024 1

In most file browsers, there is a default sort option, if the user changes the sort options for a particular directory, then it changes to all the directories.
@cpg implementation for this would be simple enough.

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024

I will be happy to resolve this bug.

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024

@octacode yes halfway done.

from android.

octacode avatar octacode commented on August 20, 2024

@mehtamanan0 I just wanna ask how are you actually resolving it. Shared Preferences??

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024

@csoni111 good that you pointed this out , yes even i think in my opinion sqlite would be a better option for this, as these sharedpreferences might be wasted.I think ill port over to sqlite then.

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024

@csoni111 cool , ill go over the docs once and will tell you i face any problem.

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024

I have been to caught up with studies as i have ongoing exams so it's been very hard to work on things from my side, I would like any of you all to take over this Issue. Ill be back once my exams get over.

from android.

octacode avatar octacode commented on August 20, 2024

Great! I'll work on it then.

from android.

mehtamanan0 avatar mehtamanan0 commented on August 20, 2024

@octacode Sure ! Go ahaed.

from android.

adithya321 avatar adithya321 commented on August 20, 2024

@octacode Are you working on this issue?

from android.

adi23arora avatar adi23arora commented on August 20, 2024

I don't understand why we need to store the sort type for each folder, because we can just use a universal sort type which will be used in every folder and will be remembered whenever changed.
@csoni111 Can you help me with this?

from android.

csoni111 avatar csoni111 commented on August 20, 2024

@adi23arora Well it was a feature request from amahi users.

@cpg Do we really need this feature? If yes, can the folder sorting preferences be stored on the server side because it would make much more sense if we were to store it with the other data for each folder on the server side rather than in the app as here we will have to string match the names of the folder one by one and then there's problem with the deletion of a folder. Also if the app is uninstalled, all data will be lost.

from android.

cpg avatar cpg commented on August 20, 2024

Presentation is really not the server's job, much less user-preferences for presentation, so I don't agree that storing this (on a per user basis!) on the server makes more sense.

This is just a small convenience. We don't have to implement it. Seems like too much trouble/work for a small convenience.

from android.

adi23arora avatar adi23arora commented on August 20, 2024

@cpg As discussed, storing sorting preferences for each separate folder is a bit complex to implement and less feasible.

But what I suggest is using a universal sort type on each folder and remembering it whenever it is changed. This approach is used by most of the file explorer apps. This could provide some convenience to app users.

For example, if a user wants to find a recent file stored several folders deep, then he sorts the parent folder by modification time and automatically the same sort type will be applied to all sub-folders so that user won't have to switch sort type on each sub-folder.

from android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.