Skip to content
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

fix(android): auto-scaling mode must stretch ImageView if both width/height set #13077

Merged
merged 2 commits into from Sep 23, 2021

Conversation

jquick-axway
Copy link
Contributor

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28537

Summary:

  • When ImageView properties "width" and "height" are set, it should stretch disproportionally by default when using "scalingMode" Ti.Media.IMAGE_SCALING_AUTO which is the default. Instead, it is wrongly letterbox scaling image. This is for backward compatibility with Titanium 10.0.2 and older SDK versions.
  • Needs to match what we document here.
  • Regression as of Titanium 10.1.0.RC.

Test:

  1. Build and run the below on Android.
  2. Verify image is stretch width wise as shown in "Actual Result" in TIMOB-28537.
  3. Comment out the line: // width: Ti.UI.FILL,
  4. Rebuild and re-run the app.
  5. Verify image is proportionally scaled as shown in "Result" in TIMOB-28537. (In this case, this is the correct behavior because only "width" is defined.)
const win = Ti.UI.createWindow();
win.add(Ti.UI.createImageView({
	image: "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/templates/app/angular-default/template/DefaultIcon.png",
	width: Ti.UI.FILL,
	height: 30,
}));
win.open();

@build
Copy link
Contributor

build commented Sep 20, 2021

Warnings
⚠️ Tests have failed, see below for more information.
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 7 tests have failed There are 7 tests failing and 1162 skipped out of 20666 total tests.
📖

💾 Here's the generated SDK zipfile.

📖 👍 Hey!, You deleted more code than you added. That's awesome!

Tests:

ClassnameNameTimeError
android.emulator.main.Titanium.Geolocation.methods#forwardGeocoder() works via callback argument (12)5.016
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Geolocation.<anonymous> (/ti.geolocation.test.js:585:32)
ios.ipad.Titanium.Blobresize very large image (15.0.0)10.641
Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
postlayout@file:///Users/build/Library/Developer/CoreSimulator/Devices/E1EC1393-A4C0-4233-A046-D81785FB996D/data/Containers/Bundle/Application/2F2069D3-7FE1-4D0E-A105-E2F3E7518616/mocha.app/ti.blob.test.js:464:13
ios.ipad.Titanium.UI.WebView.userAgent (15.0.0)60.001
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
ios.iphone.Titanium.Blobresize very large image (15.0.0)10.557
Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
postlayout@file:///Users/build/Library/Developer/CoreSimulator/Devices/EA9D4E3D-F41B-435D-BB03-589B921A1FF7/data/Containers/Bundle/Application/2D7B5A90-725D-418E-AD1A-CCF6EC5681A7/mocha.app/ti.blob.test.js:464:13
ios.iphone.Titanium.UI.View.borderRadius corners1 value with shadow effect (15.0.0)0.034
Error: expected 'Ti.UI.View' to match image ('snapshots/borderRadiusWithShadow_30px@3x~iphone.png')
    mismatched pixels. allowed: 0, actual: 18
value@file:///Users/build/Library/Developer/CoreSimulator/Devices/EA9D4E3D-F41B-435D-BB03-589B921A1FF7/data/Containers/Bundle/Application/2D7B5A90-725D-418E-AD1A-CCF6EC5681A7/mocha.app/node_modules/should/cjs/should.js:356:23
postlayout@file:///Users/build/Library/Developer/CoreSimulator/Devices/EA9D4E3D-F41B-435D-BB03-589B921A1FF7/data/Containers/Bundle/Application/2D7B5A90-725D-418E-AD1A-CCF6EC5681A7/mocha.app/ti.ui.view.test.js:1264:39
ios.iphone.Titanium.UI.WebView.userAgent (15.0.0)60.001
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
ios.macos.Titanium.UI.WebView.userAgent (11.3.1)77.891
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)

Generated by 🚫 dangerJS against 6fe1ecf

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS
FT: PASS

@lokeshchdhry
Copy link
Contributor

FR Passed.

@lokeshchdhry lokeshchdhry merged commit ea0d99c into tidev:master Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants