From: masensio Date: Tue, 27 May 2014 11:20:01 +0000 (+0200) Subject: Merge branch 'fixed_video_playback_on_rotations' into release-1.5.6 X-Git-Tag: oc-android-1.7.0_signed~295^2~8 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/e9f0604fb744848b3243596446e5d23e58269089?ds=inline;hp=-c Merge branch 'fixed_video_playback_on_rotations' into release-1.5.6 --- e9f0604fb744848b3243596446e5d23e58269089 diff --combined src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 04d28134,940fcdd1..4babd9db --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@@ -90,7 -90,6 +90,7 @@@ import com.owncloud.android.ui.preview. import com.owncloud.android.ui.preview.PreviewMediaFragment; import com.owncloud.android.ui.preview.PreviewVideoActivity; import com.owncloud.android.utils.DisplayUtils; +import com.owncloud.android.utils.ErrorMessageAdapter; import com.owncloud.android.utils.Log_OC; @@@ -181,11 -180,6 +181,6 @@@ FileFragment.ContainerActivity, OnNavig 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 @@@ -1300,12 -1294,9 +1295,12 @@@ */ private void onRemoveFileOperationFinish(RemoveFileOperation operation, RemoteOperationResult result) { dismissLoadingDialog(); + + Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), + Toast.LENGTH_LONG); + msg.show(); + if (result.isSuccess()) { - Toast msg = Toast.makeText(this, R.string.remove_success_msg, Toast.LENGTH_LONG); - msg.show(); OCFile removedFile = operation.getFile(); FileFragment second = getSecondFragment(); if (second != null && removedFile.equals(second.getFile())) { @@@ -1320,6 -1311,8 +1315,6 @@@ } invalidateOptionsMenu(); } else { - Toast msg = Toast.makeText(this, R.string.remove_fail_msg, Toast.LENGTH_LONG); - msg.show(); if (result.isSslRecoverableException()) { mLastSslUntrustedServerResult = result; showUntrustedCertDialog(mLastSslUntrustedServerResult); @@@ -1340,15 -1333,17 +1335,15 @@@ refreshListOfFilesFragment(); } else { dismissLoadingDialog(); - if (result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME) { - Toast.makeText(FileDisplayActivity.this, R.string.filename_forbidden_characters, Toast.LENGTH_LONG).show(); - } else { try { - Toast msg = Toast.makeText(FileDisplayActivity.this, R.string.create_dir_fail_msg, Toast.LENGTH_LONG); + Toast msg = Toast.makeText(FileDisplayActivity.this, + ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), + Toast.LENGTH_LONG); msg.show(); } catch (NotFoundException e) { Log_OC.e(TAG, "Error while trying to show fail message " , e); } - } } } @@@ -1386,13 -1381,20 +1381,13 @@@ } } else { - if (result.getCode().equals(ResultCode.INVALID_LOCAL_FILE_NAME)) { - Toast msg = Toast.makeText(this, R.string.rename_local_fail_msg, Toast.LENGTH_LONG); - msg.show(); - // TODO throw again the new rename dialog - } if (result.getCode().equals(ResultCode.INVALID_CHARACTER_IN_NAME)) { - Toast msg = Toast.makeText(this, R.string.filename_forbidden_characters, Toast.LENGTH_LONG); - msg.show(); - } else { - Toast msg = Toast.makeText(this, R.string.rename_server_fail_msg, Toast.LENGTH_LONG); - msg.show(); - if (result.isSslRecoverableException()) { - mLastSslUntrustedServerResult = result; - showUntrustedCertDialog(mLastSslUntrustedServerResult); - } + Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), + Toast.LENGTH_LONG); + msg.show(); + + if (result.isSslRecoverableException()) { + mLastSslUntrustedServerResult = result; + showUntrustedCertDialog(mLastSslUntrustedServerResult); } } } @@@ -1414,8 -1416,7 +1409,8 @@@ onTransferStateChanged(syncedFile, true, true); } else { - Toast msg = Toast.makeText(this, R.string.sync_file_nothing_to_do_msg, Toast.LENGTH_LONG); + Toast msg = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), + Toast.LENGTH_LONG); msg.show(); } }