Merge pull request #924 from owncloud/add_user_agent_support
authorDavid A. Velasco <dvelasco@owncloud.com>
Wed, 25 Mar 2015 09:57:04 +0000 (10:57 +0100)
committerDavid A. Velasco <dvelasco@owncloud.com>
Wed, 25 Mar 2015 09:57:04 +0000 (10:57 +0100)
Updated after adding custom user agent support to library

1  2 
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@@ -1380,11 -1380,7 +1380,11 @@@ OnSslUntrustedCertListener, OnEnforceab
       * TODO
       */
      private void updateNavigationElementsInActionBar(OCFile chosenFile) {
 -        ActionBar actionBar = getSupportActionBar(); 
 +        ActionBar actionBar = getSupportActionBar();
 +
 +        // For adding content description tag to a title field in the action bar
 +        int actionBarTitleId = getResources().getIdentifier("action_bar_title", "id", "android");
 +
          if (chosenFile == null || mDualPane) {
              // only list of files - set for browsing through folders
              OCFile currentDir = getCurrentDir();
              actionBar.setDisplayShowTitleEnabled(!noRoot); 
              if (!noRoot) {
                  actionBar.setTitle(getString(R.string.default_display_name_for_root_folder));
 +                getWindow().getDecorView().findViewById(actionBarTitleId).setContentDescription(getString(R.string.default_display_name_for_root_folder));
              }
              actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD : ActionBar.NAVIGATION_MODE_LIST);
              actionBar.setListNavigationCallbacks(mDirectories, this);   // assuming mDirectories is updated
              actionBar.setDisplayShowTitleEnabled(true);
              actionBar.setTitle(chosenFile.getFileName());
              actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
 +            getWindow().getDecorView().findViewById(actionBarTitleId).setContentDescription(chosenFile.getFileName());
          }
      }
  
              if (file.isFolder()) {
                  return file;
              } else if (getStorageManager() != null) {
-                 String parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
+                 String parentPath = file.getRemotePath().substring(0,
+                         file.getRemotePath().lastIndexOf(file.getFileName()));
                  return getStorageManager().getFileByPath(parentPath);
              }
          }
                                                                          getAccount(), 
                                                                          getApplicationContext()
                                                                        );
-         synchFolderOp.execute(getAccount(), this, null, null);
+         synchFolderOp.execute(getAccount(), MainApp.getAppContext(), this, null, null);
          
          setSupportProgressBarIndeterminateVisibility(true);
  
       */
      public void showUntrustedCertDialog(RemoteOperationResult result) {
          // Show a dialog with the certificate info
-         SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());
+         SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError(
+                 (CertificateCombinedException)result.getException());
          FragmentManager fm = getSupportFragmentManager();
          FragmentTransaction ft = fm.beginTransaction();
          dialog.show(ft, DIALOG_UNTRUSTED_CERT);