-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce View.kt size. #8708
Reduce View.kt size. #8708
Conversation
40ec913
to
6cdb011
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks almost good
private class RunnableExecutorAdapter( | ||
private val view: View, | ||
private val execOnEnd: Runnable?, | ||
private val shouldHideView: Boolean | ||
) : AnimatorListenerAdapter() { | ||
override fun onAnimationEnd(animation: Animator) { | ||
if (shouldHideView) { | ||
view.isGone = true | ||
} | ||
execOnEnd?.run() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd create two classes, one for when shouldHideView
is true
, one for when it's false
, in order to avoid that runtime check (maybe the second can extend the first, but idk). The names for the two classes should be imo: HideAndExecOnEndListener
and ExecOnEndListener
. RunnableExecutorAdapter
is not so meaningful.
be334cd
to
d65683f
Compare
d65683f
to
8024b43
Compare
Kudos, SonarCloud Quality Gate passed! |
What is it?
Description of the changes in your PR
View.kt
.AnimatorListenerAdapter
.Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence