Click on OC icon shows the navigation drawer if the current folder isn't the root folder

This commit is contained in:
masensio 2015-05-28 14:43:30 +02:00
parent d05160c1e2
commit d789d304e3
2 changed files with 17 additions and 7 deletions

View file

@ -609,8 +609,8 @@ public class FileActivity extends ActionBarActivity
*/
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
Log_OC.d(TAG, "Received result of operation in FileActivity - common behaviour for all the " +
"FileActivities ");
Log_OC.d(TAG, "Received result of operation in FileActivity - common behaviour for all the "
+ "FileActivities ");
mFileOperationsHelper.setOpIdWaitingFor(Long.MAX_VALUE);

View file

@ -520,11 +520,19 @@ public class FileDisplayActivity extends HookActivity implements
break;
}
case android.R.id.home: {
FileFragment second = getSecondFragment();
OCFile currentDir = getCurrentDir();
if((currentDir != null && currentDir.getParentId() != 0) ||
(second != null && second.getFile() != null)) {
onBackPressed();
} else {
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
} else {
mDrawerLayout.openDrawer(GravityCompat.START);
}
}
break;
}
case R.id.action_sort: {
@ -843,7 +851,8 @@ public class FileDisplayActivity extends HookActivity implements
registerReceiver(mUploadFinishReceiver, uploadIntentFilter);
// Listen for download messages
IntentFilter downloadIntentFilter = new IntentFilter(FileDownloader.getDownloadAddedMessage());
IntentFilter downloadIntentFilter = new IntentFilter(
FileDownloader.getDownloadAddedMessage());
downloadIntentFilter.addAction(FileDownloader.getDownloadFinishMessage());
mDownloadFinishReceiver = new DownloadFinishReceiver();
registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
@ -965,7 +974,8 @@ public class FileDisplayActivity extends HookActivity implements
// current folder was removed from the server
Toast.makeText( FileDisplayActivity.this,
String.format(
getString(R.string.sync_current_folder_was_removed),
getString(R.string.
sync_current_folder_was_removed),
mDirectories.getItem(0)),
Toast.LENGTH_LONG)
.show();