aboutsummaryrefslogtreecommitdiff
path: root/iPhone
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-01-02 13:00:13 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-01-02 13:00:13 +0000
commit3d42089a8fac73ca2c437fdfffaffc12ac540159 (patch)
tree25df431d42703439793720061f3ba213ea7fe7ee /iPhone
parent2c2586d12e7757a41a1eda0c47c6b9c2fabe970e (diff)
[Author: thomasvl]
Remove the GC support code. Add the needed images for the iOS unittests under iOS 6.0. Add a workspace file for the iPhone project. R=dmaclach DELTA=215 (85 added, 122 deleted, 8 changed)
Diffstat (limited to 'iPhone')
-rw-r--r--iPhone/GTMUILocalizer.m24
-rw-r--r--iPhone/TestData/GTMFadeTruncatingLabelTest1.6.pngbin0 -> 2714 bytes
-rw-r--r--iPhone/TestData/GTMFadeTruncatingLabelTest2.6.pngbin0 -> 1735 bytes
-rw-r--r--iPhone/TestData/GTMFadeTruncatingLabelTest3.6.pngbin0 -> 3261 bytes
-rw-r--r--iPhone/TestData/GTMFadeTruncatingLabelTest4.6.pngbin0 -> 2122 bytes
-rw-r--r--iPhone/TestData/GTMFadeTruncatingLabelTest5.6.pngbin0 -> 2661 bytes
6 files changed, 22 insertions, 2 deletions
diff --git a/iPhone/GTMUILocalizer.m b/iPhone/GTMUILocalizer.m
index 7923d05..269d2f6 100644
--- a/iPhone/GTMUILocalizer.m
+++ b/iPhone/GTMUILocalizer.m
@@ -25,6 +25,7 @@
// Never recursively call any of these methods. Always call
// -[self localizeObject:recursively:].
- (void)localizeToolbar:(UIToolbar *)toolbar;
+- (void)localizeSegmentedControl:(UISegmentedControl *)segmentedControl;
- (void)localizeView:(UIView *)view recursively:(BOOL)recursive;
- (void)localizeButton:(UIButton *)button;
@end
@@ -96,10 +97,12 @@
if ([object isKindOfClass:[UIViewController class]]) {
UIView *view = [object view];
[self localizeView:view recursively:recursive];
- } else if ([object isKindOfClass:[UIView class]]) {
- [self localizeView:(UIView *)object recursively:recursive];
} else if ([object isKindOfClass:[UIToolbar class]]) {
[self localizeToolbar:(UIToolbar*)object];
+ } else if ([object isKindOfClass:[UISegmentedControl class]]) {
+ [self localizeSegmentedControl:(UISegmentedControl*)object];
+ } else if ([object isKindOfClass:[UIView class]]) {
+ [self localizeView:(UIView *)object recursively:recursive];
}
}
}
@@ -119,6 +122,23 @@
}
}
+- (void)localizeSegmentedControl:(UISegmentedControl *)segmentedControl {
+ // A UISegmentedControl uses a few objects as subviews, but they aren't
+ // documented. It happened to work out that their inherritance was right
+ // with the selectors they implemented that things localized, but iOS 6
+ // changed some of that, so they are now directly handled.
+ NSUInteger numberOfSegments = segmentedControl.numberOfSegments;
+ for (NSUInteger i = 0; i < numberOfSegments; ++i) {
+ NSString *title = [segmentedControl titleForSegmentAtIndex:i];
+ if (title) {
+ title = [self localizedStringForString:title];
+ if (title) {
+ [segmentedControl setTitle:title forSegmentAtIndex:i];
+ }
+ }
+ }
+}
+
- (void)localizeView:(UIView *)view recursively:(BOOL)recursive {
if (view) {
// Do accessibility on views.
diff --git a/iPhone/TestData/GTMFadeTruncatingLabelTest1.6.png b/iPhone/TestData/GTMFadeTruncatingLabelTest1.6.png
new file mode 100644
index 0000000..e2a2777
--- /dev/null
+++ b/iPhone/TestData/GTMFadeTruncatingLabelTest1.6.png
Binary files differ
diff --git a/iPhone/TestData/GTMFadeTruncatingLabelTest2.6.png b/iPhone/TestData/GTMFadeTruncatingLabelTest2.6.png
new file mode 100644
index 0000000..cb840ba
--- /dev/null
+++ b/iPhone/TestData/GTMFadeTruncatingLabelTest2.6.png
Binary files differ
diff --git a/iPhone/TestData/GTMFadeTruncatingLabelTest3.6.png b/iPhone/TestData/GTMFadeTruncatingLabelTest3.6.png
new file mode 100644
index 0000000..b9a07fa
--- /dev/null
+++ b/iPhone/TestData/GTMFadeTruncatingLabelTest3.6.png
Binary files differ
diff --git a/iPhone/TestData/GTMFadeTruncatingLabelTest4.6.png b/iPhone/TestData/GTMFadeTruncatingLabelTest4.6.png
new file mode 100644
index 0000000..1fecc29
--- /dev/null
+++ b/iPhone/TestData/GTMFadeTruncatingLabelTest4.6.png
Binary files differ
diff --git a/iPhone/TestData/GTMFadeTruncatingLabelTest5.6.png b/iPhone/TestData/GTMFadeTruncatingLabelTest5.6.png
new file mode 100644
index 0000000..8c2db75
--- /dev/null
+++ b/iPhone/TestData/GTMFadeTruncatingLabelTest5.6.png
Binary files differ