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): fix table view row width ti.ui.size height #11187

Closed
wants to merge 2 commits into from

Conversation

ypbnv
Copy link
Contributor

@ypbnv ypbnv commented Aug 29, 2019

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

Description:
Fixes TableView rows with height set to Ti.UI.SIZE not returning their 'rect' properly and not
respecting children resizing.

I see the iOS is failing the unit tests. Would this behavior be expected on that platform?

Test case:
app.js

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();

Fixes TableView rows with height set to Ti.UI.SIZE not returning their 'rect' properly and not
respecting children resizing.
@ypbnv ypbnv added this to the 8.3.0 milestone Aug 29, 2019
@ypbnv ypbnv requested a review from garymathews August 29, 2019 14:28
@build build requested a review from a team August 29, 2019 14:52
row = Ti.UI.createTableViewRow({ width: Ti.UI.FILL, height: Ti.UI.SIZE }),
view = Ti.UI.createView({ height: 150 });
row.add(view);
table.setData([row]);
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ tests/Resources/ti.ui.tableview.addontest.js line 35 – A space is required after '['. (array-bracket-spacing)
  • ⚠️ tests/Resources/ti.ui.tableview.addontest.js line 35 – A space is required before ']'. (array-bracket-spacing)

@build
Copy link
Contributor

build commented Aug 29, 2019

Fails
🚫 Tests have failed, see below for more information.
Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 3 tests have failed There are 3 tests failing and 700 skipped out of 7252 total tests.

Tests:

ClassnameNameTimeError
android.emulator.Titanium.UI.Android.ProgressIndicatordialog indeterminant - show in different windows (9)5.593
Error: timeout of 5000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.TabGroupadd Map.View to TabGroup (9)10.065
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53120)
android.emulator.Titanium.UI.Window.eventspostlayout event gets fired (9)20.041
Error: timeout of 20000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)

Generated by 🚫 dangerJS against 78fb50a

@drauggres
Copy link
Contributor

drauggres commented Aug 29, 2019

Hi @ypbnv.

IIRC the actual problem with TableViewRow height was here. BTW it is the only place in the SDK where property assigned to directly to LayoutParams.

Also there was fix for NullPointerException in my PR.

@jquick-axway jquick-axway removed this from the 8.3.0 milestone Oct 28, 2019
@build build added this to the 9.0.0 milestone Jan 3, 2020
row = Ti.UI.createTableViewRow({ width: Ti.UI.FILL, height: Ti.UI.SIZE }),
view = Ti.UI.createView({ height: 150 });
row.add(view);
table.setData([row]);
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ tests/Resources/ti.ui.tableview.addontest.js line 20 – A space is required after '['. (array-bracket-spacing)
  • ⚠️ tests/Resources/ti.ui.tableview.addontest.js line 20 – A space is required before ']'. (array-bracket-spacing)

@ssjsamir
Copy link
Contributor

Closing in favour of #10542

@ssjsamir ssjsamir closed this 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

5 participants