Browse files

Use localized collation in friend picker

this diff changes FBGraphObjectTableDataSource to support collation, so that names are categorized and displayed
properly based on the locale of the app.
I've replicated functionality as is present in other FB apps, namely: display collation index on the right, don't show section headers
and collation index if there's too few rows, omit empty section headers, ensure correct lookup from right side (section index) to left side
(section titles). This is also consistent with the Contacts built-in app and the iOS HIG.

Test Plan:
Use Friend picker sample on various localizations (had to add supported locales to its info.plist), ensure collation is displayed correctly.
Ensure tapping on letters in the section index shows the correct section. Ensure selecting rows in the table and tapping "Done" returns correct results
to the caller.


Too few contacts:

Reviewers: jacl, jketchpaw, vijaye, suhas

Reviewed By: jacl

CC: platform-diffs@lists, msdkexp@

Differential Revision:

Task ID: 1354966
  • Loading branch information...
1 parent 31bf78e commit 204df4ff8173167bf0dbf7bbb3651deb0d6b6888 Leon Dubinsky committed Aug 14, 2012
@@ -72,5 +72,12 @@
+ <key>CFBundleLocalizations</key>
+ <array>
+ <string>en</string>
+ <string>ru</string>
+ <string>zh</string>
+ <string>ja</string>
+ </array>
@@ -338,6 +338,7 @@ - (FBRequest*)requestForLoadData {
[self.dataSource setSortingByFields:sortFields ascending:YES];
self.dataSource.groupByField = groupByField;
+ self.dataSource.useCollation = YES;
// me or one of my friends that also uses the app
NSString *user = self.userID;
@@ -27,6 +27,7 @@
@property (nonatomic, retain) UIImage *defaultPicture;
@property (nonatomic, assign) id<FBGraphObjectViewControllerDelegate> controllerDelegate;
@property (nonatomic, copy) NSString *groupByField;
+@property (nonatomic, assign) BOOL useCollation;
@property (nonatomic) BOOL itemTitleSuffixEnabled;
@property (nonatomic) BOOL itemPicturesEnabled;
@property (nonatomic) BOOL itemSubtitleEnabled;
Oops, something went wrong.

0 comments on commit 204df4f

Please sign in to comment.