mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fix-Peer Review Buttons not get disabled after voting an Image for deletion (#5519)
* Fix-Peer Review Buttons not get disabled after voting an Image for deletion * Fix
This commit is contained in:
parent
42641644cb
commit
4c43bf2bd4
3 changed files with 25 additions and 0 deletions
|
|
@ -205,6 +205,8 @@ public class DeleteHelper {
|
||||||
});
|
});
|
||||||
|
|
||||||
alert.setPositiveButton(context.getString(R.string.ok), (dialogInterface, i) -> {
|
alert.setPositiveButton(context.getString(R.string.ok), (dialogInterface, i) -> {
|
||||||
|
reviewCallback.disableButtons();
|
||||||
|
|
||||||
|
|
||||||
String reason = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_alert_set_positive_button_reason) + " ";
|
String reason = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_alert_set_positive_button_reason) + " ";
|
||||||
|
|
||||||
|
|
@ -229,6 +231,7 @@ public class DeleteHelper {
|
||||||
} else {
|
} else {
|
||||||
reviewCallback.onFailure();
|
reviewCallback.onFailure();
|
||||||
}
|
}
|
||||||
|
reviewCallback.enableButtons();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -191,5 +191,9 @@ public class ReviewController {
|
||||||
void onSuccess();
|
void onSuccess();
|
||||||
|
|
||||||
void onFailure();
|
void onFailure();
|
||||||
|
|
||||||
|
void disableButtons();
|
||||||
|
|
||||||
|
void enableButtons();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,24 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is called when an image is being loaded
|
||||||
|
* to disable the review buttons
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void disableButtons() {
|
||||||
|
ReviewImageFragment.this.disableButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is called when an image has
|
||||||
|
* been loaded to enable the review buttons.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void enableButtons() {
|
||||||
|
ReviewImageFragment.this.enableButtons();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue