X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/053aad5ae17a1ad7a15218c220810e6b369fea4c..a11e7fd9004d8672077d6e3db7d69b74ea46e163:/src/com/owncloud/android/ui/activity/FileDisplayActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 17504a8f..6d1524f7 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -126,6 +126,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements private OCFileListFragment mFileList; private boolean mDualPane; + private boolean mBackFromCreatingFirstAccount; private static final int DIALOG_SETUP_ACCOUNT = 0; private static final int DIALOG_CREATE_DIR = 1; @@ -241,6 +242,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements // show changelog, if needed //showChangeLog(); + mBackFromCreatingFirstAccount = false; Log.d(getClass().toString(), "onCreate() end"); } @@ -590,6 +592,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements if (mDualPane) { initFileDetailsInDualPane(); } + mBackFromCreatingFirstAccount = true; } // Listen for sync messages @@ -753,9 +756,21 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements break; } case DIALOG_CHOOSE_UPLOAD_SOURCE: { - final String[] items = { getString(R.string.actionbar_upload_files), - getString(R.string.actionbar_upload_from_apps), - getString(R.string.actionbar_failed_instant_upload) }; + + String[] items = null; + + String[] allTheItems = { getString(R.string.actionbar_upload_files), + getString(R.string.actionbar_upload_from_apps), + getString(R.string.actionbar_failed_instant_upload) }; + + String[] commonItems = { getString(R.string.actionbar_upload_files), + getString(R.string.actionbar_upload_from_apps) }; + + if (InstantUploadActivity.IS_ENABLED) + items = allTheItems; + else + items = commonItems; + builder = new AlertDialog.Builder(this); builder.setTitle(R.string.actionbar_upload); builder.setItems(items, new DialogInterface.OnClickListener() { @@ -775,7 +790,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(Intent.createChooser(action, getString(R.string.upload_chooser_title)), ACTION_SELECT_CONTENT_FROM_APPS); - } else if (item == 2) { + } else if (item == 2 && InstantUploadActivity.IS_ENABLED) { Account account = AccountUtils.getCurrentOwnCloudAccount(FileDisplayActivity.this); Intent action = new Intent(FileDisplayActivity.this, InstantUploadActivity.class); action.putExtra(FileUploader.KEY_ACCOUNT, account); @@ -966,6 +981,13 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements } setSupportProgressBarIndeterminateVisibility(inProgress); + if (mBackFromCreatingFirstAccount) { + // awful patch to fix problem with visibility of progress circle with the first refresh of the first account + // TODO - kill this Activity when the first account has to be created instead of stack the account creation on it + getSupportActionBar().hide(); + getSupportActionBar().show(); + mBackFromCreatingFirstAccount = false; + } removeStickyBroadcast(intent); }