titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

feat(android): add autoSize to label

Open m1ga opened this issue 2 years ago • 1 comments

fixes https://github.com/appcelerator/titanium_mobile/issues/13244

Adds a property autoSize to Ti.UI.Label. This makes the text fill out the label width/height automatically: ezgif-2-2a79fa0f8f It won't change the fontSize and will restore the old value when you deactivate it. Similar to the minimumFontSize but you don't need to define a max/min value.

var win = Ti.UI.createWindow({
	backgroundColor: "#fff"
});
var lbl = Ti.UI.createLabel({
	text: "test",
	width: 200,
	height: 100,
	borderColor: "#000",
	borderWidth: 1,
	color: "#000",
	autoSize: false,
	textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER
});
win.add(lbl);
win.open();
setInterval(function() {
	lbl.autoSize = !lbl.autoSize
}, 2000);

Parity would be very nice!

m1ga avatar Jan 15 '22 13:01 m1ga

Fails
:no_entry_sign: Test reports missing for iPad. This indicates that a build failed or the test app crashed
:no_entry_sign:

Test suite crashed on iOS simulator. Please see the crash log for more details.

:no_entry_sign:

:microscope: There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Warnings
:warning:

Commit caa2563518dafb38207bc9b04f740c5d2d54904e has a message "updateProperty" giving 2 errors:

  • subject may not be empty
  • type may not be empty
:warning: Tests have failed, see below for more information.
:warning: There is no linked JIRA ticket in the PR body. Please include the URL of the relevant JIRA ticket. If you need to, you may file a ticket on JIRA
Messages
:book:

:rotating_light: This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

:book: :x: 4 tests have failed There are 4 tests failing and 935 skipped out of 17243 total tests.
:book: :tada: Another contribution from our awesome community member, m1ga! Thanks again for helping us make Titanium SDK better. :thumbsup:

Tests:

ClassnameNameTimeError
android.emulator.main.Titanium.Filesystem.File#getDirectoryListing() can access resource directory files (12)2.023
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
ios.macos.Titanium.Filesystem.File.remoteBackup assigning Boolean value doesn't throw (11.4.0)2.913
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
run@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-13245/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti.main.js:9415:22
processImmediateQueue@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-13245/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti.main.js:9478:18
drainQueues@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-13245/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti.main.js:9455:52
ios.macos.Titanium.Media.AudioPlayer.properties.duration gives around 45 seconds for test input (11.4.0)1.015
Error: expected -2147483648 to be within 45250..45500
value@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-13245/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/node_modules/should/cjs/should.js:356:23
file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-13245/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti.media.audioplayer.test.js:134:51
ios.macos.Titanium.Media.VideoPlayerClose window containing a video player (TIMOB-25574) (11.4.0)158.238
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)

Generated by :no_entry_sign: dangerJS against caa2563518dafb38207bc9b04f740c5d2d54904e

build avatar Jan 15 '22 14:01 build