Brion VIBBER has uploaded a new change for review.

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


Change subject: Made title text field padding better match description box's.
......................................................................

Made title text field padding better match description box's.

Change-Id: I466b3ffeb06d73aa8a48495d89d0a9a1efd1c195
---
M Commons-iOS/DetailScrollViewController.h
M Commons-iOS/DetailScrollViewController.m
M Commons-iOS/en.lproj/MainStoryboard.storyboard
3 files changed, 25 insertions(+), 12 deletions(-)


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

diff --git a/Commons-iOS/DetailScrollViewController.h 
b/Commons-iOS/DetailScrollViewController.h
index b97ec4c..7d153ea 100644
--- a/Commons-iOS/DetailScrollViewController.h
+++ b/Commons-iOS/DetailScrollViewController.h
@@ -69,6 +69,7 @@
 -(void)scrollByAmount:(float)amount withDuration:(NSTimeInterval)duration 
delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options 
useXF:(BOOL)useXF then:(void(^)(void))block;
 
 @property (strong, nonatomic) IBOutlet NSLayoutConstraint 
*descriptionTextViewHeightConstraint;
+@property (strong, nonatomic) IBOutlet NSLayoutConstraint 
*titleTextFieldHeightConstraint;
 
 -(void)ensureScrollingDoesNotExceedThreshold;
 -(void)toggle;
diff --git a/Commons-iOS/DetailScrollViewController.m 
b/Commons-iOS/DetailScrollViewController.m
index 637781d..250b467 100644
--- a/Commons-iOS/DetailScrollViewController.m
+++ b/Commons-iOS/DetailScrollViewController.m
@@ -40,6 +40,8 @@
 #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(5.0f, 5.0f, 5.0f, 5.0f)
+
 
 @interface DetailScrollViewController ()
 
@@ -127,18 +129,18 @@
     self.descriptionTextLabel.backgroundColor = [UIColor clearColor];
     self.descriptionTextLabel.borderColor = [UIColor clearColor];
     self.descriptionTextLabel.paddingColor = 
DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
-    [self.descriptionTextLabel setPaddingInsets:UIEdgeInsetsMake(5.0f, 5.0f, 
5.0f, 5.0f)];
+    [self.descriptionTextLabel setPaddingInsets:LABEL_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:UIEdgeInsetsMake(5.0f, 5.0f, 5.0f, 
5.0f)];
+    [self.titleTextLabel setPaddingInsets:LABEL_PADDING_INSET];
 
     // Add a bit of left and right padding to the text box
-    self.titleTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 
0, 8, 20)];
+    self.titleTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 
0, 10, 20)];
     self.titleTextField.leftViewMode = UITextFieldViewModeAlways;
-    self.titleTextField.rightView = [[UIView alloc] 
initWithFrame:CGRectMake(0, 0, 8, 20)];
+    self.titleTextField.rightView = [[UIView alloc] 
initWithFrame:CGRectMake(0, 0, 10, 20)];
     self.titleTextField.rightViewMode = UITextFieldViewModeAlways;
 
        self.titleTextField.textColor = DETAIL_EDITABLE_TEXTBOX_TEXT_COLOR;
@@ -342,6 +344,8 @@
                 self.descriptionTextView.editable = NO;
                 self.descriptionTextView.hidden = YES;
                 [self.descriptionTextView 
removeConstraint:self.descriptionTextViewHeightConstraint];
+                [self.titleTextField 
removeConstraint:self.titleTextFieldHeightConstraint];
+                
                 self.descriptionTextLabel.hidden = NO;
                 self.deleteButton.enabled = NO; // fixme in future, support 
deleting uploaded items
                 self.actionButton.enabled = YES; // open link or share on the 
web
@@ -368,6 +372,8 @@
                 self.titleTextLabel.hidden = YES;
                 self.descriptionTextView.editable = YES;
                 [self.descriptionTextView 
addConstraint:self.descriptionTextViewHeightConstraint];
+                [self.titleTextField 
addConstraint:self.titleTextFieldHeightConstraint];
+
                 self.descriptionTextView.hidden = NO;
                 self.descriptionTextLabel.hidden = YES;
                 self.deleteButton.enabled = (record.progress.floatValue == 
0.0f); // don't allow delete _during_ upload
@@ -871,7 +877,7 @@
         label.backgroundColor = [UIColor clearColor];
         label.borderColor = [UIColor clearColor];
         label.paddingColor = DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR;
-        [label setPaddingInsets:UIEdgeInsetsMake(5.0f, 5.0f, 5.0f, 5.0f)];
+        [label setPaddingInsets:LABEL_PADDING_INSET];
         [self.categoryContainer addSubview:label];
         [categoryLabels addObject:label];
     }
diff --git a/Commons-iOS/en.lproj/MainStoryboard.storyboard 
b/Commons-iOS/en.lproj/MainStoryboard.storyboard
index 31e0cd3..12d0148 100644
--- a/Commons-iOS/en.lproj/MainStoryboard.storyboard
+++ b/Commons-iOS/en.lproj/MainStoryboard.storyboard
@@ -1232,11 +1232,11 @@
                         <autoresizingMask key="autoresizingMask" 
flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
                             <view contentMode="scaleToFill" 
translatesAutoresizingMaskIntoConstraints="NO" id="ehb-uI-yRM" 
userLabel="Scroll Container">
-                                <rect key="frame" x="0.0" y="0.0" width="320" 
height="495"/>
+                                <rect key="frame" x="0.0" y="0.0" width="320" 
height="506"/>
                                 <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                                 <subviews>
                                     <view contentMode="scaleToFill" 
translatesAutoresizingMaskIntoConstraints="NO" id="jhZ-zd-ki7" userLabel="Title 
Container">
-                                        <rect key="frame" x="20" y="20" 
width="280" height="86"/>
+                                        <rect key="frame" x="20" y="20" 
width="280" height="97"/>
                                         <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <subviews>
                                             <label opaque="NO" 
clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Title" 
lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" 
adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="240" 
translatesAutoresizingMaskIntoConstraints="NO" id="2bq-vj-2xO" userLabel="Title 
Label">
@@ -1247,14 +1247,17 @@
                                                 <color key="highlightedColor" 
white="1" alpha="1" colorSpace="calibratedWhite"/>
                                             </label>
                                             <textField opaque="NO" 
clipsSubviews="YES" contentMode="scaleToFill" verticalHuggingPriority="249" 
contentHorizontalAlignment="left" contentVerticalAlignment="center" 
placeholder="Unique, descriptive title" minimumFontSize="17" 
translatesAutoresizingMaskIntoConstraints="NO" id="8ha-ZZ-I4k" userLabel="Title 
Text Field">
-                                                <rect key="frame" x="20" 
y="49" width="240" height="17"/>
+                                                <rect key="frame" x="20" 
y="49" width="240" height="28"/>
                                                 <autoresizingMask 
key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                                 <color key="backgroundColor" 
white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+                                                <constraints>
+                                                    <constraint 
firstAttribute="height" constant="28" id="bUR-EJ-VoB"/>
+                                                </constraints>
                                                 <fontDescription 
key="fontDescription" type="system" pointSize="14"/>
                                                 <textInputTraits 
key="textInputTraits"/>
                                             </textField>
                                             <label hidden="YES" opaque="NO" 
clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" 
horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" 
lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" 
adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="240" 
translatesAutoresizingMaskIntoConstraints="NO" id="r2g-Wc-vb5" userLabel="Title 
Text Label" customClass="UILabelDynamicHeight">
-                                                <rect key="frame" x="20" 
y="49" width="240" height="17"/>
+                                                <rect key="frame" x="20" 
y="49" width="240" height="28"/>
                                                 <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <fontDescription 
key="fontDescription" type="system" pointSize="14"/>
                                                 <color key="textColor" 
white="1" alpha="1" colorSpace="calibratedWhite"/>
@@ -1277,7 +1280,7 @@
                                         </constraints>
                                     </view>
                                     <view contentMode="scaleToFill" 
translatesAutoresizingMaskIntoConstraints="NO" id="ChD-4f-cDJ" 
userLabel="Description Container">
-                                        <rect key="frame" x="20" y="114" 
width="280" height="223"/>
+                                        <rect key="frame" x="20" y="125" 
width="280" height="223"/>
                                         <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <subviews>
                                             <label opaque="NO" 
clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" 
text="Description" lineBreakMode="wordWrap" numberOfLines="0" 
baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" 
preferredMaxLayoutWidth="240" translatesAutoresizingMaskIntoConstraints="NO" 
id="CZQ-bf-MDt" userLabel="Description Label">
@@ -1330,7 +1333,7 @@
                                         </constraints>
                                     </view>
                                     <view contentMode="scaleToFill" 
translatesAutoresizingMaskIntoConstraints="NO" id="0OK-Zl-28Q" 
userLabel="License Container">
-                                        <rect key="frame" x="20" y="345" 
width="280" height="61"/>
+                                        <rect key="frame" x="20" y="356" 
width="280" height="61"/>
                                         <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <subviews>
                                             <label opaque="NO" 
clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" 
horizontalCompressionResistancePriority="751" text="License          " 
lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" 
adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="240" 
translatesAutoresizingMaskIntoConstraints="NO" id="myN-TB-iEG">
@@ -1350,7 +1353,7 @@
                                         </constraints>
                                     </view>
                                     <view contentMode="scaleToFill" 
translatesAutoresizingMaskIntoConstraints="NO" id="fx9-U5-jNG" 
userLabel="Category Container">
-                                        <rect key="frame" x="20" y="414" 
width="280" height="61"/>
+                                        <rect key="frame" x="20" y="425" 
width="280" height="61"/>
                                         <autoresizingMask 
key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <subviews>
                                             <label opaque="NO" 
clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" 
horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Categories" 
lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" 
adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="240" 
translatesAutoresizingMaskIntoConstraints="NO" id="jUg-Wa-cMl">
@@ -1413,6 +1416,7 @@
                         <outlet property="titleContainer" 
destination="jhZ-zd-ki7" id="ZIb-2a-ay0"/>
                         <outlet property="titleLabel" destination="2bq-vj-2xO" 
id="ZNe-Lu-57P"/>
                         <outlet property="titleTextField" 
destination="8ha-ZZ-I4k" id="RSQ-5R-Ogc"/>
+                        <outlet property="titleTextFieldHeightConstraint" 
destination="bUR-EJ-VoB" id="aQA-yb-NDX"/>
                         <outlet property="titleTextLabel" 
destination="r2g-Wc-vb5" id="NwJ-ob-j4X"/>
                     </connections>
                 </viewController>
@@ -1947,6 +1951,8 @@
         <image name="mockPageLogo.png" width="64" height="106"/>
         <image name="mockPagePhoto.png" width="134" height="103"/>
         <image name="photo-button-bg.png" width="72" height="72"/>
+        <image name="photo-button-bg.png" width="72" height="72"/>
+        <image name="photo-button-bg.png" width="72" height="72"/>
         <image name="settings.png" width="30" height="30"/>
     </resources>
     <simulatedMetricsContainer key="defaultSimulatedMetrics">

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I466b3ffeb06d73aa8a48495d89d0a9a1efd1c195
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/commons
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Mhurd <mh...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to