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-20591] iOS: Rename "tableSeparatorInsets" to "listSeparatorInsets" in Ti.UI.ListView #7864

Merged
merged 2 commits into from
Mar 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 23 additions & 3 deletions apidoc/Titanium/UI/ListView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ properties:
summary: The insets for list view separators (applies to all cells). This property is applicable on iOS 7 and greater.
deprecated:
since: "5.2.0"
notes: Use tableSeparatorInsets instead
notes: Use listSeparatorInsets instead
description: |
In iOS 7 and later, cell separators do not extend all the way to the edge of the list view.
This property sets the default inset for all cells in the table.
Expand Down Expand Up @@ -879,6 +879,9 @@ properties:
availability: creation

- name: tableSeparatorInsets
deprecated:
since: "5.4.0"
notes: Use listSeparatorInsets instead
summary: The insets for the table view header and footer. This property is applicable on iOS 7 and greater.
description: |
In iOS 7 and later, cell separators do not extend all the way to the edge of the list view. Set this to a
Expand All @@ -891,13 +894,30 @@ properties:
left:10,
right:10
});



type: Dictionary
since: "5.2.0"
osver: {ios: {min: "7.0"}}
platforms: [iphone, ipad]

- name: listSeparatorInsets
summary: The insets for the list view header and footer. This property is applicable on iOS 7 and greater.
description: |
In iOS 7 and later, cell separators do not extend all the way to the edge of the list view. Set this to a
dictionary with two keys, `left` specifying inset from left edge and `right` specifying the inset from the
right edge. If the rowSeparatorInsets is not set, the listSeparatorInsets will also set the cell insets.

For example:

listView.setListSeparatorInsets({
left:10,
right:10
});

type: Dictionary
since: "5.4.0"
osver: {ios: {min: "7.0"}}
platforms: [iphone, ipad]

- name: rowSeparatorInsets
summary: The insets for list view cells (applies to all cells). This property is applicable on iOS 7 and greater.
Expand Down
12 changes: 10 additions & 2 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,20 @@ -(NSInteger)sectionForSearchSection:(NSInteger)section

-(void)setSeparatorInsets_:(id)arg
{
DEPRECATED_REPLACED(@"UI.ListView.separatorInsets", @"5.2.0", @"UI.ListView.tableSeparatorInsets");
[self setTableSeparatorInsets_:arg];
DEPRECATED_REPLACED(@"UI.ListView.separatorInsets", @"5.2.0", @"UI.ListView.listSeparatorInsets");
[self setListSeparatorInsets_:arg];
}

-(void)setTableSeparatorInsets_:(id)arg
Copy link
Contributor

Choose a reason for hiding this comment

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

change to setListSeparatorInsets

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, the method needs to stay there to display the deprecation message

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah didn't see you added setListSeparator. My bad

{
DEPRECATED_REPLACED(@"UI.ListView.tableSeparatorInsets", @"5.4.0", @"UI.ListView.listSeparatorInsets");
[self setListSeparatorInsets_:arg];
}

-(void)setListSeparatorInsets_:(id)arg
{
[self tableView];

if ([arg isKindOfClass:[NSDictionary class]]) {
CGFloat left = [TiUtils floatValue:@"left" properties:arg def:_defaultSeparatorInsets.left];
CGFloat right = [TiUtils floatValue:@"right" properties:arg def:_defaultSeparatorInsets.right];
Expand Down