-
Notifications
You must be signed in to change notification settings - Fork 4
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
ANDROID-15230 Fix suppressed long method #391
Conversation
📱 New catalog for testing generated: Download |
setVisibilityAndColors() | ||
} | ||
|
||
fun getText(): CharSequence = |
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.
moved the public methods on top of the private ones I've created
setupAttributes(attrs, defStyleAttr) | ||
setupViewProperties() | ||
setupButtonNormal() | ||
setupButtonLoading() | ||
setupProgressBar() | ||
setButtonBackground() | ||
addViews() | ||
setVisibilityAndColors() |
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.
Code split in private methods
@@ -156,8 +154,6 @@ fun CarouselPagerIndicator( | |||
indicatorShape = indicatorShape) | |||
} | |||
|
|||
@ExperimentalPagerApi |
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.
These Experimental annotations are wrong, they were hidden by the OptIn() on the top but they shouldn't have been there. This one should have been an OptIn() one.
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { | ||
buttonNormal.isPressed = false | ||
buttonLoading.isPressed = false | ||
view.performClick() |
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.
why is this line needed? was it being handled in other side?
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.
Detekt marks it as error if view.performClick() is not invoked on a setOnTouchListener lambda
onTouch lambda should call View#performClick when a click is detected
Explanation for issues of type "ClickableViewAccessibility":
If a View that overrides onTouchEvent or uses an OnTouchListener does not also implement performClick and call it when clicks are detected, the View may not handle accessibility actions properly. Logic handling the click actions should ideally be placed in View#performClick as some accessibility services invoke performClick when a click action should occur.
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'm worried about any unexpected behavior and if it wasn't added before for a reason.. but I guess the button is still working as before right?
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.
Yup, I made a video in the pr description which checks the 2 updated elements (the progress button and the list in compose)
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!
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!
🥅 What's the goal?
Fix suppress LongMethod
🚧 How do we do it?
🧪 How can I test this?
UpdatedCode.mov