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,16 +109,19 @@ public class DownloadButton {
isShowing = z; isShowing = z;
ImageView imageView = _button.get(); ImageView imageView = _button.get();
if (_constraintLayout != null && imageView != null) {
if (z && isDownloadButtonEnabled) { if (_constraintLayout == null || imageView == null)
LogHelper.printDebug(() -> "Fading in"); return;
imageView.setVisibility(View.VISIBLE);
imageView.startAnimation(fadeIn); if (z && isDownloadButtonEnabled) {
} else if (imageView.getVisibility() == View.VISIBLE) { LogHelper.printDebug(() -> "Fading in");
LogHelper.printDebug(() -> "Fading out"); imageView.setVisibility(View.VISIBLE);
imageView.startAnimation(fadeOut); imageView.startAnimation(fadeIn);
imageView.setVisibility(View.GONE); }
} else if (imageView.getVisibility() == View.VISIBLE) {
LogHelper.printDebug(() -> "Fading out");
imageView.startAnimation(fadeOut);
imageView.setVisibility(View.GONE);
} }
} }