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-24277] Android: Fix horizontal layout when using 'right' #8730

Merged
merged 1 commit into from Feb 22, 2017

Conversation

garymathews
Copy link
Contributor

  • Correctly calculate components using right when used in a horizontal layout
TEST CASE
var win = Ti.UI.createWindow(),
	items = [],
	template = {
		properties: {
			accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,
			backgroundColor: 'white',
			height: Ti.UI.SIZE,
			layout: 'horizontal'
		},
		events: {
			click: function(e) {
				alert(e.source.customProperty);
			}
		},
		childTemplates:
		[
			{
				type: 'Ti.UI.Button',
				bindId: 'bindButton',
				properties: {
					left: 10,
					width: 100,
					height: 40,
					borderRadius: 20,
					borderWidth: 1,
					borderColor: '#dedede',
					backgroundColor: 'green'
				},
			},
			{
				type : 'Ti.UI.Button',
				bindId : 'bindButton2',
				properties : {
					right: 10,
					width: 100,
					height: 40,
					borderRadius: 20,
					borderWidth: 1,
					borderColor: '#dedede',
					backgroundColor: 'red'
				}
			}
		]
	},
	listView = Ti.UI.createListView({templates: {'template': template}}),
	section = Ti.UI.createListSection();

for(var i = 1; i <= 10; i++){
	items.push({
		template: 'template',
		bindButton: {
		   title: 'button a ' + i,
		   customProperty: i
		},
		bindButton2: {
		   title: 'button b ' + i,
		   customProperty: i
		},
		properties: {
		   itemId: i
		}
	});
}

section.setItems(items);
listView.sections = [section];

win.add(listView);
win.open();

JIRA Ticket

@frankieandone
Copy link
Contributor

CR and FT PASS

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, Horizontal layout moved to the right.

Steps I took to test:

Create a new classic titanium project
Copy the code provided in the description
Run the program
Saw that the red buttons had moved to the right even after putting the phone into landscape mode.
I then tested with 6.0.1.GA following the same steps above and saw that the red buttons were next to the green buttons and not on the right hand side.

Environment

Appcelerator Command-Line Interface, version 6.1.0
Google Pixel (Android 7.1.1)
Operating System Name: Mac OS X El Capitan
Operating System Version: 10.11.6
Node.js Version: 4.6.0
npm: 4.2.8
Xcode: 8.2
Appcelerator Studio: 4.8.1.201612050850

@ssjsamir ssjsamir merged commit 3501943 into tidev:master Feb 22, 2017
@gimdongwoo
Copy link
Contributor

Hi, This commit affected the 'TIMOB-24308' and caused a 'TIMOB-24308' again.

https://jira.appcelerator.org/browse/TIMOB-24308
( #8766 (comment) )

Incorrect (This commit affected)
2017-05-22 10 43 44

Correct #8766
71867f58-df40-11e6-8e1a-0ce49c4c4753

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