Repository navigation
"Only available offline" added to Drawer - #2468
Conversation
| } | ||
|
|
||
| public Vector<OCFile> getFolderContent(OCFile f/*, boolean onlyOnDevice*/) { | ||
| public Vector<OCFile> getFolderContent(OCFile f, boolean onlyAvailableOffline/*, boolean onlyOnDevice*/) { |
There was a problem hiding this comment.
I would remove /*, boolean onlyOnDevice*/, if we need it in the future, we will include it. And please delete all the // TODO Enable when "On Device" is recovered occurrences as well as the code related to it.
| if (f != null && f.isFolder() && f.getFileId() != -1) { | ||
| // TODO Enable when "On Device" is recovered ? | ||
| return getFolderContent(f.getFileId()/*, onlyOnDevice*/); | ||
| return getFolderContent(f.getFileId(), onlyAvailableOffline/*, onlyOnDevice*/); |
| // TODO better implementation, filtering in the access to database instead of here | ||
| // TODO Enable when "On Device" is recovered ? | ||
| Vector<OCFile> tmp = getFolderContent(folder/*, onlyOnDevice*/); | ||
| Vector<OCFile> tmp = getFolderContent(folder,false/*, onlyOnDevice*/); |
There was a problem hiding this comment.
Leave a space between folder and false. I'd highly recommend you to use the Android Studio option Code -> Reformat code to avoid some style issues in the future. Besides, delete /*, onlyOnDevice*/
| // stage 1: remove the local files already registered in the files database | ||
| // TODO Enable when "On Device" is recovered ? | ||
| Vector<OCFile> files = getFolderContent(folder.getFileId()/*, false*/); | ||
| Vector<OCFile> files = getFolderContent(folder.getFileId(), false/*, false*/); |
|
|
||
| private Vector<OCFile> getFolderContent(long parentId/*, boolean onlyOnDevice*/) { | ||
|
|
||
| private Vector<OCFile> getFolderContent(long parentId, boolean onlyAvailableOffline/*, boolean onlyOnDevice*/) { |
There was a problem hiding this comment.
Delete /*, boolean onlyOnDevice*/
| if (mFile != null) { | ||
| // TODO Enable when "On Device" is recovered ? | ||
| Vector<OCFile> files = getStorageManager().getFolderContent(mFile/*, false*/); | ||
| Vector<OCFile> files = getStorageManager().getFolderContent(mFile, false/*, false*/); |
| file.getFileLength(), mContext | ||
| )); | ||
|
|
||
| if(!mOnlyAvailableOffline){ |
There was a problem hiding this comment.
Reformat code in this file
| file.getFileLength(), mContext | ||
| )); | ||
| }else{ | ||
| lastModV.setVisibility(View.VISIBLE); |
There was a problem hiding this comment.
This call is present when mOnlyAvailableOffline is both true and false so can be move out of the if, else. Check the other calls just in case.
| return ((args != null) && args.getBoolean(ARG_JUST_FOLDERS, false)); | ||
| } | ||
|
|
||
| protected boolean isShowingOnlyAvailableOffline() { |
|
|
||
| // If available offline option and folder is not available offline -> list root | ||
| if(!directory.isAvailableOffline() && isShowingOnlyAvailableOffline()){ | ||
| directory = storageManager.getFileByPath("/"); |
There was a problem hiding this comment.
Use ROOT_PATH instead of "/" from OCFile.java, as you did in https://github.com/owncloud/android/pull/2468/files#diff-40f7abdfcc80dfb05e4299636743b71aR730
|
@abelgardep have a look at the changes requested The av. offline icon does not look that good, it's too much clear. Since I provided you the icons, I've already replaced them so you just have to take care of the rest of the changes. |
|
@davigonz I've applied the changes requested |
|
|
||
| // Create result cursor before syncing folder again, in order to enable faster loading | ||
| for (OCFile file : mCurrentStorageManager.getFolderContent(browsedDir)) { | ||
| for (OCFile file : mCurrentStorageManager.getFolderContent(browsedDir,false)) { |
There was a problem hiding this comment.
This is still pending, space after browsedDir,
| Vector<OCFile> findFiles(OCFile root, String query) { | ||
| Vector<OCFile> result = new Vector<OCFile>(); | ||
| for (OCFile f : mCurrentStorageManager.getFolderContent(root)) { | ||
| for (OCFile f : mCurrentStorageManager.getFolderContent(root,false)) { |
| case R.id.nav_only_available_offline: ; | ||
| menuItem.setChecked(true); | ||
| mCheckedMenuItem = menuItem.getItemId(); | ||
|
|
| file.getFileLength(), mContext | ||
| )); | ||
| if (!mOnlyAvailableOffline) { | ||
|
|
There was a problem hiding this comment.
Why this extra line here?
| @@ -136,7 +137,7 @@ protected void onAccountSet(boolean stateWasRecovered) { | |||
|
|
|||
There was a problem hiding this comment.
There's still some // TODO Enable when "On Device" is recovered ? code in this class
|
@abelgardep a couple of changes more and ready for QA |
|
@davigonz Done |
|
@jesmrec ready to test |
|
Let's start with the QA |
(2) [FIXED]In terms of usability, the av. offline view should have an option to move back to the file list. Actually, the way is by opening the drawer and selecting "All files". But, it needs two taps to go back. Here, i see two options:
If the favourite option is the 1., the 2. should be addressed as well to go back. What do you think? CC @davigonz |
I would go this way since is how the app also behaves when tapping back button from Uploads view. Changing the hamburguer button to a back arrow does not look that natural from a user point of view when switching between different side menu options. |
41052e3 to
efafa8d
Compare
|
Everything fixed and 2nd QA round done. Approved. |




Implements #407
BUGS & IMRPOVEMENTS