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

[TIMOB-26662] Android: TableViewRow bugs #10542

Merged
merged 12 commits into from Feb 11, 2020

Conversation

drauggres
Copy link
Contributor

@drauggres drauggres commented Dec 17, 2018

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

This PR fixes following bugs in TableViewRow:

  1. TableViewRow.getRect() always returns zeroes
  2. TableViewRow height does not grow beyond original size (but can shrink)
  3. NPE in TableViewRowProxy
java.lang.NullPointerException: Attempt to invoke virtual method 'ti.modules.titanium.ui.widget.TiUITableView ti.modules.titanium.ui.TableViewProxy.getTableView()' on a null object reference
    at ti.modules.titanium.ui.TableViewRowProxy.handleMessage(TableViewRowProxy.java:209)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6144)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)```

@drauggres
Copy link
Contributor Author

Related to #4137 (TIMOB-12658)

@drauggres drauggres changed the title [AC-6069] Android: TableViewRow bugs [TIMOB-26662] Android: TableViewRow bugs Dec 18, 2018
@build build added this to the 8.0.0 milestone Dec 20, 2018
@build build requested a review from a team December 20, 2018 14:25
@jquick-axway jquick-axway modified the milestones: 8.0.0, 8.1.0 Jan 15, 2019
@sgtcoolguy sgtcoolguy modified the milestones: 8.1.0, 8.2.0 Jun 3, 2019
@jquick-axway jquick-axway modified the milestones: 8.2.0, 8.3.0 Jun 26, 2019
@build
Copy link
Contributor

build commented Aug 30, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖 🎉 Another contribution from our awesome community member, drauggres! Thanks again for helping us make Titanium SDK better. 👍
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 6551 tests are passing.
(There are 701 skipped tests not included in that total)

Generated by 🚫 dangerJS against c896486

@drauggres
Copy link
Contributor Author

Commits are rebased on master and reasonably squashed.
FYI: this was caused by /* global Ti */ in addontest-file (that wasn't clear at that time):

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10542/tests/Resources/ti.ui.tableview.addontest.js
8:11 error 'Ti' is already defined as a built-in global variable no-redeclare

@tidev tidev deleted a comment from build Oct 16, 2019
@jquick-axway jquick-axway removed this from the 8.3.0 milestone Oct 28, 2019
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

@garymathews garymathews added this to the 9.0.0 milestone Dec 16, 2019
Copy link
Contributor

@jquick-axway jquick-axway 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

@ssjsamir ssjsamir self-requested a review January 3, 2020 13:19
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.

@drauggres When testing this PR against the following test case TableViewRow height does not grow beyond the original size but it seems like TableViewRow.getRect() return the correct value.

win = Ti.UI.createWindow({
backgroundColor: '#AAAAFF',
layout: 'vertical'
});
 
var top = Ti.UI.createView({
backgroundColor: '#FFAAAA',
layout: 'horizontal',
height: Ti.UI.SIZE,
width: Ti.UI.FILL
});
 
var btnPlus = Ti.UI.createButton({title: '+'});
btnPlus.addEventListener('click', function() {
console.log('plus click');
view.height += 50;
});
 
var btnMinus = Ti.UI.createButton({title: '-'});
btnMinus.addEventListener('click', function() {
console.log('minus click');
view.height -= 50;
});
 
var label = Ti.UI.createLabel();
 
var tableView = Ti.UI.createTableView();
 
var row = Ti.UI.createTableViewRow({
height: Ti.UI.SIZE,
width: Ti.UI.FILL
});
 
var view = Ti.UI.createView({
height: 150,
backgroundColor: 'blue'
});
 
row.add(view);
tableView.setData([ row ]);
tableView.addEventListener('postlayout', function onPostLayout() {
console.log('postlayout', row.rect.height, view.rect.height);
label.text = [row.rect.height, view.rect.height].join(' \| ');
});
 
top.add(btnPlus);
top.add(btnMinus);
top.add(label);
 
win.add(top);
win.add(tableView);
win.open();

Test Environment

MacOS Catalina 10.15.1 beta
Node.js 10.16.3
"NPM":"4.2.15-1","CLI":"7.1.2"
Google Pixel 7.1.1 Emulator

@garymathews
Copy link
Contributor

@ssjsamir Updated PR

@ssjsamir ssjsamir self-requested a review February 11, 2020 12:15
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: Using the test case mentioned above.

**Test environment*Test Environment

MacOS Catalina: 10.15.1 beta
Xcode: 11.3
Java Version: 1.8.0_131
Android NDK: 18.1.5063045
Node.js: 10.16.3
"NPM":"4.2.15-1","CLI":"7.1.2-7"
Pixel xl (7.1.1) Emulator

@ssjsamir ssjsamir merged commit 19f532b into tidev:master Feb 11, 2020
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

8 participants