|
@@ -63,6 +63,7 @@ import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
|
|
|
import com.owncloud.android.ui.dialog.RemoveFilesDialogFragment;
|
|
|
import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
|
|
|
import com.owncloud.android.ui.helpers.SparseBooleanArrayParcelable;
|
|
|
+import com.owncloud.android.ui.interfaces.ExtendedListFragmentInterface;
|
|
|
import com.owncloud.android.ui.preview.PreviewImageFragment;
|
|
|
import com.owncloud.android.ui.preview.PreviewMediaFragment;
|
|
|
import com.owncloud.android.ui.preview.PreviewTextFragment;
|
|
@@ -78,7 +79,7 @@ import java.util.List;
|
|
|
*
|
|
|
* TODO refactor to get rid of direct dependency on FileDisplayActivity
|
|
|
*/
|
|
|
-public class OCFileListFragment extends ExtendedListFragment {
|
|
|
+public class OCFileListFragment extends ExtendedListFragment implements ExtendedListFragmentInterface {
|
|
|
|
|
|
private static final String TAG = OCFileListFragment.class.getSimpleName();
|
|
|
|
|
@@ -193,7 +194,8 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
|
mAdapter = new FileListListAdapter(
|
|
|
mJustFolders,
|
|
|
getActivity(),
|
|
|
- mContainerActivity
|
|
|
+ mContainerActivity,
|
|
|
+ this
|
|
|
);
|
|
|
setListAdapter(mAdapter);
|
|
|
|
|
@@ -351,6 +353,11 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
|
com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void finishedFiltering() {
|
|
|
+ updateFooter();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Handler for multiple selection mode.
|
|
|
*
|
|
@@ -791,12 +798,12 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void updateLayout() {
|
|
|
+ private void updateFooter() {
|
|
|
if (!mJustFolders) {
|
|
|
int filesCount = 0, foldersCount = 0;
|
|
|
int count = mAdapter.getCount();
|
|
|
OCFile file;
|
|
|
- for (int i=0; i < count ; i++) {
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
file = (OCFile) mAdapter.getItem(i);
|
|
|
if (file.isFolder()) {
|
|
|
foldersCount++;
|
|
@@ -808,7 +815,12 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
|
}
|
|
|
// set footer text
|
|
|
setFooterText(generateFooterText(filesCount, foldersCount));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ private void updateLayout() {
|
|
|
+ if (!mJustFolders) {
|
|
|
+ updateFooter();
|
|
|
// decide grid vs list view
|
|
|
OwnCloudVersion version = AccountUtils.getServerVersion(
|
|
|
((FileActivity)mContainerActivity).getAccount());
|