Merge pull request #5471 from nextcloud/richWorkspace18only

Show "add folder info" only if text app is available
This commit is contained in:
Tobias Kaminsky 2020-02-20 07:49:47 +01:00 committed by GitHub
commit be238a3f96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,7 @@ import com.nextcloud.client.device.DeviceInfo;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
import com.owncloud.android.lib.common.Creator;
import com.owncloud.android.lib.common.DirectEditing;
import com.owncloud.android.lib.resources.status.OCCapability;
@ -170,7 +171,11 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog {
}
// create rich workspace
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && file != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
FileMenuFilter.isEditorAvailable(getContext().getContentResolver(),
user,
MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN) &&
file != null) {
if (TextUtils.isEmpty(file.getRichWorkspace())) {
createRichWorkspace.setVisibility(View.VISIBLE);
} else {