Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27881] Android: ImageView tintColor has no effect

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-05-14T14:33:28.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.0.2
ComponentsAndroid
Labelsn/a
ReporterGary Mathews
AssigneeGary Mathews
Created2020-05-05T18:15:58.000+0000
Updated2020-05-14T14:33:28.000+0000

Description

- Ti.UI.ImageView.tintColor fails to apply the defined color to the ImageView *TEST CASE*
const win = Ti.UI.createWindow({ backgroundColor: 'white' });
const img = Ti.UI.createImageView({
	width: '80%',
	image: 'https://about.gitlab.com/images/press/logo/png/gitlab-icon-1-color-black-rgb.png',
	tintColor: 'red'
});

win.add(img);
win.open();
*EXPECTED* - Image should tint to defined color (red). *ACTUAL* - Image does not tint to defined color and remains black.

Attachments

FileDateSize
Screen Shot 2020-05-06 at 1.49.07 PM.png2020-05-06T17:49:30.000+000017690
Screen Shot 2020-05-06 at 2.00.13 PM.png2020-05-06T18:00:41.000+000036035

Comments

  1. Gary Mathews 2020-05-05

    master: https://github.com/appcelerator/titanium_mobile/pull/11690
  2. Joshua Quick 2020-05-05

    We need to double check iOS' behavior. I'm pretty sure iOS's tint feature does a color "fill" in all non-transparent pixels. As in it replaces the original RGB values with the tint color and retains the alpha (or possibly multiples the alpha channels together).
  3. Christopher Williams 2020-05-06

    For reference, here's what iOS looks like for this code sample: !Screen Shot 2020-05-06 at 1.49.07 PM.png|thumbnail!
  4. Christopher Williams 2020-05-06

    It'd be nice to have some pre-defined images with/without alpha, including with segments with partial translucency so we could easily compare originals versus expectations here. iOS uses UIImageRenderingModeAlwaysTemplate on the original image (the gitlab icon) - which the docs say ignores the color info and applies tint over it. So, I assume the color doesn't really matter but the alpha values do for the input image.
  5. Christopher Williams 2020-05-06

    Here's an image with full to partial transparency in a radial gradient: https://pngimage.net/wp-content/uploads/2018/06/png-partial-transparency-2.png - which on iOS looks like this (with the above sample modified to point to the new image): !Screen Shot 2020-05-06 at 2.00.13 PM.png|thumbnail!
  6. Joshua Quick 2020-05-06

    I have mask images we can use in the "MaskedImage.zip" project attached to [TIMOB-17363]. I created all of the images... except for "MaskCamera.png" and "MaskCircleLock.png" which came from the Android SDK and are Apache licensed.
  7. Gary Mathews 2020-05-08

    9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11696
  8. Samir Mohammed 2020-05-11

    FR Passed, waiting on Jenkins build for master and 9_0_X.
  9. Christopher Williams 2020-05-11

    merged to master for 9.1.0 target, 9_0_X for 9.0.2 target.
  10. Samir Mohammed 2020-05-14

    *Closing ticket.* Fix verified in SDK version 9.1.0.v20200506102029 and 9.0.2.v20200511101656 *Test and other information can be found at:* master: https://github.com/appcelerator/titanium_mobile/pull/11690 9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11696

JSON Source