[TIMOB-28447] Android: Add "imageTouchFeedback" to Ti.UI.ImageView
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-08-03T10:46:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.1.0 |
Components | Android |
Labels | ImageView, android, touch |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2021-05-14T05:48:51.000+0000 |
Updated | 2021-08-03T10:46:06.000+0000 |
Description
*Summary:*
On Android, the [touchFeedback](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-touchFeedback) property applies ripple effect to a view's "background" when the view is touched. When applied to a
Ti.UI.ImageView
, this ripple effect can't be seen if the image is opaque (ie: not transparent) and completely covers the view. This is not a bug, but app developers would like the ability to apply a touch ripple effect to the foreground "image".
*Feature Proposal:*
Add the following properties to Ti.UI.ImageView
...
* imageTouchFeedback
// boolean
* imageTouchFeedbackColor
// optional string
When the new "imageTouchFeedback" property is set true
, the ripple effect should be applied to the foreground image assigned via the "image" property.
*Example Code:*
const window = Ti.UI.createWindow();
window.add(Ti.UI.createImageView({
image: "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/tests/Resources/ExifRotate90.jpg",
imageTouchFeedback: true,
imageTouchFeedbackColor: "yellow",
autorotate: true,
}));
window.open();
*Work-Around:*
For older Titanium versions, you can apply a touch ripple effect via the "backgroundImage" instead. The downside with this is that images are not loaded asynchronously via this property and the EXIF orientation is ignored.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12814
Merged