Skip to content

Commit 66ba35a

Browse files
mrpenydomdomegg
authored andcommitted
Fix commons-app#2205: Fix upload card view arrow direction error (commons-app#2653)
1 parent db5290e commit 66ba35a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,18 @@ private void handleNullMedia() {
667667
finish();
668668
}
669669

670+
/**
671+
* Rotates the button and shows or hides the content based on the given state. Typically used
672+
* for collapsing or expanding {@link CardView} animation.
673+
*
674+
* @param state the expanded state of the View whose elements are to be updated. True if
675+
* expanded.
676+
* @param button the image to rotate. Typically an arrow points up when the CardView is
677+
* collapsed and down when it is expanded.
678+
* @param content the Views that should be shown or hidden based on the state.
679+
*/
670680
private void updateCardState(boolean state, ImageView button, View... content) {
671-
button.animate().rotation(button.getRotation() + (state ? 180 : -180)).start();
681+
button.animate().rotation(state ? 180 : 0).start();
672682
if (content != null) {
673683
for (View view : content) {
674684
view.setVisibility(state ? View.VISIBLE : View.GONE);

0 commit comments

Comments
 (0)