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 scroll view's layout resizing with children #11327

Merged
merged 6 commits into from Dec 13, 2019

Conversation

ypbnv
Copy link
Contributor

@ypbnv ypbnv commented Nov 12, 2019

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

Description:
Prevent ScrollView's layout to stretch out of bounds depending on the scroll type and the children's
position when contentHeight\Width is not defined. Also the children's size should not be Ti.UI.FILL or Ti.UI.AUTO in order to test that.
I have based that on the conditions we are checking for a ScrollView's type when we have a matching width and contentWidth(height and contentHeight).

Note: No unit tests since this is an UI problem.

Test case:
app.js

var win = Ti.UI.createWindow({
        backgroundColor: '#fff'
    }),
    scroll = Ti.UI.createScrollView({
        scrollType: 'vertical',
        contentHeight: 1100,
        text: 'Scroll View'
    });

for (var i = 0; i < 10; i++) {
    var label = Ti.UI.createLabel({
        text: 'Click to move me ' + (i + 1), textAlign: 'center',
        color: '#000',
        top: i * 100 + 10,
        width: '100%', height: 90,
        backgroundColor: '#eee'
    });
    label.addEventListener('click', moveRight);
    scroll.add(label);
}

function moveRight(evt) {
    evt.source.applyProperties({
        left: evt.source.rect.x + 40,
    });
}

win.add(scroll);
win.open();

prevent ScrollView's layout to stretch out of bounds depending on the scroll type and the childrens
position when contentHeight\Width is not defined
@ypbnv ypbnv added this to the 9.0.0 milestone Nov 12, 2019
@build build requested a review from a team November 12, 2019 16:15
@build
Copy link
Contributor

build commented Nov 12, 2019

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.
📖

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

Generated by 🚫 dangerJS against c1eef08

Copy link
Contributor

@sgtcoolguy sgtcoolguy left a comment

Choose a reason for hiding this comment

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

code changes seem fine

@lokeshchdhry
Copy link
Contributor

FR Passed.

Studio Ver: 6.0.0.201911251516
SDK Ver: 9.0.0 local build
OS Ver: 10.14.5
Xcode Ver: Xcode 11.2.1
Appc NPM: 5.0.0-2
Appc CLI: 7.1.2
Daemon Ver: 1.1.3
Ti CLI Ver: 5.2.2
Alloy Ver: 1.14.4
Node Ver: 12.13.1
NPM Ver: 6.12.1
Java Ver: 11.0.1
Android Devices: ⇨ google Pixel (Android 10)
Emulator: Android 4.4

@lokeshchdhry lokeshchdhry merged commit 5723b11 into tidev:master Dec 13, 2019
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

4 participants