Merge pull request #5203 from nextcloud/directEditingPre5

prevent direct editing on < Lollipop
This commit is contained in:
Andy Scherzinger 2020-01-23 18:54:06 +01:00 committed by GitHub
commit e4f099237c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -134,7 +134,7 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog {
String json = new ArbitraryDataProvider(getContext().getContentResolver())
.getValue(user.toPlatformAccount(), ArbitraryDataProvider.DIRECT_EDITING);
if (!json.isEmpty()) {
if (!json.isEmpty() && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
DirectEditing directEditing = new Gson().fromJson(json, DirectEditing.class);
if (!directEditing.getCreators().isEmpty()) {

View file

@ -23,6 +23,7 @@
package com.owncloud.android.ui.preview;
import android.accounts.Account;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
@ -104,11 +105,16 @@ public class PreviewTextStringFragment extends PreviewTextFragment {
throw new RuntimeException("View may not be null");
}
FloatingActionButton mFabMain = view.findViewById(R.id.text_preview_fab);
mFabMain.setVisibility(View.VISIBLE);
mFabMain.setEnabled(true);
mFabMain.setOnClickListener(v -> edit());
ThemeUtils.tintFloatingActionButton(mFabMain, R.drawable.ic_edit, getContext());
FloatingActionButton fabMain = view.findViewById(R.id.text_preview_fab);
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
fabMain.setVisibility(View.GONE);
} else {
fabMain.setVisibility(View.VISIBLE);
fabMain.setEnabled(true);
fabMain.setOnClickListener(v -> edit());
ThemeUtils.tintFloatingActionButton(fabMain, R.drawable.ic_edit, getContext());
}
return view;
}