Brion VIBBER has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88161


Change subject: Added hamburger to category labels for swipe to delete 
discovery.
......................................................................

Added hamburger to category labels for swipe to delete discovery.

Change-Id: Ifcaaf2c29436e9b6fedabd9c79a01e5cab8d545c
---
M Commons-iOS.xcodeproj/project.pbxproj
M Commons-iOS/DetailScrollViewController.m
A Commons-iOS/categoryHamburger.png
3 files changed, 33 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/commons 
refs/changes/61/88161/1

diff --git a/Commons-iOS.xcodeproj/project.pbxproj 
b/Commons-iOS.xcodeproj/project.pbxproj
index 868c6ef..97b355c 100644
--- a/Commons-iOS.xcodeproj/project.pbxproj
+++ b/Commons-iOS.xcodeproj/project.pbxproj
@@ -20,6 +20,7 @@
                04739E08174ECCDF00F32D13 /* WhatPhotosViewController.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 04739E07174ECCDF00F32D13 /* 
WhatPhotosViewController.m */; };
                04739E0E174F0D3600F32D13 /* WhatIsCommonsViewController.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 04739E0D174F0D3500F32D13 /* 
WhatIsCommonsViewController.m */; };
                0478F8E91731B5EA007D4531 /* WelcomeOverlayView.m in Sources */ 
= {isa = PBXBuildFile; fileRef = 0478F8E81731B5EA007D4531 /* 
WelcomeOverlayView.m */; };
+               048C8B9F17FB71520082EB28 /* categoryHamburger.png in Resources 
*/ = {isa = PBXBuildFile; fileRef = 048C8B9E17FB71520082EB28 /* 
categoryHamburger.png */; };
                04A02DA9177502AF00A392C1 /* GalleryMultiSelectAssetCell.m in 
Sources */ = {isa = PBXBuildFile; fileRef = 04A02DA8177502AF00A392C1 /* 
GalleryMultiSelectAssetCell.m */; };
                04A0F33B17AACF7F004AB164 /* ImageResizer.m in Sources */ = {isa 
= PBXBuildFile; fileRef = 04A0F33A17AACF7F004AB164 /* ImageResizer.m */; };
                04A386E617CEFA2F00BC0A3D /* UIView+Debugging.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 04A386E517CEFA2F00BC0A3D /* UIView+Debugging.m 
*/; };
@@ -358,6 +359,7 @@
                04739E0D174F0D3500F32D13 /* WhatIsCommonsViewController.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = WhatIsCommonsViewController.m; sourceTree = 
"<group>"; };
                0478F8E71731B5E9007D4531 /* WelcomeOverlayView.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
WelcomeOverlayView.h; sourceTree = "<group>"; };
                0478F8E81731B5EA007D4531 /* WelcomeOverlayView.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= WelcomeOverlayView.m; sourceTree = "<group>"; };
+               048C8B9E17FB71520082EB28 /* categoryHamburger.png */ = {isa = 
PBXFileReference; lastKnownFileType = image.png; name = categoryHamburger.png; 
path = "Commons-iOS/categoryHamburger.png"; sourceTree = SOURCE_ROOT; };
                04A02DA7177502AF00A392C1 /* GalleryMultiSelectAssetCell.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = GalleryMultiSelectAssetCell.h; sourceTree = "<group>"; };
                04A02DA8177502AF00A392C1 /* GalleryMultiSelectAssetCell.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = GalleryMultiSelectAssetCell.m; sourceTree = 
"<group>"; };
                04A0F33917AACF7F004AB164 /* ImageResizer.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
ImageResizer.h; sourceTree = "<group>"; };
@@ -946,6 +948,7 @@
                        isa = PBXGroup;
                        children = (
                                04AC5A7517A1D66800A06997 /* Bundled Pictures of 
Day */,
+                               048C8B9E17FB71520082EB28 /* 
categoryHamburger.png */,
                                04E6617917614AB0003F35AD /* [email protected] */,
                                04E6617A17614AB0003F35AD /* copyleft.png */,
                                04C27B31174BEB9500B1942F /* mockPagePhoto.png 
*/,
@@ -1433,6 +1436,7 @@
                                D48FA3261725A1AA0039F254 /* messages-ml.json in 
Resources */,
                                D48BB91F17289CBE003100CE /* CategoryCell.xib in 
Resources */,
                                D48BB92117289CEF003100CE /* AddCategoryCell.xib 
in Resources */,
+                               048C8B9F17FB71520082EB28 /* 
categoryHamburger.png in Resources */,
                                D4E94E43172EBBBB0034CA6D /* messages-rif.json 
in Resources */,
                                D41BFA52173C26A100472EC7 /* messages-cy.json in 
Resources */,
                                D41BFA53173C26A100472EC7 /* messages-da.json in 
Resources */,
diff --git a/Commons-iOS/DetailScrollViewController.m 
b/Commons-iOS/DetailScrollViewController.m
index 9436db3..f099c00 100644
--- a/Commons-iOS/DetailScrollViewController.m
+++ b/Commons-iOS/DetailScrollViewController.m
@@ -40,7 +40,10 @@
 #define DETAIL_DOCK_DISTANCE_FROM_BOTTOM ((UI_USER_INTERFACE_IDIOM() == 
UIUserInterfaceIdiomPad) ? 146.0f : 126.0f)
 
 #define DETAIL_TABLE_MAX_OVERLAY_ALPHA 0.85f
-#define LABEL_PADDING_INSET UIEdgeInsetsMake(17.0f, 11.0f, 17.0f, 11.0f)
+
+#define DETAIL_TITLE_PADDING_INSET UIEdgeInsetsMake(17.0f, 11.0f, 17.0f, 11.0f)
+#define DETAIL_DESCRIPTION_PADDING_INSET UIEdgeInsetsMake(17.0f, 11.0f, 17.0f, 
11.0f)
+#define DETAIL_CATEGORY_PADDING_INSET UIEdgeInsetsMake(17.0f, 11.0f, 17.0f, 
11.0f)
 
 
 @interface DetailScrollViewController ()
@@ -134,13 +137,13 @@
     self.descriptionTextLabel.backgroundColor = [UIColor clearColor];
     self.descriptionTextLabel.borderColor = [UIColor clearColor];
     self.descriptionTextLabel.paddingColor = 
DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
-    [self.descriptionTextLabel setPaddingInsets:LABEL_PADDING_INSET];
+    [self.descriptionTextLabel 
setPaddingInsets:DETAIL_DESCRIPTION_PADDING_INSET];
     
     self.titleTextField.backgroundColor = 
DETAIL_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
     self.titleTextLabel.backgroundColor = [UIColor clearColor];
     self.titleTextLabel.borderColor = [UIColor clearColor];
     self.titleTextLabel.paddingColor = 
DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
-    [self.titleTextLabel setPaddingInsets:LABEL_PADDING_INSET];
+    [self.titleTextLabel setPaddingInsets:DETAIL_TITLE_PADDING_INSET];
 
     // Add a bit of left and right padding to the text box
     self.titleTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 
0, 10, 20)];
@@ -982,7 +985,7 @@
         label.backgroundColor = [UIColor clearColor];
         label.borderColor = [UIColor clearColor];
         label.paddingColor = DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
-        [label setPaddingInsets:LABEL_PADDING_INSET];
+        [label setPaddingInsets:DETAIL_CATEGORY_PADDING_INSET];
         [self.categoryContainer addSubview:label];
         [categoryLabels addObject:label];
 
@@ -996,10 +999,13 @@
                 label.textAlignment = NSTextAlignmentCenter;
                 label.paddingColor = DETAIL_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
             }else{
+                // Else it's not the "Add Category" button so it's an actual 
category label.
                 label.userInteractionEnabled = YES;
                 UIPanGestureRecognizer *catPanRecognizer_ = 
[[UIPanGestureRecognizer alloc] initWithTarget:self 
action:@selector(handleCategoryPan:)];
                 catPanRecognizer_.delegate = self;
                 [label addGestureRecognizer:catPanRecognizer_];
+                
+                [self addHamburgerToLabel:label];
             }
         }
     }
@@ -1048,6 +1054,25 @@
     }
 }
 
+-(void)addHamburgerToLabel:(UILabelDynamicHeight *)label
+{
+    UIImageView *burger = [[UIImageView alloc] initWithImage:[UIImage 
imageNamed:@"categoryHamburger.png"]];
+    burger.translatesAutoresizingMaskIntoConstraints = NO;
+    [label.paddingView addSubview: burger];
+    [label.paddingView addConstraints:[NSLayoutConstraint 
constraintsWithVisualFormat:@"H:[burger]|"
+                                                                              
options:0
+                                                                              
metrics:nil
+                                                                               
 views:@{@"burger": burger}
+                                       ]];
+    [label.paddingView addConstraint:[NSLayoutConstraint 
constraintWithItem:burger
+                                                                  
attribute:NSLayoutAttributeCenterY
+                                                                  
relatedBy:NSLayoutRelationEqual
+                                                                     
toItem:label.paddingView
+                                                                  
attribute:NSLayoutAttributeCenterY
+                                                                 multiplier:1.0
+                                                                   
constant:0]];
+}
+
 #pragma mark - Category swipe to delete
 
 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer 
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer 
*)otherGestureRecognizer
diff --git a/Commons-iOS/categoryHamburger.png 
b/Commons-iOS/categoryHamburger.png
new file mode 100644
index 0000000..9445b88
--- /dev/null
+++ b/Commons-iOS/categoryHamburger.png
Binary files differ

-- 
To view, visit https://gerrit.wikimedia.org/r/88161
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcaaf2c29436e9b6fedabd9c79a01e5cab8d545c
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/commons
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to