[TIMOB-25220] Android: ImageView doesn't accept File
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-09-21T23:29:17.000+0000 |
Affected Version/s | Release 6.2.0 |
Fix Version/s | Release 6.2.0 |
Components | Android |
Labels | automated, regression |
Reporter | Michael Gangolf |
Assignee | Gary Mathews |
Created | 2017-09-01T15:12:30.000+0000 |
Updated | 2017-10-05T21:21:45.000+0000 |
Description
Summary:
In 6.2.0.RC getFile() returns a FileProxy that can't be shown in an ImageView
*Steps:*
* Create a default Titanium Classic project
* add this code:
var win = Ti.UI.createWindow({backgroundColor: 'grey'});
var f = Ti.Filesystem.getFile("assets/images/tab1.png");
if (f.exists()) {
console.log("file exists");
var img = Ti.UI.createImageView({
image: f,
top: 10
});
win.add(img);
var img2 = Ti.UI.createImageView({
image: f.nativePath
});
win.add(img2);
} else {
console.log("file does not exists at " + f.nativePath);
}
win.open();
*Output*
6.1.2.GA shows both images:
!612_ga_images.png|thumbnail!
6.2.0.RC only shows one image:
!6_2_0_rc_images.png|thumbnail!
and this error:
{noformat}
TiDrawableReference: (main) [83,83] Unknown image resource type: FileProxy. Returning null drawable reference
{noformat}
Attachments
File | Date | Size |
---|---|---|
6_2_0_rc_images.png | 2017-09-01T15:10:21.000+0000 | 31169 |
612_ga_images.png | 2017-09-01T15:10:21.000+0000 | 30694 |
Thanks for the report [~michael], moving over to TIMOB Can reproduce using Ti SDK 6.2.0.v20170831112315 OnePlus 3 7.1.1
master: https://github.com/appcelerator/titanium_mobile/pull/9392 6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9394
FR Passed for master & backport. PR's merged.
Verified the fix in SDK 6.2.0.v20170906064110 & 7.0.0.v20170906103333. Closing. Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.0.v20170906064110 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.4-9 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.13 Node Ver: 6.11.2 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 ⇨ google Nexus 5 --- Android 6.0.1 Emulator: Android 4.4.2
Reopening to correct code in steps.
Code for appium automation: