Skip to content

Commit

Permalink
Merge branch 'master' into github-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Cabal-Ugaz committed Mar 24, 2014
2 parents aadf789 + 5b72815 commit 9b425bc
Show file tree
Hide file tree
Showing 7 changed files with 268 additions and 248 deletions.
10 changes: 8 additions & 2 deletions examples/AppNexusSDKApp/AppNexusSDKApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD)";
ARCHS = (
"armv7,",
armv7s,
);
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -926,7 +929,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD)";
ARCHS = (
"armv7,",
armv7s,
);
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,25 @@
static NSString *const AdSettingsSectionHeaderViewIdentifier = @"AdSettingsSectionHeaderViewIdentifier";

static NSInteger const AdSettingsSectionHeaderGeneralIndex = 0;
static NSInteger const AdSettingsSectionHeaderAdvancedIndex = 1;
static NSInteger const AdSettingsSectionHeaderDebugAuctionIndex = 2;
static NSInteger const AdSettingsSectionHeaderTargetingIndex = 1;
static NSInteger const AdSettingsSectionHeaderAdvancedIndex = 2;
static NSInteger const AdSettingsSectionHeaderDebugAuctionIndex = 3;

static BOOL AdSettingsSectionGeneralIsOpen = YES;
static BOOL AdSettingsSectionTargetingIsOpen = NO;
static BOOL AdSettingsSectionAdvancedIsOpen = NO;
static BOOL AdSettingsSectionDebugAuctionIsOpen = NO;

static NSString *const AdSettingsSectionHeaderTitleLabelGeneral = @"General";
static NSString *const AdSettingsSectionHeaderTitleLabelTargeting = @"Targeting";
static NSString *const AdSettingsSectionHeaderTitleLabelAdvanced = @"Advanced";
static NSString *const AdSettingsSectionHeaderTitleLabelDebugAuction = @"Debug Auction";
static NSString *const AdSettingsSectionHeaderTitleLabelDebugAuction = @"Diagnostics";

static NSInteger const AdSettingsSizePickerIndex = 3;
static NSInteger const AdSettingsRefreshRatePickerIndex = 5;
static NSInteger const AdSettingsSizePickerIndex = 2;
static NSInteger const AdSettingsRefreshRatePickerIndex = 3;

static NSInteger const AdSettingsSizePickerSection = 0;
static NSInteger const AdSettingsRefreshRatePickerSection = 2;

#pragma end

Expand Down Expand Up @@ -103,12 +109,7 @@ - (IBAction)makeKeyboardDisappear:(id)sender {
}

- (void)viewWillDisappear:(BOOL)animated {
if (self.sizePickerViewIsVisible || self.refreshRatePickerViewIsVisible) {
self.sizePickerViewIsVisible = NO;
self.refreshRatePickerViewIsVisible = NO;
[self.tableView beginUpdates];
[self.tableView endUpdates];
}
[self hidePickerViews];
}

#pragma mark Current Settings Setup
Expand Down Expand Up @@ -137,6 +138,8 @@ - (void)pickerViewSetup {
animated:NO];
self.sizePickerViewIsVisible = NO;
self.refreshRatePickerViewIsVisible = NO;
[self.sizePickerView setHidden:YES];
[self.refreshRatePickerView setHidden:YES];
}

#pragma mark Picker Views - Delegate Methods
Expand Down Expand Up @@ -530,6 +533,10 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger
sectionHeaderView.titleLabel.text = AdSettingsSectionHeaderTitleLabelDebugAuction;
sectionHeaderView.disclosureButton.selected = AdSettingsSectionDebugAuctionIsOpen;
break;
case (AdSettingsSectionHeaderTargetingIndex):
sectionHeaderView.titleLabel.text = AdSettingsSectionHeaderTitleLabelTargeting;
sectionHeaderView.disclosureButton.selected = AdSettingsSectionTargetingIsOpen;
break;
default:
sectionHeaderView.titleLabel.text = @"";
sectionHeaderView.disclosureButton.selected = NO;
Expand Down Expand Up @@ -558,6 +565,10 @@ - (void)sectionHeaderView:(AppNexusSDKAppSectionHeaderView *)sectionHeaderView s
if (AdSettingsSectionDebugAuctionIsOpen) return;
AdSettingsSectionDebugAuctionIsOpen = YES;
break;
case (AdSettingsSectionHeaderTargetingIndex):
if (AdSettingsSectionTargetingIsOpen) return;
AdSettingsSectionTargetingIsOpen = YES;
break;
default:
return;
}
Expand All @@ -583,6 +594,10 @@ - (void)sectionHeaderView:(AppNexusSDKAppSectionHeaderView *)sectionHeaderView s
if (!AdSettingsSectionDebugAuctionIsOpen) return;
AdSettingsSectionDebugAuctionIsOpen = NO;
break;
case (AdSettingsSectionHeaderTargetingIndex):
if (!AdSettingsSectionTargetingIsOpen) return;
AdSettingsSectionTargetingIsOpen = NO;
break;
default:
return;
}
Expand All @@ -605,6 +620,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
case AdSettingsSectionHeaderDebugAuctionIndex:
if (!AdSettingsSectionDebugAuctionIsOpen) return 0;
break;
case AdSettingsSectionHeaderTargetingIndex:
if (!AdSettingsSectionTargetingIsOpen) return 0;
break;
default:
break;
}
Expand Down Expand Up @@ -632,11 +650,10 @@ - (void)sdkAppModalViewControllerShouldDismiss:(AppNexusSDKAppModalViewControlle
#pragma mark UITableViewDelegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section==AdSettingsSectionHeaderGeneralIndex) {
if ((indexPath.item == AdSettingsSizePickerIndex && !self.sizePickerViewIsVisible) ||
(indexPath.item == AdSettingsRefreshRatePickerIndex && !self.refreshRatePickerViewIsVisible)) {
return 0.0f;
}
BOOL isSizePickerCell = indexPath.section == AdSettingsSizePickerSection && indexPath.item == AdSettingsSizePickerIndex;
BOOL isRefreshRatePickerCell = indexPath.section == AdSettingsRefreshRatePickerSection && indexPath.item == AdSettingsRefreshRatePickerIndex;
if ((isSizePickerCell && !self.sizePickerViewIsVisible) || (isRefreshRatePickerCell && !self.refreshRatePickerViewIsVisible)) {
return 0.0f;
}
return [super tableView:tableView heightForRowAtIndexPath:indexPath];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ - (NSMutableArray *)mediatedClasses {

- (void)loadInitialVC {
[self setInitialVCTabBarItem];
[self loadPreviewVC];
[self loadSettingsVC];
}

- (void)setInitialVCTabBarItem {
if ([self.mainTabBar selectedItem] != self.previewTabBarItem) {
[self.mainTabBar setSelectedItem:self.previewTabBarItem];
if ([self.mainTabBar selectedItem] != self.settingsTabBarItem) {
[self.mainTabBar setSelectedItem:self.settingsTabBarItem];
}
}

Expand Down
Loading

0 comments on commit 9b425bc

Please sign in to comment.