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
[TIMOB-25619] Android: Allow non-file TiBlob to be previewed #9771
Conversation
Generated by 🚫 dangerJS |
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.
CR: Pass
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.
CR: Pass
Uri imageUri = TiFileProvider.createUriFrom(f.getNativeFile()); | ||
Uri imageUri = null; | ||
|
||
if (image.getNativePath() == null) { |
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.
may want to consider refactoring this handling with the equivalent code in EmailDialogProxy. Basically in both instances you're trying to get a TiBlob converted to a File.
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.
For everyone's info, the way EmailDialogProxy is saving blobs to a temp file needs to be refactored too. It always saves blobs to the same filename. So, the last blob saved gets overwritten by the next blob saved to file.
https://jira.appcelerator.org/browse/TIMOB-25568
I recommend that we refactor our handling when addressing TIMOB-25568.
tests/Resources/ti.media.test.js
Outdated
@@ -38,6 +38,37 @@ describe('Titanium.Media', function () { | |||
should(Ti.Media.previewImage).be.a.Function; | |||
}); | |||
|
|||
it.android('previewImage of non-file blob', function () { |
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.
my bad, I moved this test into the suite so there's a conflict now. You can move this to a ti.media.addontest.js or copy the ti/media.test front he suite and add this (or uncomment the variant of this I wrote using takeScreenshot which also exposed the issue).
5d60d7f
to
9a0c53c
Compare
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 Was able to see a a preview of non-file TiBlob
Test Steps:
- Created a titanium project with the build form this PR
- Added the above code in to the project
- Ran the project
- Was able to view the blob without any runtime errors (which were seen on older versions of the SDK
- Also saw the following in the console
[INFO] : success, displaying preview
Test Environment
APPC Studio: 5.0.0.201711280737
APPC CLI: 7.0.1
Device: Nexus 6p (8.1.0)
Operating System Name: Mac OS High Sierra
Operating System Version: 10.13
Node.js Version: 8.9.1
f59ef8f
to
eb52b97
Compare
4561815
to
bca92a2
Compare
b70530a
to
8851cc4
Compare
b8e3e6e
to
a71493d
Compare
3de261e
to
3d9afac
Compare
fc22532
to
cfc344d
Compare
|
TiBlob
to be previewedTEST CASE
JIRA Ticket