Browse Source

- 장치 리스트 : 장치추가 Cell 추가
- 장치 리스트 , 멤버 리스트 : Cell 터치 영역 수정
- 설정 , 홈허브 정보 : 하단 닫기 버튼 UI 수정

TaeHyun 8 years ago
parent
commit
f94ce5d47b

File diff suppressed because it is too large
+ 14 - 18
OneCable/Base.lproj/HomeMember.storyboard


File diff suppressed because it is too large
+ 94 - 72
OneCable/Base.lproj/Main.storyboard


File diff suppressed because it is too large
+ 33 - 25
OneCable/Base.lproj/Settings.storyboard


File diff suppressed because it is too large
+ 41 - 33
OneCable/Base.lproj/Things.storyboard


+ 3 - 3
OneCable/Classes/ViewControllers/MainScreens/MainViewController.m

@@ -69,13 +69,13 @@
 
     
     //2. init scrollView
-    CGFloat height = ViewHeight(_scrollView); //IPHONE_HEIGHT - kfMainTabBarHeight;
-    [_scrollView setContentSize:CGSizeMake(IPHONE_WIDTH * 3, height)];
+//    CGFloat height = ViewHeight(_scrollView); //IPHONE_HEIGHT - kfMainTabBarHeight;
+    [_scrollView setContentSize:CGSizeMake(IPHONE_WIDTH * 3, IPHONE_HEIGHT)];
     _scrollView.pagingEnabled = YES;
     _scrollView.scrollEnabled = NO;
     
     
-    CGRect sr = CGRectMake(0, 0, IPHONE_WIDTH, height);
+    CGRect sr = CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT);
     
     //init child view for childViewController
     _thingsContainerView = [[UIView alloc] initWithFrame:sr];

+ 1 - 1
OneCable/Classes/ViewControllers/ThingsScreens/ThingsViewController.h

@@ -80,7 +80,7 @@
 
 @interface ThingsAddCollectionCell : UICollectionViewCell
 @property (weak, nonatomic) IBOutlet CustomLabelButton *btnAdd;
-@property (weak, nonatomic) IBOutlet CustomButton *btnThingsAdd;
+//@property (weak, nonatomic) IBOutlet CustomButton *btnThingsAdd;
 @property (weak, nonatomic) IBOutlet CustomLabel *lblThingsAdd;
 
 @end

+ 15 - 1
OneCable/Classes/ViewControllers/ThingsScreens/ThingsViewController.m

@@ -16,6 +16,7 @@
 #import "CustomImageView.h"
 #import "CustomTextField.h"
 #import "CustomButton.h"
+#import "CustomLabelButton.h"
 #import "JYRefreshController.h"
 #import "WYPopoverController.h"
 #import "ImageUtil.h"
@@ -90,6 +91,9 @@
 
 @end
 
+@implementation ThingsAddCollectionCell
+
+@end
 
 @interface ThingsViewController () <UICollectionViewDataSource, UICollectionViewDelegate> {
     NSMutableArray *_deviceList;
@@ -548,7 +552,10 @@
 #pragma mark - UICollectionView Delegate
 
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
-    NSInteger count = _deviceList.count;
+//    NSInteger count = _deviceList.count;
+    NSInteger auth = [JDFacade facade].loginUser.level == 90 && !_isDeleteMode; //마스터 권한일 경우,
+    NSInteger count = _deviceList.count % _deviceFlag == 0 ? _deviceList.count : _deviceList.count + auth; //홀수일 경우, 장치 추가 버튼
+    
     return count;
 }
 
@@ -638,6 +645,13 @@
         }
 
         
+        rcell = cell;
+    } else {
+        ThingsAddCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ThingsAddCellIdentifier" forIndexPath:indexPath];
+        
+        if (![cell.btnAdd actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
+            [cell.btnAdd addTarget:self action:@selector(addNewDevice) forControlEvents:UIControlEventTouchUpInside];
+        }
         rcell = cell;
     }