Forráskód Böngészése

Hide on scrolling, fix https://github.com/nextcloud/android/issues/6238

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 5 éve
szülő
commit
1ecd64f128

+ 2 - 2
src/main/java/com/owncloud/android/ui/activity/FileActivity.java

@@ -173,9 +173,9 @@ public abstract class FileActivity extends DrawerActivity
         // must be specialized in subclasses
         MainApp.showOnlyFilesOnDevice(onDeviceOnly);
         if (onDeviceOnly) {
-            setupToolbar();
+            setupHomeSearchToolbar(true);
         } else {
-            setupHomeSearchToolbar();
+            setupHomeSearchToolbar(true);
         }
     }
 

+ 7 - 6
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -245,7 +245,7 @@ public class FileDisplayActivity extends FileActivity
         setContentView(binding.getRoot());
 
         // setup toolbar
-        setupHomeSearchToolbar();
+        setupHomeSearchToolbar(true);
 
         mMenuButton.setOnClickListener(v -> openDrawer());
 
@@ -598,7 +598,8 @@ public class FileDisplayActivity extends FileActivity
     }
 
 
-    public OCFileListFragment getListOfFilesFragment() {
+    public @androidx.annotation.Nullable
+    OCFileListFragment getListOfFilesFragment() {
         Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag(
                 FileDisplayActivity.TAG_LIST_OF_FILES);
         if (listOfFiles != null) {
@@ -1131,16 +1132,16 @@ public class FileDisplayActivity extends FileActivity
         if (menuItemId == -1) {
             if (MainApp.isOnlyOnDevice()) {
                 setDrawerMenuItemChecked(R.id.nav_on_device);
-                setupToolbar();
+                setupHomeSearchToolbar(true);
             } else {
                 setDrawerMenuItemChecked(R.id.nav_all_files);
-                setupHomeSearchToolbar();
+                setupHomeSearchToolbar(true);
             }
         } else {
             if (menuItemId == R.id.nav_all_files) {
-                setupHomeSearchToolbar();
+                setupHomeSearchToolbar(true);
             } else {
-                setupToolbar();
+                setupHomeSearchToolbar(true);
             }
             setDrawerMenuItemChecked(menuItemId);
         }

+ 11 - 3
src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java

@@ -80,7 +80,7 @@ public abstract class ToolbarActivity extends BaseActivity {
      * Toolbar setup that must be called in implementer's {@link #onCreate} after {@link #setContentView} if they want
      * to use the toolbar.
      */
-    private void setupToolbar(boolean isHomeSearchToolbarShow) {
+    private void setupToolbar(boolean isHomeSearchToolbarShow, boolean showSortListButtonGroup) {
         int fontColor = ThemeUtils.appBarPrimaryFontColor(this);
 
         mToolbar = findViewById(R.id.toolbar);
@@ -94,6 +94,10 @@ public abstract class ToolbarActivity extends BaseActivity {
         mSearchText = findViewById(R.id.search_text);
         mSwitchAccountButton = findViewById(R.id.switch_account_button);
 
+        if (showSortListButtonGroup) {
+            findViewById(R.id.sort_list_button_group).setVisibility(View.VISIBLE);
+        }
+
         this.isHomeSearchToolbarShow = isHomeSearchToolbarShow;
         updateActionBarTitleAndHomeButton(null);
 
@@ -115,11 +119,15 @@ public abstract class ToolbarActivity extends BaseActivity {
     }
 
     public void setupToolbar() {
-        setupToolbar(false);
+        setupToolbar(false, false);
     }
 
     public void setupHomeSearchToolbar() {
-        setupToolbar(true);
+        setupToolbar(true, false);
+    }
+
+    public void setupHomeSearchToolbar(boolean showShortListGroup) {
+        setupToolbar(true, showShortListGroup);
     }
 
     /**

+ 10 - 85
src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -27,9 +27,7 @@ package com.owncloud.android.ui.fragment;
 import android.animation.LayoutTransition;
 import android.app.Activity;
 import android.content.Context;
-import android.content.res.ColorStateList;
 import android.content.res.Configuration;
-import android.graphics.Color;
 import android.graphics.PorterDuff;
 import android.os.Bundle;
 import android.os.Handler;
@@ -54,9 +52,7 @@ import android.widget.LinearLayout;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
-import com.google.android.material.behavior.HideBottomViewOnScrollBehavior;
 import com.google.android.material.button.MaterialButton;
-import com.google.android.material.floatingactionbutton.FloatingActionButton;
 import com.nextcloud.client.account.UserAccountManager;
 import com.nextcloud.client.di.Injectable;
 import com.nextcloud.client.preferences.AppPreferences;
@@ -86,7 +82,6 @@ import androidx.annotation.DrawableRes;
 import androidx.annotation.NonNull;
 import androidx.annotation.StringRes;
 import androidx.appcompat.widget.SearchView;
-import androidx.coordinatorlayout.widget.CoordinatorLayout;
 import androidx.core.view.MenuItemCompat;
 import androidx.fragment.app.Fragment;
 import androidx.recyclerview.widget.GridLayoutManager;
@@ -129,8 +124,6 @@ public class ExtendedListFragment extends Fragment implements
     protected ImageView mEmptyListIcon;
     protected ProgressBar mEmptyListProgress;
 
-    private FloatingActionButton mFabMain;
-
     // Save the state of the scroll in browsing
     private ArrayList<Integer> mIndexes;
     private ArrayList<Integer> mFirstPositions;
@@ -174,10 +167,6 @@ public class ExtendedListFragment extends Fragment implements
         return mRecyclerView;
     }
 
-    public FloatingActionButton getFabMain() {
-        return mFabMain;
-    }
-
     public void setLoading(boolean enabled) {
         mRefreshListLayout.setRefreshing(enabled);
     }
@@ -231,7 +220,12 @@ public class ExtendedListFragment extends Fragment implements
         searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.post(() -> {
             if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity)
                 && !(getActivity() instanceof UploadFilesActivity)) {
-                setFabVisible(!hasFocus);
+                if (getActivity() instanceof FileDisplayActivity) {
+                    OCFileListFragment fileFragment = ((FileDisplayActivity) getActivity()).getListOfFilesFragment();
+                    if (fileFragment != null) {
+                        fileFragment.setFabVisible(!hasFocus);
+                    }
+                }
                 if (TextUtils.isEmpty(searchView.getQuery())) {
                     closeButton.setVisibility(View.INVISIBLE);
                 }
@@ -354,7 +348,7 @@ public class ExtendedListFragment extends Fragment implements
     }
 
     @Override
-    public void onAttach(Context context) {
+    public void onAttach(@NonNull Context context) {
         super.onAttach(context);
     }
 
@@ -391,12 +385,8 @@ public class ExtendedListFragment extends Fragment implements
         ThemeUtils.colorSwipeRefreshLayout(getContext(), mRefreshListLayout);
         mRefreshListLayout.setOnRefreshListener(this);
 
-        mSortButton = v.findViewById(R.id.sort_button);
-        mSwitchGridViewButton = v.findViewById(R.id.switch_grid_view_button);
-
-        mFabMain = v.findViewById(R.id.fab_main);
-        ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
-        ThemeUtils.drawableFloatingActionButton(mFabMain, R.drawable.ic_plus, requireContext());
+        mSortButton = getActivity().findViewById(R.id.sort_button);
+        mSwitchGridViewButton = getActivity().findViewById(R.id.switch_grid_view_button);
 
         return v;
     }
@@ -585,72 +575,7 @@ public class ExtendedListFragment extends Fragment implements
         mRefreshListLayout.setEnabled(enabled);
     }
 
-    /**
-     * Sets the 'visibility' state of the FAB contained in the fragment.
-     * <p>
-     * When 'false' is set, FAB visibility is set to View.GONE programmatically.
-     *
-     * @param visible Desired visibility for the FAB.
-     */
-    public void setFabVisible(final boolean visible) {
-        if (getActivity() != null) {
-            getActivity().runOnUiThread(() -> {
-                if (visible) {
-                    mFabMain.show();
-                    ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
-                } else {
-                    mFabMain.hide();
-                }
-
-                showFabWithBehavior(visible);
-            });
-        }
-    }
-
-    /**
-     * Remove this, if HideBottomViewOnScrollBehavior is fix by Google
-     *
-     * @param visible
-     */
-    private void showFabWithBehavior(boolean visible) {
-        ViewGroup.LayoutParams layoutParams = mFabMain.getLayoutParams();
-        if (layoutParams instanceof CoordinatorLayout.LayoutParams) {
-            CoordinatorLayout.Behavior coordinatorLayoutBehavior =
-                ((CoordinatorLayout.LayoutParams) layoutParams).getBehavior();
-            if (coordinatorLayoutBehavior instanceof HideBottomViewOnScrollBehavior) {
-                @SuppressWarnings("unchecked")
-                HideBottomViewOnScrollBehavior<FloatingActionButton> behavior =
-                    (HideBottomViewOnScrollBehavior<FloatingActionButton>) coordinatorLayoutBehavior;
-                if (visible) {
-                    behavior.slideUp(mFabMain);
-                } else {
-                    behavior.slideDown(mFabMain);
-                }
-            }
-        }
-    }
 
-    /**
-     * Sets the 'visibility' state of the FAB contained in the fragment.
-     * <p>
-     * When 'false' is set, FAB is greyed out
-     *
-     * @param enabled Desired visibility for the FAB.
-     */
-    public void setFabEnabled(final boolean enabled) {
-        if (getActivity() != null) {
-            getActivity().runOnUiThread(() -> {
-                if (enabled) {
-                    mFabMain.setEnabled(true);
-                    ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
-                } else {
-                    mFabMain.setEnabled(false);
-                    mFabMain.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
-                    mFabMain.setRippleColor(Color.GRAY);
-                }
-            });
-        }
-    }
 
     /**
      * /** Set message for empty list view.
@@ -810,7 +735,7 @@ public class ExtendedListFragment extends Fragment implements
     }
 
     @Override
-    public void onConfigurationChanged(Configuration newConfig) {
+    public void onConfigurationChanged(@NonNull Configuration newConfig) {
         super.onConfigurationChanged(newConfig);
 
         if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {

+ 1 - 2
src/main/java/com/owncloud/android/ui/fragment/LocalFileListFragment.java

@@ -68,7 +68,7 @@ public class LocalFileListFragment extends ExtendedListFragment implements
     private LocalFileListAdapter mAdapter;
 
     @Override
-    public void onAttach(Context context) {
+    public void onAttach(@NonNull Context context) {
         super.onAttach(context);
     }
 
@@ -109,7 +109,6 @@ public class LocalFileListFragment extends ExtendedListFragment implements
         }
 
         setSwipeEnabled(false); // Disable pull-to-refresh
-        setFabVisible(false); // Disable FAB
 
         Log_OC.i(TAG, "onCreateView() end");
         return v;

+ 83 - 6
src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -28,6 +28,8 @@ import android.accounts.Account;
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
 import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Bundle;
@@ -44,6 +46,8 @@ import android.view.ViewGroup;
 import android.widget.AbsListView;
 import android.widget.PopupMenu;
 
+import com.google.android.material.behavior.HideBottomViewOnScrollBehavior;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
 import com.google.android.material.snackbar.Snackbar;
 import com.nextcloud.android.lib.richWorkspace.RichWorkspaceDirectEditingRemoteOperation;
 import com.nextcloud.client.account.User;
@@ -120,6 +124,7 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.StringRes;
 import androidx.appcompat.app.ActionBar;
+import androidx.coordinatorlayout.widget.CoordinatorLayout;
 import androidx.core.content.ContextCompat;
 import androidx.drawerlayout.widget.DrawerLayout;
 import androidx.fragment.app.FragmentActivity;
@@ -191,6 +196,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
     protected SearchEvent searchEvent;
     protected AsyncTask<Void, Void, Boolean> remoteOperationAsyncTask;
     protected String mLimitToMimeType;
+    private FloatingActionButton mFabMain;
 
     @Inject DeviceInfo deviceInfo;
 
@@ -241,7 +247,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
      * {@inheritDoc}
      */
     @Override
-    public void onAttach(Context context) {
+    public void onAttach(@NonNull Context context) {
         super.onAttach(context);
         Log_OC.i(TAG, "onAttach");
         try {
@@ -284,6 +290,10 @@ public class OCFileListFragment extends ExtendedListFragment implements
             setChoiceModeAsMultipleModal(savedInstanceState);
         }
 
+        mFabMain = getActivity().findViewById(R.id.fab_main);
+        ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
+        ThemeUtils.drawableFloatingActionButton(mFabMain, R.drawable.ic_plus, requireContext());
+
         Log_OC.i(TAG, "onCreateView() end");
         return v;
     }
@@ -410,11 +420,11 @@ public class OCFileListFragment extends ExtendedListFragment implements
      */
     private void registerFabListener() {
         FileActivity activity = (FileActivity) getActivity();
-        getFabMain().setOnClickListener(v -> new OCFileListBottomSheetDialog(activity,
-                                                                             this,
-                                                                             deviceInfo,
-                                                                             accountManager.getUser(),
-                                                                             getCurrentFile())
+        mFabMain.setOnClickListener(v -> new OCFileListBottomSheetDialog(activity,
+                                                                         this,
+                                                                         deviceInfo,
+                                                                         accountManager.getUser(),
+                                                                         getCurrentFile())
             .show());
     }
 
@@ -1739,4 +1749,71 @@ public class OCFileListFragment extends ExtendedListFragment implements
     public boolean isLoading() {
         return false;
     }
+
+    /**
+     * Sets the 'visibility' state of the FAB contained in the fragment.
+     * <p>
+     * When 'false' is set, FAB visibility is set to View.GONE programmatically.
+     *
+     * @param visible Desired visibility for the FAB.
+     */
+    void setFabVisible(final boolean visible) {
+        if (getActivity() != null) {
+            getActivity().runOnUiThread(() -> {
+                if (visible) {
+                    mFabMain.show();
+                    ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
+                } else {
+                    mFabMain.hide();
+                }
+
+                showFabWithBehavior(visible);
+            });
+        }
+    }
+
+    /**
+     * Remove this, if HideBottomViewOnScrollBehavior is fix by Google
+     *
+     * @param visible
+     */
+    private void showFabWithBehavior(boolean visible) {
+        ViewGroup.LayoutParams layoutParams = mFabMain.getLayoutParams();
+        if (layoutParams instanceof CoordinatorLayout.LayoutParams) {
+            CoordinatorLayout.Behavior coordinatorLayoutBehavior =
+                ((CoordinatorLayout.LayoutParams) layoutParams).getBehavior();
+            if (coordinatorLayoutBehavior instanceof HideBottomViewOnScrollBehavior) {
+                @SuppressWarnings("unchecked")
+                HideBottomViewOnScrollBehavior<FloatingActionButton> behavior =
+                    (HideBottomViewOnScrollBehavior<FloatingActionButton>) coordinatorLayoutBehavior;
+                if (visible) {
+                    behavior.slideUp(mFabMain);
+                } else {
+                    behavior.slideDown(mFabMain);
+                }
+            }
+        }
+    }
+
+    /**
+     * Sets the 'visibility' state of the FAB contained in the fragment.
+     * <p>
+     * When 'false' is set, FAB is greyed out
+     *
+     * @param enabled Desired visibility for the FAB.
+     */
+    private void setFabEnabled(final boolean enabled) {
+        if (getActivity() != null) {
+            getActivity().runOnUiThread(() -> {
+                if (enabled) {
+                    mFabMain.setEnabled(true);
+                    ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
+                } else {
+                    mFabMain.setEnabled(false);
+                    mFabMain.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
+                    mFabMain.setRippleColor(Color.GRAY);
+                }
+            });
+        }
+    }
 }

+ 33 - 10
src/main/res/layout/files.xml

@@ -17,20 +17,26 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   -->
 <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/drawer_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:clickable="true"
     android:fitsSystemWindows="true">
 
-    <!-- The main content view -->
-    <LinearLayout
+    <androidx.coordinatorlayout.widget.CoordinatorLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:id="@+id/root_layout"
-        android:orientation="vertical">
+        android:layout_height="match_parent">
+
+        <include layout="@layout/toolbar_standard" />
 
-            <include layout="@layout/toolbar_standard" />
+        <!-- The main content view -->
+        <LinearLayout
+            android:id="@+id/root_layout"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
             <LinearLayout
                 android:id="@+id/ListLayout"
@@ -39,22 +45,39 @@
                 android:background="@color/bg_default"
                 android:baselineAligned="false"
                 android:contentDescription="@string/list_layout"
-                android:orientation="horizontal">
+                android:orientation="horizontal"
+                app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
                 <FrameLayout
                     android:id="@+id/left_fragment_container"
                     android:layout_width="@dimen/zero"
                     android:layout_height="match_parent"
-                    android:layout_weight="1" />
+                    android:layout_weight="1"
+                    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
 
                 <FrameLayout
                     android:id="@+id/right_fragment_container"
                     android:layout_width="@dimen/zero"
                     android:layout_height="match_parent"
-                    android:layout_weight="2" />
+                    android:layout_weight="2"
+                    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
             </LinearLayout>
 
-    </LinearLayout>
+        </LinearLayout>
+
+        <com.google.android.material.floatingactionbutton.FloatingActionButton
+            android:id="@+id/fab_main"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentEnd="true"
+            android:layout_gravity="end|bottom"
+            android:layout_marginEnd="@dimen/standard_margin"
+            android:layout_marginBottom="@dimen/standard_margin"
+            android:contentDescription="@string/fab_label"
+            android:visibility="gone"
+            app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
+
+    </androidx.coordinatorlayout.widget.CoordinatorLayout>
 
     <include
         layout="@layout/drawer"

+ 12 - 77
src/main/res/layout/list_fragment.xml

@@ -18,89 +18,24 @@
 -->
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/list_fragment_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <androidx.coordinatorlayout.widget.CoordinatorLayout
-        android:id="@+id/list_fragment_layout"
+    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+        android:id="@+id/swipe_containing_list"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:footerDividersEnabled="false"
+        android:visibility="visible"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
 
-        <com.google.android.material.appbar.AppBarLayout
+        <com.owncloud.android.ui.EmptyRecyclerView
+            android:id="@+id/list_root"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@color/bg_default"
-            app:elevation="0dp">
+            android:layout_height="match_parent" />
+    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
 
-            <androidx.constraintlayout.widget.ConstraintLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                app:layout_scrollFlags="scroll|enterAlways|snap">
+    <include layout="@layout/empty_list" />
 
-                <com.google.android.material.button.MaterialButton
-                    android:id="@+id/sort_button"
-                    style="@style/Widget.MaterialComponents.Button.TextButton"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="8dp"
-                    android:contentDescription="@string/actionbar_sort"
-                    android:minWidth="0dp"
-                    android:text="@string/menu_item_sort_by_date_newest_first"
-                    android:textAlignment="textStart"
-                    android:textAllCaps="false"
-                    android:textColor="@color/fontAppbar"
-                    android:textSize="14sp"
-                    app:icon="@drawable/ic_keyboard_arrow_down"
-                    app:iconGravity="textEnd"
-                    app:iconSize="16dp"
-                    app:iconTint="@color/fontAppbar"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
-
-                <com.google.android.material.button.MaterialButton
-                    android:id="@+id/switch_grid_view_button"
-                    style="@style/Widget.AppTheme.Button.IconButton"
-                    android:layout_width="38dp"
-                    android:layout_height="38dp"
-                    android:layout_marginEnd="4dp"
-                    android:contentDescription="@string/action_switch_grid_view"
-                    app:cornerRadius="24dp"
-                    app:icon="@drawable/ic_view_module"
-                    app:iconTint="@color/fontAppbar"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
-            </androidx.constraintlayout.widget.ConstraintLayout>
-        </com.google.android.material.appbar.AppBarLayout>
-
-        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
-            android:id="@+id/swipe_containing_list"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:footerDividersEnabled="false"
-            android:visibility="visible"
-            app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
-            <com.owncloud.android.ui.EmptyRecyclerView
-                android:id="@+id/list_root"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent" />
-        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
-
-        <include layout="@layout/empty_list" />
-
-        <com.google.android.material.floatingactionbutton.FloatingActionButton
-            android:id="@+id/fab_main"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentEnd="true"
-            android:layout_gravity="end|bottom"
-            android:layout_marginEnd="@dimen/standard_margin"
-            android:layout_marginBottom="@dimen/standard_margin"
-            android:contentDescription="@string/fab_label"
-            android:visibility="gone"
-            app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
-
-    </androidx.coordinatorlayout.widget.CoordinatorLayout>
 </RelativeLayout>

+ 1 - 1
src/main/res/layout/synced_folders_layout.xml

@@ -52,7 +52,7 @@
                 android:clipToPadding="false"
                 android:scrollbarStyle="outsideOverlay"
                 android:scrollbars="vertical"
-                android:visibility="visible"/>
+                android:visibility="visible" />
         </FrameLayout>
 
     </androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 47 - 2
src/main/res/layout/toolbar_standard.xml

@@ -30,7 +30,8 @@
     <RelativeLayout
         android:id="@+id/default_toolbar"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        app:layout_scrollFlags="scroll|enterAlways">
 
         <FrameLayout
             android:id="@+id/preview_image_frame"
@@ -84,7 +85,8 @@
         app:cardCornerRadius="8dp"
         app:cardElevation="2dp"
         app:strokeWidth="0dp"
-        tools:visibility="visible">
+        tools:visibility="visible"
+        app:layout_scrollFlags="scroll|enterAlways">
 
         <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
@@ -137,6 +139,49 @@
 
     </com.google.android.material.card.MaterialCardView>
 
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/sort_list_button_group"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone"
+        app:layout_scrollFlags="scroll|enterAlways">
+
+        <com.google.android.material.button.MaterialButton
+            android:id="@+id/sort_button"
+            style="@style/Widget.MaterialComponents.Button.TextButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="8dp"
+            android:contentDescription="@string/actionbar_sort"
+            android:minWidth="0dp"
+            android:text="@string/menu_item_sort_by_date_newest_first"
+            android:textAlignment="textStart"
+            android:textAllCaps="false"
+            android:textColor="@color/fontAppbar"
+            android:textSize="14sp"
+            app:icon="@drawable/ic_keyboard_arrow_down"
+            app:iconGravity="textEnd"
+            app:iconSize="16dp"
+            app:iconTint="@color/fontAppbar"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <com.google.android.material.button.MaterialButton
+            android:id="@+id/switch_grid_view_button"
+            style="@style/Widget.AppTheme.Button.IconButton"
+            android:layout_width="38dp"
+            android:layout_height="38dp"
+            android:layout_marginEnd="4dp"
+            android:contentDescription="@string/action_switch_grid_view"
+            app:cornerRadius="24dp"
+            app:icon="@drawable/ic_view_module"
+            app:iconTint="@color/fontAppbar"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
     <include layout="@layout/info_box" />
 
 </com.google.android.material.appbar.AppBarLayout>