From: David A. Velasco Date: Tue, 6 May 2014 08:58:19 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/refactor_update_filelist_from_database' into... X-Git-Tag: oc-android-1.7.0_signed~309^2~57 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/c6edcab5a2f81773f05b8f796f2c356c2c2aeb4d Merge remote-tracking branch 'origin/refactor_update_filelist_from_database' into refactor_update_filelist_from_database --- c6edcab5a2f81773f05b8f796f2c356c2c2aeb4d diff --cc src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 328cce66,7995797d..8d6ad641 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@@ -150,15 -165,31 +150,16 @@@ public class FileDetailFragment extend * {@inheritDoc} */ @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - try { - mContainerActivity = (ContainerActivity) activity; - - } catch (ClassCastException e) { - throw new ClassCastException(activity.toString() + " must implement " + FileDetailFragment.ContainerActivity.class.getSimpleName()); - } - } - - - /** - * {@inheritDoc} - */ - @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - if (mAccount != null) { - OCFile file = mContainerActivity.getStorageManager(). - getFileByPath(getFile().getRemotePath()); - if (file != null) { - setFile(file); - } - } + // TODO: Remove this code. (Updated no needed) + // if (mAccount != null) { -// OCFile file = ((FileActivity)getActivity()).getStorageManager(). -// getFileByPath(getFile().getRemotePath()); ++// OCFile file = mContainerActivity.getStorageManager(). ++// getFileByPath(getFile().getRemotePath()); + // if (file != null) { + // setFile(file); + // } + // } } diff --cc src/com/owncloud/android/ui/preview/PreviewImageFragment.java index 41edc244,90c5c192..eb8af268 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@@ -161,19 -173,21 +161,21 @@@ ConfirmationDialogFragment.Confirmation if (savedInstanceState != null) { if (!mIgnoreFirstSavedState) { OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE); + setFile(file); mAccount = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_ACCOUNT); - - // Update the file - if (mAccount!= null) { - OCFile updatedFile = mContainerActivity.getStorageManager().getFileByPath(file.getRemotePath()); - if (updatedFile != null) { - setFile(updatedFile); - } else { - setFile(file); - } - } else { - setFile(file); - } + // TODO remove this code: update file no needed + // // Update the file + //// if (mAccount!= null) { -// OCFile updatedFile = ((FileActivity)getSherlockActivity()). -// getStorageManager().getFileByPath(file.getRemotePath()); ++// OCFile updatedFile = ++// mContainerActivity.getStorageManager().getFileByPath(file.getRemotePath()); + // if (updatedFile != null) { + // setFile(updatedFile); + // } else { + // setFile(file); + // } + // } else { + // setFile(file); + // } } else { mIgnoreFirstSavedState = false;