Merge branch 'master' into vanish_notifications

This commit is contained in:
masensio 2014-05-30 12:40:55 +02:00
commit dbfbc10af4
39 changed files with 70 additions and 31 deletions

View file

@ -18,8 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest package="com.owncloud.android"
android:versionCode="105005"
android:versionName="1.5.5" xmlns:android="http://schemas.android.com/apk/res/android">
android:versionCode="105006"
android:versionName="1.5.6" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.owncloud.android.workaround.accounts"
android:versionCode="0100014"
android:versionName="1.0.14" >
android:versionCode="0100015"
android:versionName="1.0.15" >
<uses-sdk
android:minSdkVersion="16"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -175,13 +175,13 @@
<string name="auth_unsupported_multiaccount">%1$s does not support multiple accounts</string>
<string name="auth_fail_get_user_name">Your server is not returning a correct user id, please contact an administrator
</string>
<string name="auth_can_not_auth_against_server">Can not authenticate against this server</string>
<string name="auth_can_not_auth_against_server">Cannot authenticate against this server</string>
<string name="fd_keep_in_sync">Keep file up to date</string>
<string name="common_rename">Rename</string>
<string name="common_remove">Remove</string>
<string name="confirmation_remove_alert">"Do you really want to remove %1$s ?"</string>
<string name="confirmation_remove_folder_alert">"Do you really want to remove %1$s and its contents ?"</string>
<string name="confirmation_remove_alert">"Do you really want to remove %1$s?"</string>
<string name="confirmation_remove_folder_alert">"Do you really want to remove %1$s and its contents?"</string>
<string name="confirmation_remove_local">Local only</string>
<string name="confirmation_remove_folder_local">Local contents only</string>
<string name="confirmation_remove_remote">Remove from server</string>
@ -246,7 +246,7 @@
<string name="conflict_dont_upload">Don\'t upload</string>
<string name="preview_image_description">Image preview</string>
<string name="preview_image_error_unknown_format">This image can not be shown</string>
<string name="preview_image_error_unknown_format">This image cannot be shown</string>
<string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
<string name="actionbar_failed_instant_upload">Failed InstantUpload</string>
@ -256,7 +256,7 @@
<string name="failed_upload_headline_retryall_btn">retry all selected</string>
<string name="failed_upload_headline_delete_all_btn">delete all selected from uploadqueue</string>
<string name="failed_upload_retry_text">retry to upload the image: </string>
<string name="failed_upload_load_more_images">Load more Picrures</string>
<string name="failed_upload_load_more_images">Load more Pictures</string>
<string name="failed_upload_retry_do_nothing_text">do nothing you are not online for instant upload</string>
<string name="failed_upload_failure_text">Failure Message: </string>
<string name="failed_upload_quota_exceeded_text">Please check your server configuration,maybe your quota is exceeded.</string>
@ -273,12 +273,11 @@
<string name="copy_link">Copy link</string>
<string name="clipboard_text_copied">Copied to clipboard</string>
<string name="error_cant_bind_to_operations_service">Critical error: can not perform operations</string>
<string name="error_cant_bind_to_operations_service">Critical error: cannot perform operations</string>
<string name="network_error_socket_exception">An error occurred while connecting with the server.</string>
<string name="network_error_socket_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
<string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
<string name="network_host_not_available">The operation couldn\'t be completed, server is unavaliable</string>
<string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
</resources>

View file

@ -448,6 +448,13 @@ implements OnRemoteOperationListener, ComponentsGetter {
requestCredentialsUpdate();
if (result.getCode() == ResultCode.UNAUTHORIZED) {
dismissLoadingDialog();
Toast t = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
Toast.LENGTH_LONG);
t.show();
}
} else if (operation instanceof CreateShareOperation) {
onCreateShareOperationFinish((CreateShareOperation) operation, result);

View file

@ -181,11 +181,6 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener
mRightFragmentContainer = findViewById(R.id.right_fragment_container);
if (savedInstanceState == null) {
createMinFragments();
} else {
Log_OC.d(TAG, "Init the secondFragment again");
if (mDualPane) {
initFragmentsWithFile();
}
}
// Action bar setup

View file

@ -113,7 +113,7 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
fileName.setText(name);
ImageView fileIcon = (ImageView) view.findViewById(R.id.imageView1);
fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype()));
fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));
ImageView localStateView = (ImageView) view.findViewById(R.id.imageView2);
FileDownloaderBinder downloaderBinder = mTransferServiceGetter.getFileDownloaderBinder();
FileUploaderBinder uploaderBinder = mTransferServiceGetter.getFileUploaderBinder();

View file

@ -330,7 +330,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
// set file details
setFilename(file.getFileName());
setFiletype(file.getMimetype());
setFiletype(file.getMimetype(), file.getFileName());
setFilesize(file.getFileLength());
if(ocVersionSupportsTimeCreated()){
setTimeCreated(file.getCreationTimestamp());
@ -382,8 +382,9 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
/**
* Updates the MIME type in view
* @param mimetype to set
* @param filename
*/
private void setFiletype(String mimetype) {
private void setFiletype(String mimetype, String filename) {
TextView tv = (TextView) getView().findViewById(R.id.fdType);
if (tv != null) {
String printableMimetype = DisplayUtils.convertMIMEtoPrettyPrint(mimetype);;
@ -391,7 +392,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
}
ImageView iv = (ImageView) getView().findViewById(R.id.fdIcon);
if (iv != null) {
iv.setImageResource(DisplayUtils.getResourceId(mimetype));
iv.setImageResource(DisplayUtils.getResourceId(mimetype, filename));
}
}

View file

@ -181,7 +181,8 @@ public class PreviewMediaFragment extends FileFragment implements
}
} else {
setFile((OCFile)savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_FILE));
file = (OCFile)savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_FILE);
setFile(file);
mAccount = savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_ACCOUNT);
mSavedPlaybackPosition =
savedInstanceState.getInt(PreviewMediaFragment.EXTRA_PLAY_POSITION);

View file

@ -63,14 +63,28 @@ public class DisplayUtils {
private static final String TYPE_VIDEO = "video";
private static final String SUBTYPE_PDF = "pdf";
private static final String[] SUBTYPES_DOCUMENT = { "msword", "mspowerpoint", "msexcel",
"vnd.oasis.opendocument.presentation",
"vnd.oasis.opendocument.spreadsheet",
"vnd.oasis.opendocument.text"
private static final String[] SUBTYPES_DOCUMENT = { "msword",
"vnd.openxmlformats-officedocument.wordprocessingml.document",
"vnd.oasis.opendocument.text",
"rtf"
};
private static Set<String> SUBTYPES_DOCUMENT_SET = new HashSet<String>(Arrays.asList(SUBTYPES_DOCUMENT));
private static final String[] SUBTYPES_SPREADSHEET = { "msexcel",
"vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"vnd.oasis.opendocument.spreadsheet"
};
private static Set<String> SUBTYPES_SPREADSHEET_SET = new HashSet<String>(Arrays.asList(SUBTYPES_SPREADSHEET));
private static final String[] SUBTYPES_PRESENTATION = { "mspowerpoint",
"vnd.openxmlformats-officedocument.presentationml.presentation",
"vnd.oasis.opendocument.presentation"
};
private static Set<String> SUBTYPES_PRESENTATION_SET = new HashSet<String>(Arrays.asList(SUBTYPES_PRESENTATION));
private static final String[] SUBTYPES_COMPRESSED = {"x-tar", "x-gzip", "zip"};
private static final Set<String> SUBTYPES_COMPRESSED_SET = new HashSet<String>(Arrays.asList(SUBTYPES_COMPRESSED));
private static final String SUBTYPE_OCTET_STREAM = "octet-stream";
private static final String EXTENSION_RAR = "rar";
private static final String EXTENSION_RTF = "rtf";
private static final String EXTENSION_3GP = "3gp";
/**
* Converts the file size in bytes to human readable output.
@ -135,9 +149,10 @@ public class DisplayUtils {
* known MIME type.
*
* @param mimetype MIME type string.
* @param filename name, with extension
* @return Resource identifier of an image resource.
*/
public static int getResourceId(String mimetype) {
public static int getResourceId(String mimetype, String filename) {
if (mimetype == null || "DIR".equals(mimetype)) {
return R.drawable.ic_menu_archive;
@ -167,12 +182,28 @@ public class DisplayUtils {
} else if (SUBTYPES_DOCUMENT_SET.contains(subtype)) {
return R.drawable.file_doc;
} else if (SUBTYPES_SPREADSHEET_SET.contains(subtype)) {
return R.drawable.file_xls;
} else if (SUBTYPES_PRESENTATION_SET.contains(subtype)) {
return R.drawable.file_ppt;
} else if (SUBTYPES_COMPRESSED_SET.contains(subtype)) {
return R.drawable.file_zip;
}
} else if (SUBTYPE_OCTET_STREAM.equals(subtype) ) {
if (getExtension(filename).equalsIgnoreCase(EXTENSION_RAR)) {
return R.drawable.file_zip;
} else if (getExtension(filename).equalsIgnoreCase(EXTENSION_RTF)) {
return R.drawable.file_doc;
} else if (getExtension(filename).equalsIgnoreCase(EXTENSION_3GP)) {
return R.drawable.file_movie;
}
}
}
// problems: RAR, RTF, 3GP are send as application/octet-stream from the server ; extension in the filename should be explicitly reviewed
}
// default icon
@ -180,6 +211,11 @@ public class DisplayUtils {
}
private static String getExtension(String filename) {
String extension = filename.substring(filename.lastIndexOf(".") + 1);
return extension;
}
/**
* Converts Unix time to human readable format