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-25635] Android: Multi-View Viewpager (ScrollableView) #10172

Merged
merged 10 commits into from Aug 9, 2018

Conversation

drauggres
Copy link
Contributor

@drauggres drauggres commented Jul 11, 2018

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

Android: add clipViews and padding properties to ScrollableView.

var win = Ti.UI.createWindow({
  title: 'ScrollableView clipViews',
  backgroundColor:'#eee'
});

// Common params
var params = {
  clipViews: false,
  showPagingControl: false,
  top: 0
};

if (Ti.Platform.name === 'android') {
  // Android specific params
  params.padding = {
    left: 40,
    right: 40
  };
} else {
  // iOS specific params
  params.width = '90%';
}
var scrollableView = Titanium.UI.createScrollableView(params);

var view1 = Ti.UI.createView({ id: 'view1', backgroundColor: '#836' });
var view2 = Ti.UI.createView({ id: 'view2', backgroundColor: '#246' });
var view3 = Ti.UI.createView({ id: 'view3', backgroundColor: '#48b' });
scrollableView.setViews([view1, view2, view3]);

win.add(scrollableView);
win.open();

@build
Copy link
Contributor

build commented Jul 11, 2018

Messages
📖

🎉 Another contribution from our awesome community member, drauggres! Thanks again for helping us make Titanium SDK better. 👍

📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@hansemannn
Copy link
Collaborator

Hey @drauggres, I just added the docs for your PR, so we're moving forward! One parity issue I noticed is that iOS supports the "width" of the scrollable-view, but Android the padding. Couldn't we "translate" the width to the padding internally? I know there are some good dimension utils that could be used to get the actual width (even when passed via percentage, dp or other). Let me know your thoughts on this one!

@build build added the docs label Aug 7, 2018
@drauggres
Copy link
Contributor Author

  • using "width" property same way as iOS could be complicated, for sure it will require more than 50-lines patch,
  • "padding" looks like good compromise between "full parity" and no feature at all,
  • "padding" is more flexible than just "width", maybe iOS someday should have it.

@hansemannn
Copy link
Collaborator

hansemannn commented Aug 8, 2018

I am fine with that then, thanks for the thoughts @drauggres !

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

@hansemannn hansemannn merged commit 8a338a0 into tidev:master Aug 9, 2018
@drauggres drauggres deleted the TIMOB-25635 branch August 9, 2018 20:46
@jquick-axway jquick-axway modified the milestones: 7.4.0, 7.5.0 Aug 24, 2018
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