mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 10:18:59 +03:00
wip
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
02d0f8aec0
commit
2e9269510a
4 changed files with 22 additions and 4 deletions
|
@ -32,9 +32,17 @@ class UploadFilesActivityIT : AbstractIT() {
|
|||
|
||||
@Test
|
||||
// @ScreenshotTest // TODO re-enable and make sure that folder content on emulator is the same on all devices
|
||||
fun open() {
|
||||
fun noneSelected() {
|
||||
val sut: UploadFilesActivity = activityRule.launchActivity(null)
|
||||
|
||||
screenshot(sut)
|
||||
}
|
||||
|
||||
fun fileSelected() {
|
||||
val sut: UploadFilesActivity = activityRule.launchActivity(null)
|
||||
|
||||
// TODO select one
|
||||
|
||||
screenshot(sut)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,6 +109,7 @@ public class UploadFilesActivity extends DrawerActivity implements LocalFileList
|
|||
private Menu mOptionsMenu;
|
||||
private SearchView mSearchView;
|
||||
private Spinner mBehaviourSpinner;
|
||||
private MaterialButton uploadButton;
|
||||
|
||||
/**
|
||||
* Helper to launch the UploadFilesActivity for which you would like a result when it finished. Your
|
||||
|
@ -179,9 +180,10 @@ public class UploadFilesActivity extends DrawerActivity implements LocalFileList
|
|||
cancelButton.setTextColor(ThemeColorUtils.primaryColor(this, true));
|
||||
cancelButton.setOnClickListener(this);
|
||||
|
||||
MaterialButton uploadButton = findViewById(R.id.upload_files_btn_upload);
|
||||
uploadButton = findViewById(R.id.upload_files_btn_upload);
|
||||
ThemeButtonUtils.colorPrimaryButton(uploadButton, this);
|
||||
uploadButton.setOnClickListener(this);
|
||||
uploadButton.setEnabled(false);
|
||||
|
||||
int localBehaviour = preferences.getUploaderBehaviour();
|
||||
|
||||
|
@ -548,7 +550,7 @@ public class UploadFilesActivity extends DrawerActivity implements LocalFileList
|
|||
*/
|
||||
@Override
|
||||
public void onFileClick(File file) {
|
||||
// nothing to do
|
||||
uploadButton.setEnabled(mFileListFragment.getCheckedFilesCount() > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -426,7 +426,7 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
|
|||
output = resources.getQuantityString(R.plurals.file_list__footer__folder, foldersCount, foldersCount);
|
||||
} else {
|
||||
output = resources.getQuantityString(R.plurals.file_list__footer__file, filesCount, filesCount) + ", " +
|
||||
resources.getQuantityString(R.plurals.file_list__footer__folder, foldersCount, foldersCount);
|
||||
resources.getQuantityString(R.plurals.file_list__footer__folder, foldersCount, foldersCount);
|
||||
}
|
||||
|
||||
return output;
|
||||
|
@ -436,6 +436,10 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
|
|||
this.gridView = gridView;
|
||||
}
|
||||
|
||||
public int checkedFilesCount() {
|
||||
return checkedFiles.size();
|
||||
}
|
||||
|
||||
private static class LocalFileListItemViewHolder extends LocalFileListGridItemViewHolder {
|
||||
private final TextView fileSize;
|
||||
private final TextView lastModification;
|
||||
|
|
|
@ -294,6 +294,10 @@ public class LocalFileListFragment extends ExtendedListFragment implements
|
|||
return mAdapter.getCheckedFilesPath();
|
||||
}
|
||||
|
||||
public int getCheckedFilesCount() {
|
||||
return mAdapter.checkedFilesCount();
|
||||
}
|
||||
|
||||
public void sortFiles(FileSortOrder sortOrder) {
|
||||
mSortButton.setText(DisplayUtils.getSortOrderStringId(sortOrder));
|
||||
mAdapter.setSortOrder(sortOrder);
|
||||
|
|
Loading…
Reference in a new issue