mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 18:59:18 +03:00
Fix empty state for media view.
This commit is contained in:
parent
5fe41d592f
commit
6c32bbf8a8
2 changed files with 14 additions and 9 deletions
|
@ -6,7 +6,7 @@
|
||||||
* @author TSI-mc
|
* @author TSI-mc
|
||||||
* Copyright (C) 2022 Tobias Kaminsky
|
* Copyright (C) 2022 Tobias Kaminsky
|
||||||
* Copyright (C) 2022 Nextcloud GmbH
|
* Copyright (C) 2022 Nextcloud GmbH
|
||||||
* Copyright (C) 2022 TSI-mc
|
* Copyright (C) 2023 TSI-mc
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
@ -195,14 +195,14 @@ class GalleryAdapter(
|
||||||
|
|
||||||
if (finalSortedList.isEmpty()) {
|
if (finalSortedList.isEmpty()) {
|
||||||
photoFragment.setEmptyListMessage(SearchType.GALLERY_SEARCH)
|
photoFragment.setEmptyListMessage(SearchType.GALLERY_SEARCH)
|
||||||
} else {
|
|
||||||
files = finalSortedList
|
|
||||||
.groupBy { firstOfMonth(it.modificationTimestamp) }
|
|
||||||
.map { GalleryItems(it.key, transformToRows(it.value)) }
|
|
||||||
.sortedBy { it.date }.reversed()
|
|
||||||
|
|
||||||
Handler(Looper.getMainLooper()).post { notifyDataSetChanged() }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
files = finalSortedList
|
||||||
|
.groupBy { firstOfMonth(it.modificationTimestamp) }
|
||||||
|
.map { GalleryItems(it.key, transformToRows(it.value)) }
|
||||||
|
.sortedBy { it.date }.reversed()
|
||||||
|
|
||||||
|
Handler(Looper.getMainLooper()).post { notifyDataSetChanged() }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun transformToRows(list: List<OCFile>): List<GalleryRow> {
|
private fun transformToRows(list: List<OCFile>): List<GalleryRow> {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* @author TSI-mc
|
* @author TSI-mc
|
||||||
* Copyright (C) 2019 Tobias Kaminsky
|
* Copyright (C) 2019 Tobias Kaminsky
|
||||||
* Copyright (C) 2019 Nextcloud GmbH
|
* Copyright (C) 2019 Nextcloud GmbH
|
||||||
* Copyright (C) 2022 TSI-mc
|
* Copyright (C) 2023 TSI-mc
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -40,6 +40,7 @@ import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||||
import com.owncloud.android.datamodel.OCFile;
|
import com.owncloud.android.datamodel.OCFile;
|
||||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
|
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
|
||||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||||
|
import com.owncloud.android.ui.EmptyRecyclerView;
|
||||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||||
import com.owncloud.android.ui.activity.FolderPickerActivity;
|
import com.owncloud.android.ui.activity.FolderPickerActivity;
|
||||||
import com.owncloud.android.ui.activity.ToolbarActivity;
|
import com.owncloud.android.ui.activity.ToolbarActivity;
|
||||||
|
@ -161,6 +162,10 @@ public class GalleryFragment extends OCFileListFragment implements GalleryFragme
|
||||||
|
|
||||||
setRecyclerViewAdapter(mAdapter);
|
setRecyclerViewAdapter(mAdapter);
|
||||||
|
|
||||||
|
//update the footer as there is no footer shown in media view
|
||||||
|
if (getRecyclerView() instanceof EmptyRecyclerView) {
|
||||||
|
((EmptyRecyclerView) getRecyclerView()).setHasFooter(false);
|
||||||
|
}
|
||||||
|
|
||||||
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 1);
|
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 1);
|
||||||
mAdapter.setLayoutManager(layoutManager);
|
mAdapter.setLayoutManager(layoutManager);
|
||||||
|
|
Loading…
Reference in a new issue