@@ -75,11 +75,14 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
7575 @ Override
7676 protected void onScroll (int scrollY , int oldScrollY ) {
7777 super .onScroll (scrollY , oldScrollY );
78- if (isDirectEditEnabled ()) {
79- // only show FAB if search is not active
80- if (getSearchNextButton () == null || getSearchNextButton ().getVisibility () != View .VISIBLE ) {
81- final ExtendedFloatingActionButton directFab = getDirectEditingButton ();
78+ // only show FAB if search is not active
79+ if (getSearchNextButton () == null || getSearchNextButton ().getVisibility () != View .VISIBLE ) {
80+ final ExtendedFloatingActionButton directFab = getDirectEditingButton ();
81+ final ExtendedFloatingActionButton normalFab = getNormalEditButton ();
82+ if (isDirectEditEnabled ()) {
8283 ExtendedFabUtil .toggleVisibilityOnScroll (directFab , scrollY , oldScrollY );
84+ } else if (normalFab != null ) {
85+ ExtendedFabUtil .toggleVisibilityOnScroll (normalFab , scrollY , oldScrollY );
8386 }
8487 }
8588 }
@@ -103,7 +106,8 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
103106 } else {
104107 getDirectEditingButton ().setVisibility (View .GONE );
105108 ExtendedFloatingActionButton edit = getNormalEditButton ();
106- if (edit !=null ) {
109+ if (edit != null ) {
110+ edit .setExtended (false );
107111 edit .setVisibility (View .VISIBLE );
108112 edit .setOnClickListener (v -> {
109113 if (listener != null ) {
@@ -285,6 +289,10 @@ public void onSaveInstanceState(@NonNull Bundle outState) {
285289
286290 private void showSearchFabs () {
287291 ExtendedFabUtil .setExtendedFabVisibility (getDirectEditingButton (), false );
292+ final ExtendedFloatingActionButton normalFab = getNormalEditButton ();
293+ if (normalFab != null ) {
294+ ExtendedFabUtil .setExtendedFabVisibility (normalFab , false );
295+ }
288296 final var next = getSearchNextButton ();
289297 final var prev = getSearchPrevButton ();
290298 if (prev != null ) {
@@ -304,6 +312,14 @@ private void hideSearchFabs() {
304312 if (next != null ) {
305313 next .hide ();
306314 }
315+ if (isDirectEditEnabled ()) {
316+ ExtendedFabUtil .setExtendedFabVisibility (getDirectEditingButton (), true );
317+ } else {
318+ final ExtendedFloatingActionButton normalFab = getNormalEditButton ();
319+ if (normalFab != null ) {
320+ ExtendedFabUtil .setExtendedFabVisibility (normalFab , true );
321+ }
322+ }
307323 }
308324
309325 private void jumpToOccurrence () {
0 commit comments