changes due to rebase

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2018-06-27 11:59:59 +02:00 committed by AndyScherzinger
parent 5b1a011bff
commit e11f00acb7
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 10 additions and 8 deletions

View file

@ -184,6 +184,7 @@ public class FileMenuFilter {
filterEncrypt(toShow, toHide, endToEndEncryptionEnabled);
filterUnsetEncrypted(toShow, toHide, endToEndEncryptionEnabled);
filterSetPictureAs(toShow, toHide);
filterStream(toShow, toHide);
}
private void filterShareFile(List<Integer> toShow, List<Integer> toHide, OCCapability capability) {
@ -346,9 +347,8 @@ public class FileMenuFilter {
toShow.add(R.id.action_download_file);
}
}
private void filterStream() {
// STREAM
private void filterStream(List<Integer> toShow, List<Integer> toHide) {
if (mFiles.isEmpty() || !isSingleFile() || !isSingleMedia() ||
!AccountUtils.getServerVersion(mAccount).isMediaStreamingSupported()) {
toHide.add(R.id.action_stream_media);

View file

@ -70,7 +70,6 @@ import android.widget.ImageView;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.VirtualFolderType;
@ -730,7 +729,8 @@ public class FileDisplayActivity extends HookActivity
mWaitingToPreview = getStorageManager().getFileById(mWaitingToPreview.getFileId());
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
boolean streaming = AccountUtils.getServerVersion(getAccount()).isMediaStreamingSupported();
boolean streaming = AccountUtils.getServerVersionForAccount(getAccount(), this)
.isMediaStreamingSupported();
startMediaPreview(mWaitingToPreview, 0, true, true, streaming);
detailsFragmentChanged = true;
} else if (MimeTypeUtil.isVCard(mWaitingToPreview.getMimeType())) {
@ -2052,7 +2052,8 @@ public class FileDisplayActivity extends HookActivity
((PreviewMediaFragment) details).updateFile(renamedFile);
if (PreviewMediaFragment.canBePreviewed(renamedFile)) {
int position = ((PreviewMediaFragment) details).getPosition();
boolean streaming = AccountUtils.getServerVersion(getAccount()).isMediaStreamingSupported();
boolean streaming = AccountUtils.getServerVersionForAccount(getAccount(), this)
.isMediaStreamingSupported();
startMediaPreview(renamedFile, position, true, true, streaming);
} else {
getFileOperationsHelper().openFile(renamedFile);
@ -2463,7 +2464,8 @@ public class FileDisplayActivity extends HookActivity
if (event.getIntent().getBooleanExtra(TEXT_PREVIEW, false)) {
startTextPreview((OCFile) bundle.get(EXTRA_FILE), true);
} else if (bundle.containsKey(PreviewVideoActivity.EXTRA_START_POSITION)) {
boolean streaming = AccountUtils.getServerVersion(getAccount()).isMediaStreamingSupported();
boolean streaming = AccountUtils.getServerVersionForAccount(getAccount(), this)
.isMediaStreamingSupported();
startMediaPreview((OCFile)bundle.get(EXTRA_FILE),
(int)bundle.get(PreviewVideoActivity.EXTRA_START_POSITION),
(boolean) bundle.get(PreviewVideoActivity.EXTRA_AUTOPLAY), true, streaming);

View file

@ -367,7 +367,7 @@ public class FileOperationsHelper {
Intent openFileWithIntent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse((String) result.getData().get(0));
openFileWithIntent.setDataAndType(uri, file.getMimetype());
openFileWithIntent.setDataAndType(uri, file.getMimeType());
mFileActivity.startActivity(Intent.createChooser(openFileWithIntent,
mFileActivity.getString(R.string.stream)));