Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26662] Android. TableViewRow bugs

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-02-12T10:37:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.0.0
ComponentsAndroid
Labelsandroid, engSchedule, tableViewRow
ReporterSergey Volkov
AssigneeGary Mathews
Created2018-12-17T11:13:52.000+0000
Updated2020-02-12T10:37:32.000+0000

Description

Currently on Android TableViewRow:

always returns zeroes for getRect method (and rect property)

does not grow in height beyond original size (but can shrink)

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

Comments

  1. Sergey Volkov 2018-12-17

    https://github.com/appcelerator/titanium_mobile/pull/10542
  2. Sharif AbuDarda 2018-12-17

    Hello, Thanks for the PR. Our engineers will look into it. Moving to TIMOB.
  3. Yordan Banev 2019-08-29

    PR: https://github.com/appcelerator/titanium_mobile/pull/11187
  4. Joshua Quick 2019-10-28

    [~s.volkov], while I'm fine with your PR's crash fix and getRect() change, I'm concerned that deleting the following code will bring back the bug mentioned in [TIMOB-16048].
       // Make sure the height is greater than 1 (not 0 since image views default to 1)
       if (hasChildView && h > 1) {
       	content.getLayoutParams().height = h;
       }
       
    I'm guessing that the fix for [TIMOB-16048] should have been made in our ImageView code instead. Regardless, it'll need to be re-tested and that's the only thing blocking this PR. (It may be better to split this issue into separate tickets/PRs anyways.)
  5. Gary Mathews 2019-12-16

    master: https://github.com/appcelerator/titanium_mobile/pull/10542
  6. Samir Mohammed 2020-02-12

    *Closing ticket*, fix verified in SDK version 9.0.0.v20200211122336. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10542

JSON Source