Merge branch 'develop' into forbidden_characters_from_server
authormasensio <masensio@solidgear.es>
Mon, 15 Jun 2015 12:51:13 +0000 (14:51 +0200)
committermasensio <masensio@solidgear.es>
Mon, 15 Jun 2015 12:51:13 +0000 (14:51 +0200)
Conflicts:
owncloud-android-library
src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java
src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java

1  2 
owncloud-android-library
res/values/strings.xml
src/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java
src/com/owncloud/android/ui/dialog/RenameFileDialogFragment.java

diff --combined owncloud-android-library
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 4ca0ff2203a84173dca984632a1131170a169f08
 -Subproject commit 639cb7eacdae0b4b6dddbd8f446d8d42eb2617b5
++Subproject commit 060ca75f17c90b7c083bdeb8ba7376cf15f8c7ec
diff --combined res/values/strings.xml
        <!-- TODO re-enable when server-side folder size calculation is available   
        <item>Biggest - Smallest</item>  -->
      </string-array>
+     <!-- TODO re-enable when "Accounts" is available in Navigation Drawer -->
+     <!--<string name="drawer_item_accounts">Accounts</string>-->
+     <string name="drawer_item_all_files">All files</string>
+     <!-- TODO re-enable when "On Device" is available
+     <string name="drawer_item_on_device">On device</string>-->
+     <string name="drawer_item_settings">Settings</string>
+     <string name="drawer_item_logs">Logs</string>
+       <string name="drawer_close">Close</string>
      <string name="prefs_category_general">General</string>
      <string name="prefs_category_more">More</string>
      <string name="prefs_accounts">Accounts</string>
@@@ -78,6 -86,7 +86,7 @@@
      <string name="filedetails_download">Download</string>
      <string name="filedetails_sync_file">Refresh file</string>
      <string name="filedetails_renamed_in_upload_msg">File was renamed to %1$s during upload</string>
+     <string name="list_layout">List Layout</string>
      <string name="action_share_file">Share link</string>
      <string name="action_unshare_file">Unshare link</string>
      <string name="common_yes">Yes</string>
      <string name="sync_file_nothing_to_do_msg">File contents already synchronized</string>
      <string name="create_dir_fail_msg">Folder could not be created</string>
      <string name="filename_forbidden_characters">Forbidden characters: / \\ &lt; &gt; : " | ? *</string>
 +    <string name="filename_forbidden_charaters_from_server">File name contains at least one invalid character</string>
      <string name="filename_empty">File name cannot be empty</string>
      <string name="wait_a_moment">Wait a moment</string>
      <string name="filedisplay_unexpected_bad_get_content">"Unexpected problem ; please select the file from a different app"</string>
        <string name="prefs_instant_video_upload_path_title">Upload Video Path</string>
      <string name="download_folder_failed_content">Download of %1$s folder could not be completed</string>
  
-       <string name="subject_token">%1$s shared \"%2$s\" with you</string>
+       <string name="shared_subject_header">shared</string>
+       <string name="with_you_subject_header">with you</string>
+     
+       <string name="subject_token">%1$s %2$s &gt;&gt;%3$s&lt;&lt; %4$s</string>
  
      <string name="auth_refresh_button">Refresh connection</string>
      <string name="auth_host_address">Server address</string>
      <string name="common_error_out_memory">Not enough memory</string>
  
+     <string name="username">Username</string>
  </resources>
@@@ -20,8 -20,6 +20,6 @@@
  
  package com.owncloud.android.ui.dialog;
  
- import com.actionbarsherlock.app.SherlockDialogFragment;
- import com.owncloud.android.MainApp;
  import com.owncloud.android.R;
  import com.owncloud.android.datamodel.OCFile;
  import com.owncloud.android.lib.resources.files.FileUtils;
@@@ -31,6 -29,7 +29,7 @@@ import android.app.AlertDialog
  import android.app.Dialog;
  import android.content.DialogInterface;
  import android.os.Bundle;
+ import android.support.v4.app.DialogFragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.WindowManager.LayoutParams;
@@@ -43,8 -42,8 +42,8 @@@ import android.widget.Toast
   * 
   *  Triggers the folder creation when name is confirmed.
   */
- public class CreateFolderDialogFragment 
extends SherlockDialogFragment implements DialogInterface.OnClickListener {
+ public class CreateFolderDialogFragment
        extends DialogFragment implements DialogInterface.OnClickListener {
  
      private static final String ARG_PARENT_FOLDER = "PARENT_FOLDER";
      
@@@ -52,9 -51,9 +51,9 @@@
  
      /**
       * Public factory method to create new CreateFolderDialogFragment instances.
--     * 
 -     * @param parentFolder    Folder to create
 -     * @return                Dialog ready to show.
++     *
 +     * @param parentFolder            Folder to create
 +     * @return                        Dialog ready to show.
       */
      public static CreateFolderDialogFragment newInstance(OCFile parentFolder) {
          CreateFolderDialogFragment frag = new CreateFolderDialogFragment();
@@@ -73,7 -72,7 +72,7 @@@
          mParentFolder = getArguments().getParcelable(ARG_PARENT_FOLDER);
          
          // Inflate the layout for the dialog
-         LayoutInflater inflater = getSherlockActivity().getLayoutInflater();
+         LayoutInflater inflater = getActivity().getLayoutInflater();
          View v = inflater.inflate(R.layout.edit_box_dialog, null);
          
          // Setup layout 
@@@ -82,7 -81,7 +81,7 @@@
          inputText.requestFocus();
          
          // Build the dialog  
-         AlertDialog.Builder builder = new AlertDialog.Builder(getSherlockActivity());
+         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
          builder.setView(v)
                 .setPositiveButton(R.string.common_ok, this)
                 .setNegativeButton(R.string.common_cancel, this)
              
              if (newFolderName.length() <= 0) {
                  Toast.makeText(
-                         getSherlockActivity(), 
+                         getActivity(),
                          R.string.filename_empty, 
                          Toast.LENGTH_LONG).show();
                  return;
              }
-             boolean serverWithForbiddenChars = ((ComponentsGetter)getSherlockActivity()).
 -            
 -            if (!FileUtils.isValidName(newFolderName)) {
 -                Toast.makeText(
 -                        getActivity(),
 -                        R.string.filename_forbidden_characters, 
 -                        Toast.LENGTH_LONG).show();
++            boolean serverWithForbiddenChars = ((ComponentsGetter)getActivity()).
 +                    getFileOperationsHelper().isVersionWithForbiddenCharacters();
 +
 +            if (!FileUtils.isValidName(newFolderName, serverWithForbiddenChars)) {
 +                int messageId = 0;
 +                if (serverWithForbiddenChars) {
 +                    messageId = R.string.filename_forbidden_charaters_from_server;
 +                } else {
 +                    messageId = R.string.filename_forbidden_characters;
 +                }
-                 Toast.makeText(getSherlockActivity(), messageId, Toast.LENGTH_LONG).show();
++                Toast.makeText(getActivity(), messageId, Toast.LENGTH_LONG).show();
++
                  return;
              }
              
              String path = mParentFolder.getRemotePath();
              path += newFolderName + OCFile.PATH_SEPARATOR;
-             ((ComponentsGetter)getSherlockActivity()).
+             ((ComponentsGetter)getActivity()).
                  getFileOperationsHelper().createFolder(path, false);
          }
      }
@@@ -29,6 -29,7 +29,7 @@@ import android.app.AlertDialog
  import android.app.Dialog;
  import android.content.DialogInterface;
  import android.os.Bundle;
+ import android.support.v4.app.DialogFragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.WindowManager.LayoutParams;
@@@ -36,7 -37,6 +37,6 @@@ import android.widget.EditText
  import android.widget.TextView;
  import android.widget.Toast;
  
- import com.actionbarsherlock.app.SherlockDialogFragment;
  import com.owncloud.android.R;
  import com.owncloud.android.datamodel.OCFile;
  import com.owncloud.android.lib.resources.files.FileUtils;
@@@ -49,7 -49,7 +49,7 @@@ import com.owncloud.android.ui.activity
   *  Triggers the rename operation when name is confirmed.
   */
  public class RenameFileDialogFragment
extends SherlockDialogFragment implements DialogInterface.OnClickListener {
        extends DialogFragment implements DialogInterface.OnClickListener {
  
      private static final String ARG_TARGET_FILE = "TARGET_FILE";
  
@@@ -75,7 -75,7 +75,7 @@@
          mTargetFile = getArguments().getParcelable(ARG_TARGET_FILE);
  
          // Inflate the layout for the dialog
-         LayoutInflater inflater = getSherlockActivity().getLayoutInflater();
+         LayoutInflater inflater = getActivity().getLayoutInflater();
          View v = inflater.inflate(R.layout.edit_box_dialog, null);
          
          // Setup layout 
@@@ -93,7 -93,7 +93,7 @@@
          inputText.requestFocus();
          
          // Build the dialog  
-         AlertDialog.Builder builder = new AlertDialog.Builder(getSherlockActivity());
+         AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
          builder.setView(v)
                 .setPositiveButton(R.string.common_ok, this)
                 .setNegativeButton(R.string.common_cancel, this)
              
              if (newFileName.length() <= 0) {
                  Toast.makeText(
-                         getSherlockActivity(), 
+                         getActivity(),
                          R.string.filename_empty, 
                          Toast.LENGTH_LONG).show();
                  return;
              }
 -            
 -            if (!FileUtils.isValidName(newFileName)) {
 -                Toast.makeText(
 -                        getActivity(),
 -                        R.string.filename_forbidden_characters, 
 -                        Toast.LENGTH_LONG).show();
 +
-             boolean serverWithForbiddenChars = ((ComponentsGetter)getSherlockActivity()).
++            boolean serverWithForbiddenChars = ((ComponentsGetter)getActivity()).
 +                    getFileOperationsHelper().isVersionWithForbiddenCharacters();
 +
 +            if (!FileUtils.isValidName(newFileName, serverWithForbiddenChars)) {
 +                int messageId = 0;
 +                if (serverWithForbiddenChars) {
 +                    messageId = R.string.filename_forbidden_charaters_from_server;
 +                } else {
 +                    messageId = R.string.filename_forbidden_characters;
 +                }
-                 Toast.makeText(getSherlockActivity(), messageId, Toast.LENGTH_LONG).show();
++                Toast.makeText(getActivity(), messageId, Toast.LENGTH_LONG).show();
                  return;
              }
  
-             ((ComponentsGetter)getSherlockActivity()).getFileOperationsHelper().
 -            ((ComponentsGetter)getActivity()).getFileOperationsHelper().renameFile(mTargetFile,
 -                    newFileName);
++            ((ComponentsGetter)getActivity()).getFileOperationsHelper().
 +                    renameFile(mTargetFile, newFileName);
++
          }
      }
  }