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 @Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
Log_OC.d(TAG, "Received result of operation in FileActivity - common behaviour for all the " + Log_OC.d(TAG, "Received result of operation in FileActivity - common behaviour for all the "
"FileActivities "); + "FileActivities ");
mFileOperationsHelper.setOpIdWaitingFor(Long.MAX_VALUE); mFileOperationsHelper.setOpIdWaitingFor(Long.MAX_VALUE);

View file

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