|
|
@@ -9,12 +9,15 @@
|
|
|
|
|
|
#import "OptionPopOverViewController.h"
|
|
|
#import "WYPopoverController.h"
|
|
|
-
|
|
|
#import "JDViewController.h"
|
|
|
+#import "HomeMemberViewController.h"
|
|
|
+#import "MorePopOverViewController.h"
|
|
|
|
|
|
@interface JDViewController () <WYPopoverControllerDelegate, UITableViewDataSource, UITableViewDelegate> {
|
|
|
WYPopoverController *_poc;
|
|
|
OptionPopOverViewController *_ovc;
|
|
|
+ MorePopOverViewController *_MoreVc;
|
|
|
+
|
|
|
}
|
|
|
@end
|
|
|
|
|
|
@@ -34,7 +37,7 @@
|
|
|
|
|
|
|
|
|
- (void)initUIOnSuper {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)initTableViewAsDefaultStyle:(CustomTableView *)tableView {
|
|
|
@@ -69,9 +72,60 @@
|
|
|
return button;
|
|
|
}
|
|
|
|
|
|
+- (void)returnMoreId:(id)moreButtonId{
|
|
|
+ NSLog(@"JDViewMoreButton : %@",moreButtonId);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (void)toggleOptionsWithArray:(id)sender btnArray:(NSMutableArray *)btnArray
|
|
|
+{
|
|
|
+ UIButton *moreBtn = (UIButton *)sender;
|
|
|
+
|
|
|
+// UIStoryboard *storyboard =[UIStoryboard storyboardWithName:@"Common" bundle:nil];
|
|
|
+// MorePopOverViewController *ctl =[storyboard instantiateViewControllerWithIdentifier:@"MorePopOverViewController"];
|
|
|
+// ctl.moreDelegate = self;
|
|
|
+
|
|
|
+
|
|
|
+// NSLog(@"MoreDelegate : %@",ctl.moreDelegate);
|
|
|
+
|
|
|
+ if (!_poc){
|
|
|
+ _MoreVc = (MorePopOverViewController *)[CommonUtil
|
|
|
+ instantiateViewControllerWithIdentifier:@"MorePopOverViewController"
|
|
|
+ storyboardName:@"Common"];
|
|
|
+
|
|
|
+ _poc = [[WYPopoverController alloc] initWithContentViewController:_MoreVc];
|
|
|
+
|
|
|
+ _poc.delegate = self;
|
|
|
+ [_poc beginThemeUpdates];
|
|
|
+
|
|
|
+ _poc.popoverLayoutMargins = UIEdgeInsetsMake(0, 0, 0, 0);
|
|
|
+ _poc.theme.arrowHeight = 0;
|
|
|
+ _poc.theme.borderWidth = 0;
|
|
|
+ _poc.theme.innerCornerRadius = 0.0f;
|
|
|
+ _poc.theme.outerCornerRadius = 0.0f;
|
|
|
+ _poc.theme.minOuterCornerRadius = 0.0f;
|
|
|
+
|
|
|
+ [_poc endThemeUpdates];
|
|
|
+
|
|
|
+ [_MoreVc popButtonSet:btnArray];
|
|
|
+
|
|
|
+// [_MoreVc popButtonSet:firstBtn secondType:secondBtn thirdType:thirdBtn fourthType:fourthBtn];
|
|
|
+
|
|
|
+ _MoreVc.poc = _poc;
|
|
|
+ }
|
|
|
+ CGRect popRect = moreBtn.bounds;
|
|
|
+
|
|
|
+ [_poc presentPopoverFromRect:popRect
|
|
|
+ inView:moreBtn
|
|
|
+ permittedArrowDirections:WYPopoverArrowDirectionUp
|
|
|
+ animated:YES
|
|
|
+ options:WYPopoverAnimationOptionFadeWithScale];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
- (void)toggleOptions:(id)sender {
|
|
|
UIButton *btn = (UIButton *)sender;
|
|
|
-
|
|
|
+
|
|
|
if (!_poc) {
|
|
|
|
|
|
_ovc = (OptionPopOverViewController *)[CommonUtil
|
|
|
@@ -82,8 +136,11 @@
|
|
|
|
|
|
_poc = [[WYPopoverController alloc] initWithContentViewController:_ovc];
|
|
|
_poc.delegate = self;
|
|
|
-
|
|
|
[_poc beginThemeUpdates];
|
|
|
+
|
|
|
+ _poc.popoverLayoutMargins = UIEdgeInsetsMake(10, 0, 0, 0);
|
|
|
+ _poc.theme.arrowHeight = 0;
|
|
|
+ _poc.theme.borderWidth = 0;
|
|
|
|
|
|
_poc.theme.usesRoundedArrow = NO;
|
|
|
|
|
|
@@ -94,33 +151,45 @@
|
|
|
_poc.theme.outerStrokeColor = kUILineColor2;
|
|
|
_poc.theme.innerStrokeColor = kUILineColor2;
|
|
|
|
|
|
+
|
|
|
_poc.theme.innerCornerRadius = 0.0f;
|
|
|
_poc.theme.outerCornerRadius = 0.0f;
|
|
|
_poc.theme.minOuterCornerRadius = 0.0f;
|
|
|
|
|
|
-// _poc.theme.fillTopColor = kUIBgColor01;
|
|
|
-
|
|
|
[_poc endThemeUpdates];
|
|
|
|
|
|
+// [_MoreVc popButtonSet:none secondType:none thirdType:del fourthType:reload];
|
|
|
|
|
|
_ovc.poc = _poc;
|
|
|
}
|
|
|
|
|
|
// UIBarButtonItem *barButtonItem = self.navigationItem.rightBarButtonItem;
|
|
|
// UIView *itemView = [barButtonItem valueForKey:@"view"];
|
|
|
+
|
|
|
+
|
|
|
CGRect popRect = btn.bounds;
|
|
|
- popRect.origin.y = 0.0f;
|
|
|
+// popRect.origin.y = 0.0f;
|
|
|
|
|
|
- [_poc presentPopoverFromRect:popRect inView:btn
|
|
|
- permittedArrowDirections:WYPopoverArrowDirectionDown | WYPopoverArrowDirectionUp animated:YES options:WYPopoverAnimationOptionFadeWithScale completion:^{
|
|
|
- [_ovc.tableView reloadData];
|
|
|
- }];
|
|
|
+// [_poc presentPopoverFromRect:popRect inView:btn
|
|
|
+// permittedArrowDirections:WYPopoverArrowDirectionDown | WYPopoverArrowDirectionUp animated:YES options:WYPopoverAnimationOptionFadeWithScale completion:nil];
|
|
|
+
|
|
|
+ [_poc presentPopoverFromRect:popRect
|
|
|
+ inView:btn
|
|
|
+ permittedArrowDirections:WYPopoverArrowDirectionDown | WYPopoverArrowDirectionUp
|
|
|
+ animated:YES
|
|
|
+ options:WYPopoverAnimationOptionFadeWithScale];
|
|
|
+
|
|
|
+// [_poc presentPopoverFromRect:popRect inView:btn
|
|
|
+// permittedArrowDirections:WYPopoverArrowDirectionDown | WYPopoverArrowDirectionUp animated:YES options:WYPopoverAnimationOptionFadeWithScale completion:^{
|
|
|
+// [_ovc.tableView reloadData];
|
|
|
+// }];
|
|
|
|
|
|
// [_poc presentPopoverFromRect:btn.bounds
|
|
|
// inView:btn
|
|
|
// permittedArrowDirections:WYPopoverArrowDirectionUp
|
|
|
// animated:YES
|
|
|
// options:WYPopoverAnimationOptionFadeWithScale];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)resetOptions {
|
|
|
@@ -136,7 +205,6 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#pragma mark - Main Logic
|
|
|
|
|
|
|