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): TabbedBar crash caused by setting properties before window opened #10646

Merged
merged 6 commits into from Mar 19, 2019

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Jan 24, 2019

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

Summary:

  • Crash caused by settings properties "labels" or "index" before the TabbedBar parent window has been opened.
  • Moved all property handling to TiUITabbedBar.java file.
  • Modified "style" JS property to return default style constant if not assigned.
  • Added additional property validation with warning log messages.

Test:

  1. Build and run the below code on Android.
  2. Verify that the app does not crash on startup. (This is the fix.)
  3. Verify that 3 tabbed bars are shown onscreen.
  4. Verify top bar reads [One | Two | Three], where One is selected.
  5. Verify middle bar reads [Red | Green | Blue], where Green is selected.
  6. Verify bottom bar reads [Alpha | Beta | Charlie], where Charlie is selected.
var window = Ti.UI.createWindow();

var tabbedBar1 = Ti.UI.createTabbedBar({
	labels: ["One", "Two", "Three"],
	index: 0,
	top: "20%",
	width: "90%",
});
window.add(tabbedBar1);

var tabbedBar2 = Ti.UI.createTabbedBar();
tabbedBar2.labels = ["Red", "Green", "Blue"];
tabbedBar2.index = 1;
tabbedBar2.top = "40%";
tabbedBar2.width = "90%";
window.add(tabbedBar2);

var tabbedBar3 = Ti.UI.createTabbedBar({
	labels: ["Uh", "Oh"],
	index: 0,
	top: "60%",
	width: "90%",
})
tabbedBar3.labels = ["Alpha", "Beta", "Charlie"];
tabbedBar3.index = 2;
window.add(tabbedBar3);

window.open();

…s" and "index" properties before parent window opened

- Added additional property valdation and warning log messages.
@build
Copy link
Contributor

build commented Jan 24, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖

✅ All tests are passing
Nice one! All 3630 tests are passing.

Generated by 🚫 dangerJS against a1b092d

Copy link
Contributor

@ypbnv ypbnv 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

Just one typo in a comment.

Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

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

FR Passed: Changing TabbedBar properties "labels" and "index" before opening window no longer causes and application crash. Tested following the steps mentioned in the description above.

Test Environment

Google pixel xl 7.1.1 sim
APPC CLI: 7.0.10
Operating System Name: Mac OS Mojave
Operating System Version: 10.14.2
Node.js Version: 8.9.1
Xcode 10.1

@ssjsamir ssjsamir merged commit 648add2 into tidev:master Mar 19, 2019
@hansemannn
Copy link
Collaborator

@jquick-axway @ypbnv This does not work correctly and even causes a UI glitch now. See the ticket for details.

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

5 participants