@@ -594,7 +594,7 @@ OCFileListFragment getListOfFilesFragment() {
594594
595595 protected void resetTitleBarAndScrolling () {
596596 updateActionBarTitleAndHomeButton (null );
597- resetScrolling ();
597+ resetScrolling (true );
598598 }
599599
600600 public void updateListOfFilesFragment (boolean fromSearch ) {
@@ -1070,7 +1070,7 @@ public void onBackPressed() {
10701070 createMinFragments (null );
10711071 } else {
10721072 // pop back
1073- resetScrolling ();
1073+ resetScrolling (true );
10741074 hideSearchView (getCurrentDir ());
10751075 showSortListGroup (true );
10761076 super .onBackPressed ();
@@ -1328,7 +1328,7 @@ public void onReceive(Context context, Intent intent) {
13281328 if (ocFileListFragment .isEmpty ()) {
13291329 lockScrolling ();
13301330 } else {
1331- resetScrolling ();
1331+ resetScrolling (false );
13321332 }
13331333 }
13341334 }
@@ -1568,7 +1568,7 @@ public void showDetails(OCFile file) {
15681568 public void showDetails (OCFile file , int activeTab ) {
15691569 User currentUser = getUser ().orElseThrow (RuntimeException ::new );
15701570
1571- resetScrolling ();
1571+ resetScrolling (true );
15721572
15731573 Fragment detailFragment = FileDetailFragment .newInstance (file , currentUser , activeTab );
15741574 setLeftFragment (detailFragment );
@@ -1592,11 +1592,13 @@ public void lockScrolling() {
15921592 * Resets content scrolling and toolbar collapse
15931593 */
15941594 @ VisibleForTesting
1595- public void resetScrolling () {
1595+ public void resetScrolling (boolean expandAppBar ) {
15961596 AppBarLayout .LayoutParams appbarParams = (AppBarLayout .LayoutParams ) binding .appbar .toolbarFrame .getLayoutParams ();
15971597 appbarParams .setScrollFlags (AppBarLayout .LayoutParams .SCROLL_FLAG_SCROLL | AppBarLayout .LayoutParams .SCROLL_FLAG_ENTER_ALWAYS );
15981598 binding .appbar .toolbarFrame .setLayoutParams (appbarParams );
1599- binding .appbar .appbar .setExpanded (true , false );
1599+ if (expandAppBar ) {
1600+ binding .appbar .appbar .setExpanded (true , false );
1601+ }
16001602 }
16011603
16021604 @ Override
0 commit comments