fix: unable to edit from preview mode

When direct edit is enabled and note opening behavior is set to either
plain edit mode or plain preview the note cannot be edited from the
preview fragment. This is because of visibility settings of the two FABs
not being set properly.

Signed-off-by: jhavens1566 <johnathon.havens@gmail.com>
This commit is contained in:
jhavens1566 2024-09-18 21:59:22 -06:00
parent 4fcab00e0b
commit 2993b3cf12

View file

@ -87,8 +87,11 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
checkDirectEditingAvailable(); checkDirectEditingAvailable();
if (isDirectEditEnabled()) { if (isDirectEditEnabled()) {
ExtendedFloatingActionButton edit = getNormalEditButton();
if (edit != null) edit.setVisibility(View.GONE);
final ExtendedFloatingActionButton directEditingButton = getDirectEditingButton(); final ExtendedFloatingActionButton directEditingButton = getDirectEditingButton();
directEditingButton.setExtended(false); directEditingButton.setExtended(false);
directEditingButton.setVisibility(View.VISIBLE);
ExtendedFabUtil.toggleExtendedOnLongClick(directEditingButton); ExtendedFabUtil.toggleExtendedOnLongClick(directEditingButton);
directEditingButton.setOnClickListener(v -> { directEditingButton.setOnClickListener(v -> {
if (listener != null) { if (listener != null) {