Skip to content

Conversation

@codepixely
Copy link
Contributor

Description

Fixes #1398

Fix state and text color of the deletion button if the operation is aborted. Changed state and text if user clicks "OK" to delete photo.

Tests performed

Tested on {API level & name of device/emulator}, with {build variant, e.g. ProdDebug}.

{Please test your PR at least once before submitting.}

Screenshots showing what changed

{Only for user interface changes, otherwise remove this section. See how to take a screenshot}

@codecov-io
Copy link

codecov-io commented Apr 1, 2018

Codecov Report

Merging #1403 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1403      +/-   ##
=========================================
- Coverage     3.3%    3.3%   -0.01%     
=========================================
  Files         128     128              
  Lines        6837    6844       +7     
  Branches      669     670       +1     
=========================================
  Hits          226     226              
- Misses       6596    6603       +7     
  Partials       15      15
Impacted Files Coverage Δ
...fr/free/nrw/commons/media/MediaDetailFragment.java 0% <0%> (ø) ⬆️
...ava/fr/free/nrw/commons/nearby/NearbyActivity.java 0% <0%> (ø) ⬆️
...e/nrw/commons/category/CategorizationFragment.java 0% <0%> (ø) ⬆️
...java/fr/free/nrw/commons/category/CategoryDao.java 0% <0%> (ø) ⬆️
.../fr/free/nrw/commons/nearby/NearbyMapFragment.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/nearby/DirectUpload.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23b2f3c...b7f5a14. Read the comment docs.

categoriesLoaded = true;
categoriesPresent = (categoryNames.size() > 0);
categoriesPresent = categoryNames.isEmpty();
if (!categoriesPresent) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Old version checks if categoryNames is not empty, however your fix checks if it is empty.

delete.setOnClickListener(v -> {
delete.setEnabled(false);
delete.setTextColor(getResources().getColor(R.color.deleteButtonLight));
AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this a lint issue, or you just wanted to refactor them to increase modularity?

*  Added the link in about_upload_to textfield

*  Merge conflicts resolved

*  Removed the extra textView
@neslihanturan
Copy link
Collaborator

neslihanturan commented Apr 2, 2018

It seems like you worked on your other PR #1402 . So there are unrelated changes here. Please remove them, then we can test it.

Ideally, there should be only one file changed.

@commons-app commons-app deleted a comment Apr 4, 2018
}
}

private void enableDeleteButton(boolean visibility) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracted the delete button states into this method to increase readability and reduce method complexity.

@neslihanturan
Copy link
Collaborator

@gabrielaradu thanks for your contribution, it works if user clicks cancel button however, it disables the button if user dismiss the dialog by clicking outside. Expected behavior is buttons being active if dialog is dismissed.

@neslihanturan
Copy link
Collaborator

Great @gabrielaradu , congrats your first time contribution 💃

@neslihanturan neslihanturan changed the base branch from master to 2.7.x-release April 16, 2018 12:01
@neslihanturan neslihanturan merged commit 9a3b6fc into commons-app:2.7.x-release Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants