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