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
feat(android): support touch feedback for all backgrounds or no background #11795
Conversation
- Used to only be supported when using "backgroundColor" property. - Now applied to all background types such as: * backgroundImage * backgroungGradient * No background
|
*/ | ||
private void applyTouchFeedback(@NonNull Integer backgroundColor, @Nullable Integer rippleColor) | ||
private void applyTouchFeedback(Integer rippleColor) |
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.
Any particular reason to drop the @Nullable
? I kind of like having it be explicit in our APIs so we can use tools to verify checking for null pointers or not...
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.
Personally, I question the value of the @Nullable
annotation. All reference types are implicitly nullable. The only benefit it provides is more for IDE intellisense purposes since it reveals the annotations and effectively documents the API which we can already do via JavaDoc comments.
The @NonNull
annotation is far more valuable since we can use it to trigger compiler/linter errors. So, if it doesn't have the @NonNull
annotation, then it's assumed nullable.
Anyways, that's my 2 cents. Unless you can think of something else that might benefit from this?
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 get that things are implicitly @Nullable
(so long as they're not primitives). I saw it more as a marker of what APIs we've "done" since we've got this large legacy codebase that we didn't use the annotations on. If we don't use @Nullable
, it's unclear if we've already reviewed the API and decided they're all implicitly nullable, or if we simply haven't gotten around to adding annotations.
} | ||
}); | ||
|
||
it.android('touchFeedback', (finish) => { |
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 appreciate the effort in creating a test, but I don't think it's really verifying anything since this is an interactive UI change, correct?
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.
Right. It doesn't verify anything, but it does exercise the native API to make sure it doesn't crash. So, I guess it's better than nothing? 🤷♂️
Ideally, QE should test this by hand via a functional/smoke test since this is a visual feature.
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.
The changes LGTM. I don't think the test here would achieve anything, unfortunately so likely this just should be added to QE's UI integration suite if possible.
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.
FR Passed, tested using the test case in description and following the mentioned test steps.
Test Environment
MacOS Big Sur: 11.0 Beta
Xcode: 12.0 Beta
Java Version: 1.8.0_242
Android NDK: 21.3.6528147
Node.js: 12.18.1
""NPM":"5.0.0","CLI":"8.0.0""
API30 Pixel XL2 emulator
Fixed conflict and manually merged via rebase on master. |
JIRA:
https://jira.appcelerator.org/browse/TIMOB-26315
Summary:
Ti.UI.View
propertiestouchFeedback
andtouchFeedbackColor
used to only show a tap ripple effect when abackgroundColor
was applied to the view. This was a documented limitation.Test: