import com.owncloud.android.files.services.FileUploader;\r
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;\r
import com.owncloud.android.ui.fragment.FileDetailFragment;\r
-import com.owncloud.android.ui.fragment.FilePreviewFragment;\r
+import com.owncloud.android.ui.preview.PreviewMediaFragment;\r
\r
import com.owncloud.android.R;\r
\r
public static final int MODE_DETAILS = 0;\r
public static final int MODE_PREVIEW = 1;\r
\r
- private static final String KEY_WAITING_TO_PREVIEW = "WAITING_TO_PREVIEW";\r
+ public static final String KEY_WAITING_TO_PREVIEW = "WAITING_TO_PREVIEW";\r
\r
private boolean mConfigurationChangedToLandscape = false;\r
private FileDownloaderBinder mDownloaderBinder = null;\r
int mode = getIntent().getIntExtra(EXTRA_MODE, MODE_PREVIEW); \r
\r
Fragment newFragment = null;\r
- if (FilePreviewFragment.canBePreviewed(mFile) && mode == MODE_PREVIEW) {\r
+ if (PreviewMediaFragment.canBePreviewed(mFile) && mode == MODE_PREVIEW) {\r
if (mFile.isDown()) {\r
- newFragment = new FilePreviewFragment(mFile, mAccount);\r
+ newFragment = new PreviewMediaFragment(mFile, mAccount);\r
\r
} else {\r
newFragment = new FileDetailFragment(mFile, mAccount);\r
}\r
\r
@Override\r
- public void notifySuccessfulDownload(OCFile file) {\r
- if (mWaitingToPreview) {\r
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r
- transaction.replace(R.id.fragment, new FilePreviewFragment(file, mAccount), FileDetailFragment.FTAG); \r
- transaction.commit();\r
- mWaitingToPreview = false;\r
+ public void notifySuccessfulDownload(OCFile file, Intent intent, boolean success) {\r
+ if (success) {\r
+ if (mWaitingToPreview) {\r
+ FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r
+ transaction.replace(R.id.fragment, new PreviewMediaFragment(file, mAccount), FileDetailFragment.FTAG); \r
+ transaction.commit();\r
+ mWaitingToPreview = false;\r
+ }\r
}\r
}\r
\r