refactor: apply return oriented programming convention (#248)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
hyunsu15 2022-12-23 05:14:41 +09:00 committed by GitHub
parent 9ab8a646ed
commit b663880741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,18 +109,21 @@ public class DownloadButton {
isShowing = z;
ImageView imageView = _button.get();
if (_constraintLayout != null && imageView != null) {
if (_constraintLayout == null || imageView == null)
return;
if (z && isDownloadButtonEnabled) {
LogHelper.printDebug(() -> "Fading in");
imageView.setVisibility(View.VISIBLE);
imageView.startAnimation(fadeIn);
} else if (imageView.getVisibility() == View.VISIBLE) {
}
else if (imageView.getVisibility() == View.VISIBLE) {
LogHelper.printDebug(() -> "Fading out");
imageView.startAnimation(fadeOut);
imageView.setVisibility(View.GONE);
}
}
}
public static void refreshShouldBeShown() {
isDownloadButtonEnabled = shouldBeShown();