diff --git a/changelog/unreleased/4935 b/changelog/unreleased/4935 new file mode 100644 index 00000000000..a9c055e3085 --- /dev/null +++ b/changelog/unreleased/4935 @@ -0,0 +1,7 @@ +Bugfix: Recalculate grid mode after rotation + +The grid mode column count has been recalculated after device rotation, +keeping file layouts aligned with the new orientation. + +https://github.com/owncloud/android/issues/4884 +https://github.com/owncloud/android/pull/4935 diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt index 9ea97f407ab..ce0fa864928 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt @@ -332,6 +332,9 @@ class MainFileListFragment : Fragment(), override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) updateConfigDependentSizes() + if (mainFileListViewModel.isGridModeSetAsPreferred()) { + layoutManager.spanCount = ColumnQuantity(requireContext(), R.layout.grid_item).calculateNoOfColumns() + } } private fun updateConfigDependentSizes() {