Comments (19)
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.
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.
@mehtamanan0 Any progress on this issue?
from android.
@octacode yes im using sharedPreferences to store a boolean value that will determine the sorting option.
from android.
@mehtamanan0 I too would have done the same. 👍
from android.
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.
I will be happy to resolve this bug.
from android.
@octacode yes halfway done.
from android.
@mehtamanan0 I just wanna ask how are you actually resolving it. Shared Preferences??
from android.
@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.
@csoni111 cool , ill go over the docs once and will tell you i face any problem.
from android.
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.
Great! I'll work on it then.
from android.
@octacode Sure ! Go ahaed.
from android.
@octacode Are you working on this issue?
from android.
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.
@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.
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.
@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)
- Introduction to github actions
- Alphabetical ordering to languages in settings
- Text Capitalization problem HOT 5
- Improve Instructions in Languages.md for adding new Languages
- Inform User to Select a Server Before Selecting a Share in Settings
- Adding More Information in the File Info Dialog
- Adding Press Back Button Again To Exit App Functionality
- Adding Default System Language Option in Settings
- Scrollbar in Settings Activity Not Themed
- System Following Dark and Light Mode
- Prevent Memory Leaks
- File Info Not Opening for Recent Files
- app is not open from navigation bar(Foreground service) HOT 1
- Refresh Icon in Recent Files Activity Not Themed
- App Crashes When Video Player is Closed HOT 6
- Adding Retry Action to Snackbar when File Upload Fails
- Thumbnails Not Showing In Shares
- German Language Not Working Bug
- Build fails due to bintray HOT 1
- How about migrating the project from java to kotlin.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android.