Merge pull request #10133 from nextcloud/fix/more-scrolling-bugs

Fix contents cut off when scrolling is locked
This commit is contained in:
Álvaro Brey 2022-05-02 18:10:53 +02:00 committed by GitHub
commit 3c97b4b619
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 9 deletions

View file

@ -1546,14 +1546,10 @@ public class FileDisplayActivity extends FileActivity
*/
@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);
}
/**
@ -1561,9 +1557,6 @@ public class FileDisplayActivity extends FileActivity
*/
@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);

View file

@ -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