Skip to content

Select-all and Select-inverse added to UploadFilesActivity - #2404

Merged
jesmrec merged 7 commits into
owncloud:masterfrom
shashvat-kedia:Fix-New-1015
Feb 12, 2019
Merged

jesmrec merged 7 commits into
owncloud:masterfrom
shashvat-kedia:Fix-New-1015

Conversation

@shashvat-kedia

@shashvat-kedia shashvat-kedia commented Dec 19, 2018 •

Copy link
Copy Markdown
Contributor

Fix to issue #1015.


BUGS & IMPROVEMENTS

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@davigonz I have fixed #1015.

@davigonz

Copy link
Copy Markdown
Contributor

Starting the review here...

}
}
int noOfFiles = mFileListFragment.getAdapter().getNoOfFilesInDir();
if(noOfFilesSelected == noOfFiles){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after if and parenthesis

int noOfFiles = mFileListFragment.getAdapter().getNoOfFilesInDir();
if(noOfFilesSelected == noOfFiles){
mItemSelectAll.setVisible(false);
} else{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after else

} else{
mItemSelectAll.setVisible(true);
}
if(noOfFiles > 0){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

}
if(noOfFiles > 0){
mItemSelectInverse.setVisible(true);
} else{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

*/
private void setSelectAllMenuItemState(){
if (mFileListFragment.getAdapter().getNoOfFilesInDir()
== mFileListFragment.getCheckedFilePaths().length) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the equal at the end of the previous line so that the reader knows that there's something below that

if (mFileListFragment.getAdapter().getNoOfFilesInDir() ==
mFileListFragment.getCheckedFilePaths().length) {

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
savedInstanceState.putStringArrayList(OUT_STATE_CHECKED_FILES, mAdapter.getCheckedFiles());
savedInstanceState.putIntegerArrayList(OUT_STATE_NO_OF_FILES_SELECTED,mNoOfFilesSelected);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after ,

mAdapter.setCheckedFiles(savedInstanceState.getStringArrayList(OUT_STATE_CHECKED_FILES));
mNoOfFilesSelected = savedInstanceState.getIntegerArrayList(OUT_STATE_NO_OF_FILES_SELECTED);
} else{
mNoOfFilesSelected = new ArrayList<Integer>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think you do not need Integer here, just write <>

}

public void selectAll(){
for(int i = 0; i < mAdapter.getCount(); i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some spaces between for and if in this method and selectInverse() one

@davigonz

Copy link
Copy Markdown
Contributor

@SD1998 first code review in here, please have a look at the requested changes

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@davigonz I have made the changes.

* @author David A. Velasco
* @author Shashvat Kedia
* @author Christian Schabesberger
* Copyright (C) 2018 ownCloud GmbH.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this year to 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid this on each touched file. So I made this 5 minute PR #2444 to solve this at once.

@davigonz

Copy link
Copy Markdown
Contributor

I have made the changes.

Great, thanks @SD1998 , one tiny change more and this is ready for QA

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@davigonz I have made the changes

@davigonz

Copy link
Copy Markdown
Contributor

Thanks @SD1998 , ready for QA @jesmrec

@jesmrec

jesmrec commented Feb 4, 2019

Copy link
Copy Markdown
Member

Let's QA this

@jesmrec

jesmrec commented Feb 4, 2019 •

Copy link
Copy Markdown
Member

(1) [FIXED]

Check out these steps:

  1. Open "Upload" Dialog
  2. Select "Select inverse"

Current: Not only are selected all the items, also the list is re-sorted
Expected: Only the selection is done

CC @SD1998

@jesmrec
jesmrec self-requested a review February 4, 2019 10:07
@jesmrec

jesmrec commented Feb 4, 2019 •

Copy link
Copy Markdown
Member

(2) [FIXED]

  1. In the upload picker, select two items
  2. Select All
  3. Select inverse

Current: The items selected in 1. are the select4ed
Expected: All items unselected, so you selected all in step 2 and the inverse is selected none of them

Android 7

@SD1998

@shashvat-kedia

shashvat-kedia commented Feb 4, 2019 •

Copy link
Copy Markdown
Contributor Author

@jesmrec Thanks, I will look into these issues.

@jesmrec

jesmrec commented Feb 12, 2019

Copy link
Copy Markdown
Member

@SD1998 we are planning to release a new beta the incoming days. Do you think it will be posible to include? if not, no worries, we have a bit of extra time till the final 2.10 release.

@shashvat-kedia
shashvat-kedia force-pushed the Fix-New-1015 branch 2 times, most recently from 0826d1c to dc18a78 Compare February 12, 2019 08:44
@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@jesmrec I have fixed the bugs.

@jesmrec

jesmrec commented Feb 12, 2019

Copy link
Copy Markdown
Member

Thanks!!! i will take a look and let you know the final result.

@jesmrec

jesmrec commented Feb 12, 2019

Copy link
Copy Markdown
Member

All stuff fixed. Approved-

@SD1998 please solve the existing conflict in owncloudApp/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java , rebase with master, and we are ready to go.

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@jesmrec this is already done.

@jesmrec

jesmrec commented Feb 12, 2019

Copy link
Copy Markdown
Member

Thanks. Branch is not rebased yet, this is the last step before merging

@shashvat-kedia

Copy link
Copy Markdown
Contributor Author

@jesmrec I have done the rebase.

@jesmrec
jesmrec merged commit ca17f74 into owncloud:master Feb 12, 2019
@jesmrec

jesmrec commented Feb 12, 2019

Copy link
Copy Markdown
Member

Perfect... merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants