Skip to content

Commit

Permalink
Merge pull request #10144 from nextcloud/backport/10133/stable-3.20
Browse files Browse the repository at this point in the history
[stable-3.20] Fix contents cut off when scrolling is locked
  • Loading branch information
AlvaroBrey authored May 3, 2022
2 parents 5e42046 + 6e72d3a commit d563183
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1547,24 +1547,17 @@ public void showDetails(OCFile file, int activeTab) {
*/
@VisibleForTesting
public void lockScrolling() {
final CoordinatorLayout.LayoutParams coordinatorParams = (CoordinatorLayout.LayoutParams) binding.rootLayout.getLayoutParams();
coordinatorParams.setBehavior(null);
binding.rootLayout.setLayoutParams(coordinatorParams);
binding.rootLayout.setNestedScrollingEnabled(false);
binding.appbar.appbar.setExpanded(true, false);
final AppBarLayout.LayoutParams appbarParams = (AppBarLayout.LayoutParams) binding.appbar.toolbarFrame.getLayoutParams();
appbarParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL);
binding.appbar.toolbarFrame.setLayoutParams(appbarParams);
binding.appbar.appbar.setExpanded(true, false);
}

/**
* Resets content scrolling and toolbar collapse
*/
@VisibleForTesting
public void resetScrolling() {
final CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) binding.rootLayout.getLayoutParams();
params.setBehavior(new AppBarLayout.ScrollingViewBehavior());
binding.rootLayout.setLayoutParams(params);
AppBarLayout.LayoutParams appbarParams = (AppBarLayout.LayoutParams) binding.appbar.toolbarFrame.getLayoutParams();
appbarParams.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS);
binding.appbar.toolbarFrame.setLayoutParams(appbarParams);
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_preview_media.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_marginTop="?attr/actionBarSize"
tools:context=".ui.preview.PreviewMediaFragment">

<ImageView
Expand Down

0 comments on commit d563183

Please sign in to comment.