cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cordova-plugin-media-capture git commit: CB-11212 iOS: Explicitly set the bundle for images
Date Wed, 11 May 2016 19:19:02 GMT
Repository: cordova-plugin-media-capture
Updated Branches:
  refs/heads/master b2e29fc88 -> fc49084ea


CB-11212 iOS: Explicitly set the bundle for images

 - set the bundle to the CDVCapture's bundle instead of assuming
   application bundle.

 This closes #61


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/fc49084e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/fc49084e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/fc49084e

Branch: refs/heads/master
Commit: fc49084eabaaf9d40a29978f86fe79880a45daf3
Parents: b2e29fc
Author: Andrew Zellman <zellman@adobe.com>
Authored: Thu May 5 16:47:52 2016 -0700
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Wed May 11 12:15:07 2016 -0700

----------------------------------------------------------------------
 src/ios/CDVCapture.m | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/fc49084e/src/ios/CDVCapture.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 1be2622..53e1b2b 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -621,7 +621,8 @@
         microphoneResource = @"CDVCapture.bundle/microphone-568h";
     }
 
-    UIImage* microphone = [UIImage imageNamed:[self resolveImageResource:microphoneResource]];
+    NSBundle* cdvBundle = [NSBundle bundleForClass:[CDVCapture class]];
+    UIImage* microphone = [UIImage imageNamed:[self resolveImageResource:microphoneResource]
inBundle:cdvBundle compatibleWithTraitCollection:nil];
     UIView* microphoneView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, viewRect.size.width,
microphone.size.height)];
     [microphoneView setBackgroundColor:[UIColor colorWithPatternImage:microphone]];
     [microphoneView setUserInteractionEnabled:NO];
@@ -629,7 +630,7 @@
     [tmp addSubview:microphoneView];
 
     // add bottom bar view
-    UIImage* grayBkg = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/controls_bg"]];
+    UIImage* grayBkg = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/controls_bg"]
inBundle:cdvBundle compatibleWithTraitCollection:nil];
     UIView* controls = [[UIView alloc] initWithFrame:CGRectMake(0, microphone.size.height,
viewRect.size.width, grayBkg.size.height)];
     [controls setBackgroundColor:[UIColor colorWithPatternImage:grayBkg]];
     [controls setUserInteractionEnabled:NO];
@@ -637,7 +638,7 @@
     [tmp addSubview:controls];
 
     // make red recording background view
-    UIImage* recordingBkg = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/recording_bg"]];
+    UIImage* recordingBkg = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/recording_bg"]
inBundle:cdvBundle compatibleWithTraitCollection:nil];
     UIColor* background = [UIColor colorWithPatternImage:recordingBkg];
     self.recordingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, viewRect.size.width,
recordingBkg.size.height)];
     [self.recordingView setBackgroundColor:background];
@@ -665,8 +666,8 @@
 
     // Add record button
 
-    self.recordImage = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/record_button"]];
-    self.stopRecordImage = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/stop_button"]];
+    self.recordImage = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/record_button"]
inBundle:cdvBundle compatibleWithTraitCollection:nil];
+    self.stopRecordImage = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/stop_button"]
inBundle:cdvBundle compatibleWithTraitCollection:nil];
     self.recordButton.accessibilityTraits |= [self accessibilityTraits];
     self.recordButton = [[UIButton alloc] initWithFrame:CGRectMake((viewRect.size.width -
recordImage.size.width) / 2, (microphone.size.height + (grayBkg.size.height - recordImage.size.height)
/ 2), recordImage.size.width, recordImage.size.height)];
     [self.recordButton setAccessibilityLabel:PluginLocalizedString(captureCommand, @"toggle
audio recording", nil)];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message