diff --git a/media/ios/Classes/NewsBlurAppDelegate.m b/media/ios/Classes/NewsBlurAppDelegate.m
index cec74c536..4f5741c73 100644
--- a/media/ios/Classes/NewsBlurAppDelegate.m
+++ b/media/ios/Classes/NewsBlurAppDelegate.m
@@ -158,45 +158,6 @@
[window makeKeyAndVisible];
[self.feedsViewController fetchFeedList:YES];
- UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
- splashView = [[UIImageView alloc] init];
- int rotate = 0;
- if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
- NSLog(@"UPSIDE DOWN");
- rotate = -2;
- } else if (orientation == UIInterfaceOrientationLandscapeLeft) {
- rotate = -1;
- } else if (orientation == UIInterfaceOrientationLandscapeRight) {
- rotate = 1;
- }
- splashView.transform = CGAffineTransformMakeRotation(M_PI * rotate * 90.0 / 180);
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &&
- UIInterfaceOrientationIsLandscape(orientation)) {
- splashView.frame = self.view.frame;
- splashView.image = [UIImage imageNamed:@"Default-Landscape.png"];
- } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- splashView.frame = self.view.frame;
- splashView.image = [UIImage imageNamed:@"Default-Portrait.png"];
- } else if (IS_IPHONE_5) {
- splashView.frame = CGRectMake(0, 0, self.window.frame.size.width, 568);
- splashView.image = [UIImage imageNamed:@"Default-568h.png"];
- } else {
- splashView.frame = self.window.frame;
- splashView.image = [UIImage imageNamed:@"Default.png"];
- }
-
-// [splashView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
- splashView.alpha = 1.0;
- [window.rootViewController.view addSubview:splashView];
- [UIView beginAnimations:nil context:nil];
- [UIView setAnimationDuration:.6];
- [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
- [UIView setAnimationDelegate:self];
- [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
- splashView.frame = CGRectMake(0, -1 * splashView.frame.size.height, splashView.frame.size.width, splashView.frame.size.height);
- // splashView.frame = CGRectMake(-60, -80, 440, 728);
- [UIView commitAnimations];
-
[ShareThis startSessionWithFacebookURLSchemeSuffix:@"newsblur" pocketAPI:@"c23d9HbTT2a8fma098AfIr9zQTgcF0l9" readabilityKey:@"samuelclay" readabilitySecret:@"ktLQc88S9WCE8PfvZ4u4q995Q3HMzg6Q"];
[[UINavigationBar appearance]
@@ -223,10 +184,54 @@
UITextAttributeTextShadowOffset,
nil]];
+ [self performSelectorOnMainThread:@selector(showSplashView) withObject:nil waitUntilDone:NO];
// [self showFirstTimeUser];
return YES;
}
+- (void)showSplashView {
+ UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
+ splashView = [[UIImageView alloc] init];
+ int rotate = 0;
+ if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
+ NSLog(@"UPSIDE DOWN");
+ rotate = -2;
+ } else if (orientation == UIInterfaceOrientationLandscapeLeft) {
+ rotate = -1;
+ } else if (orientation == UIInterfaceOrientationLandscapeRight) {
+ rotate = 1;
+ }
+ // splashView.transform = CGAffineTransformMakeRotation(M_PI * rotate * 90.0 / 180);
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &&
+ UIInterfaceOrientationIsLandscape(orientation)) {
+ splashView.frame = CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width);
+ splashView.image = [UIImage imageNamed:@"Default-Landscape.png"];
+ NSLog(@"Window frame; %@", NSStringFromCGRect(self.view.frame));
+ } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ splashView.frame = self.view.frame;
+ splashView.image = [UIImage imageNamed:@"Default-Portrait.png"];
+ } else if (IS_IPHONE_5) {
+ splashView.frame = CGRectMake(0, 0, self.window.frame.size.width, 568);
+ splashView.image = [UIImage imageNamed:@"Default-568h.png"];
+ } else {
+ splashView.frame = self.window.frame;
+ splashView.image = [UIImage imageNamed:@"Default.png"];
+ }
+
+ // [splashView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
+ splashView.alpha = 1.0;
+ [window.rootViewController.view addSubview:splashView];
+ [UIView beginAnimations:nil context:nil];
+ [UIView setAnimationDuration:.6];
+ [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
+ [UIView setAnimationDelegate:self];
+ [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
+// splashView.alpha = 0;
+ splashView.frame = CGRectMake(0, -1 * splashView.frame.size.height, splashView.frame.size.width, splashView.frame.size.height);
+ // splashView.frame = CGRectMake(-60, -80, 440, 728);
+ [UIView commitAnimations];
+}
+
- (void)viewDidLoad {
self.visibleUnreadCount = 0;
self.savedStoriesCount = 0;
diff --git a/media/ios/Classes/StoryPageControl.m b/media/ios/Classes/StoryPageControl.m
index 6dd94672a..963b0e973 100644
--- a/media/ios/Classes/StoryPageControl.m
+++ b/media/ios/Classes/StoryPageControl.m
@@ -85,12 +85,10 @@
popoverClass = [WEPopoverController class];
- // adding HUD for progress bar
- UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapProgressBar:)];
-
+ // adding HUD for progress bar
CGFloat radius = 8;
circularProgressView = [[THCircularProgressView alloc]
- initWithCenter:CGPointMake(self.traverseView.frame.size.width - 101,
+ initWithCenter:CGPointMake(self.buttonNext.frame.origin.x + 2*radius,
self.traverseView.frame.size.height / 2)
radius:radius
lineWidth:radius / 4.0f
@@ -99,9 +97,12 @@
progressBackgroundMode:THProgressBackgroundModeCircumference
progressBackgroundColor:[UIColor colorWithRed:0.312f green:0.32f blue:0.296f alpha:.02f]
percentage:20];
+ circularProgressView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
[self.traverseView addSubview:circularProgressView];
UIView *tapIndicator = [[UIView alloc] initWithFrame:CGRectMake(circularProgressView.frame.origin.x - circularProgressView.frame.size.width / 2, circularProgressView.frame.origin.y - circularProgressView.frame.size.height / 2, circularProgressView.frame.size.width*2, circularProgressView.frame.size.height*2)];
+ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapProgressBar:)];
[tapIndicator addGestureRecognizer:tap];
+ tapIndicator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
[self.traverseView insertSubview:tapIndicator aboveSubview:circularProgressView];
self.loadingIndicator.frame = self.circularProgressView.frame;
self.buttonNext.titleEdgeInsets = UIEdgeInsetsMake(0, 24, 0, 0);
@@ -236,14 +237,12 @@
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
-
-
- NSLog(@"%f,%f",self.view.frame.size.width,self.view.frame.size.height);
+ NSLog(@"Rotate: %f,%f",self.view.frame.size.width,self.view.frame.size.height);
} else if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){
-
- NSLog(@"%f,%f",self.view.frame.size.width,self.view.frame.size.height);
+ NSLog(@"Rotate: %f,%f",self.view.frame.size.width,self.view.frame.size.height);
}
+
[self refreshPages];
[self layoutForInterfaceOrientation:toInterfaceOrientation];
}
@@ -683,6 +682,14 @@
}
- (void)setTextButton {
+ if (currentPage.pageIndex >= 0) {
+ [buttonText setEnabled:YES];
+ [buttonText setAlpha:1];
+ } else {
+ [buttonText setEnabled:NO];
+ [buttonText setAlpha:.4];
+ }
+
if (currentPage.inTextView) {
[buttonText setTitle:[@"Story" uppercaseString] forState:UIControlStateNormal];
[buttonText setBackgroundImage:[UIImage imageNamed:@"traverse_text_on.png"]
diff --git a/media/ios/Classes/StoryPageControl.xib b/media/ios/Classes/StoryPageControl.xib
index 5e807eb06..fff81f865 100644
--- a/media/ios/Classes/StoryPageControl.xib
+++ b/media/ios/Classes/StoryPageControl.xib
@@ -45,7 +45,6 @@
{320, 460}
-