Brion VIBBER has submitted this change and it was merged. Change subject: Variety of small style / UX tweaks from Vibha. ......................................................................
Variety of small style / UX tweaks from Vibha. Increase font size of edit text. Make article background white not super light gray. Make edit text background super light gray. Switched eye icon to right arrow. Updated colors of edit summary panel and items. Edit summary panel drag handle improved - turns to (taller) down arrow when dragged. Down arrow tap hides panel. Added padding to right of nav bar labels so long i18n text doesn't cram right up to left edge of right nav buttons. Edit summary panel now docks more cleanly with bottom of nav bar. Keyboard hidden if other edit summary panel items tapped. Change-Id: I649738c22c048d8e15c1740f580eb83a699968e7 --- M Wikipedia.xcodeproj/project.pbxproj M wikipedia/Base.lproj/Main_iPhone.storyboard A wikipedia/View Controllers/EditSummary/EditSummaryHandleView.h A wikipedia/View Controllers/EditSummary/EditSummaryHandleView.m M wikipedia/View Controllers/EditSummary/EditSummaryViewController.h M wikipedia/View Controllers/EditSummary/EditSummaryViewController.m M wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m M wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m M wikipedia/View Controllers/TopNav/NavController.m M wikipedia/View Controllers/WebView/WebViewController.m M wikipedia/assets/styles.css M www/less/pagestyles.less 12 files changed, 210 insertions(+), 68 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index d9e7786..29e3f0c 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -146,6 +146,7 @@ 04DB0BE618BC2E1E00B4BCF3 /* CaptchaResetOp.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DB0BE518BC2E1E00B4BCF3 /* CaptchaResetOp.m */; }; 04DB0BEA18BD37F900B4BCF3 /* UIScrollView+ScrollSubviewToLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DB0BE918BD37F900B4BCF3 /* UIScrollView+ScrollSubviewToLocation.m */; }; 04DD89B118BFE63A00DD5DAD /* PreviewAndSaveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04DD89B018BFE63A00DD5DAD /* PreviewAndSaveViewController.m */; }; + 04E6B4A41909EC3D009AD199 /* EditSummaryHandleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E6B4A31909EC3D009AD199 /* EditSummaryHandleView.m */; }; 04EA3A5B18D25D7700E2F5C4 /* UINavigationController+Alert.m in Sources */ = {isa = PBXBuildFile; fileRef = 04EA3A5A18D25D7700E2F5C4 /* UINavigationController+Alert.m */; }; 04F0E2EA186EDC1A00468738 /* UIWebView+ElementLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F0E2E9186EDC1A00468738 /* UIWebView+ElementLocation.m */; }; 04F0E2EE186FB2D100468738 /* TOCSectionCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F0E2ED186FB2D100468738 /* TOCSectionCellView.m */; }; @@ -419,6 +420,8 @@ 04DB0BE918BD37F900B4BCF3 /* UIScrollView+ScrollSubviewToLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+ScrollSubviewToLocation.m"; sourceTree = "<group>"; }; 04DD89AF18BFE63A00DD5DAD /* PreviewAndSaveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviewAndSaveViewController.h; sourceTree = "<group>"; }; 04DD89B018BFE63A00DD5DAD /* PreviewAndSaveViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreviewAndSaveViewController.m; sourceTree = "<group>"; }; + 04E6B4A21909EC3D009AD199 /* EditSummaryHandleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditSummaryHandleView.h; sourceTree = "<group>"; }; + 04E6B4A31909EC3D009AD199 /* EditSummaryHandleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditSummaryHandleView.m; sourceTree = "<group>"; }; 04E9A78218F73C7200F7ECF7 /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = "<group>"; }; 04EA3A5918D25D7700E2F5C4 /* UINavigationController+Alert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+Alert.h"; sourceTree = "<group>"; }; 04EA3A5A18D25D7700E2F5C4 /* UINavigationController+Alert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+Alert.m"; sourceTree = "<group>"; }; @@ -887,6 +890,8 @@ children = ( 04B9C42718CE5D4D003B5058 /* EditSummaryViewController.h */, 04B9C42818CE5D4D003B5058 /* EditSummaryViewController.m */, + 04E6B4A21909EC3D009AD199 /* EditSummaryHandleView.h */, + 04E6B4A31909EC3D009AD199 /* EditSummaryHandleView.m */, ); path = EditSummary; sourceTree = "<group>"; @@ -1540,6 +1545,7 @@ 043C668A18BE9A8E00580E9B /* PreviewWikiTextOp.m in Sources */, 04C43AA6183440C1006C643B /* MWNetworkOp.m in Sources */, 040E5C841846AC13007AFE6F /* ArticleDataContextSingleton.m in Sources */, + 04E6B4A41909EC3D009AD199 /* EditSummaryHandleView.m in Sources */, 04C43AAE18344131006C643B /* CommunicationBridge.m in Sources */, 0429300E18604898002A13FC /* SavedPagesTableHeadingLabel.m in Sources */, 0433542218A023FE009305F0 /* UIViewController+HideKeyboard.m in Sources */, diff --git a/wikipedia/Base.lproj/Main_iPhone.storyboard b/wikipedia/Base.lproj/Main_iPhone.storyboard index 7e9554a..ff264d5 100644 --- a/wikipedia/Base.lproj/Main_iPhone.storyboard +++ b/wikipedia/Base.lproj/Main_iPhone.storyboard @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="Iku-rK-nd2"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="Iku-rK-nd2"> <dependencies> <deployment defaultVersion="1536" identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> @@ -396,57 +396,33 @@ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2KM-dg-4iC" userLabel="TopDivider"> - <rect key="frame" x="0.0" y="0.0" width="320" height="1"/> + <rect key="frame" x="0.0" y="-1" width="320" height="1"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="1" id="6fq-x8-XJr"/> </constraints> </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TXq-x6-7l1" userLabel="Drag Handle"> - <rect key="frame" x="153" y="0.0" width="15" height="24"/> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TXq-x6-7l1" userLabel="Drag Handle" customClass="EditSummaryHandleView"> + <rect key="frame" x="143" y="0.0" width="35" height="26"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <subviews> - <view alpha="0.69999999999999996" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LYh-5s-tU3"> - <rect key="frame" x="0.0" y="10" width="15" height="1"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="fLf-Vv-cfz"/> - </constraints> - </view> - <view alpha="0.69999999999999996" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZdS-Ve-F0a"> - <rect key="frame" x="0.0" y="14" width="15" height="1"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="TvB-kP-EJQ"/> - </constraints> - </view> - </subviews> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <constraints> - <constraint firstAttribute="centerY" secondItem="LYh-5s-tU3" secondAttribute="centerY" constant="2" id="KXn-hI-pqt"/> - <constraint firstAttribute="centerY" secondItem="ZdS-Ve-F0a" secondAttribute="centerY" constant="-2" id="YLk-Eo-eza"/> - <constraint firstAttribute="trailing" secondItem="ZdS-Ve-F0a" secondAttribute="trailing" id="Zdd-bC-ArC"/> - <constraint firstItem="ZdS-Ve-F0a" firstAttribute="leading" secondItem="TXq-x6-7l1" secondAttribute="leading" id="ZwX-D3-FcH"/> - <constraint firstItem="LYh-5s-tU3" firstAttribute="leading" secondItem="TXq-x6-7l1" secondAttribute="leading" id="hzi-eN-d30"/> - <constraint firstAttribute="trailing" secondItem="LYh-5s-tU3" secondAttribute="trailing" id="n5Z-pW-3aD"/> - <constraint firstAttribute="width" constant="15" id="tWh-Tt-F7a"/> + <constraint firstAttribute="width" constant="35" id="tWh-Tt-F7a"/> </constraints> </view> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZOX-Fl-iot" userLabel="Edit Summary Container"> - <rect key="frame" x="20" y="24" width="280" height="235"/> + <rect key="frame" x="20" y="26" width="280" height="228"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="wordWrap" numberOfLines="10" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="280" translatesAutoresizingMaskIntoConstraints="NO" id="ssq-A7-dt2"> <rect key="frame" x="0.0" y="50" width="280" height="16"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> - <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> + <color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="94u-WG-Ye2"> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" clearsOnBeginEditing="YES" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="94u-WG-Ye2"> <rect key="frame" x="0.0" y="0.0" width="280" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> @@ -485,7 +461,7 @@ </state> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BZd-7p-bSx"> - <rect key="frame" x="0.0" y="157" width="35" height="26"/> + <rect key="frame" x="0.0" y="150" width="35" height="26"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="11"/> <state key="normal" title="Button"> @@ -493,7 +469,7 @@ </state> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0D3-cN-OVL"> - <rect key="frame" x="41" y="157" width="35" height="26"/> + <rect key="frame" x="41" y="150" width="35" height="26"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="11"/> <state key="normal" title="Button"> @@ -501,7 +477,7 @@ </state> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cok-jA-aOh"> - <rect key="frame" x="0.0" y="189" width="35" height="26"/> + <rect key="frame" x="0.0" y="182" width="35" height="26"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="11"/> <state key="normal" title="Button"> @@ -522,7 +498,7 @@ <constraint firstItem="exB-80-3yh" firstAttribute="leading" secondItem="V8T-sr-vj9" secondAttribute="trailing" constant="6" id="SUl-tZ-dH4"/> <constraint firstItem="vrw-dZ-OFO" firstAttribute="leading" secondItem="ZOX-Fl-iot" secondAttribute="leading" id="UEj-qe-vDF"/> <constraint firstItem="ssq-A7-dt2" firstAttribute="leading" secondItem="ZOX-Fl-iot" secondAttribute="leading" id="Ugl-eQ-2cz"/> - <constraint firstItem="BZd-7p-bSx" firstAttribute="top" secondItem="V8T-sr-vj9" secondAttribute="bottom" constant="13" id="Znd-bZ-VYK"/> + <constraint firstItem="BZd-7p-bSx" firstAttribute="top" secondItem="V8T-sr-vj9" secondAttribute="bottom" constant="6" id="Znd-bZ-VYK"/> <constraint firstItem="0D3-cN-OVL" firstAttribute="leading" secondItem="BZd-7p-bSx" secondAttribute="trailing" constant="6" id="aqN-Uf-PX2"/> <constraint firstAttribute="bottom" secondItem="cok-jA-aOh" secondAttribute="bottom" constant="20" symbolic="YES" id="cca-UZ-uBJ"/> <constraint firstItem="8ye-Xe-EBO" firstAttribute="leading" secondItem="vrw-dZ-OFO" secondAttribute="trailing" constant="6" id="cfe-cF-HFv"/> @@ -537,15 +513,15 @@ </constraints> </view> </subviews> - <color key="backgroundColor" white="0.96758097627737227" alpha="1" colorSpace="calibratedWhite"/> + <color key="backgroundColor" red="0.90588235294117647" green="0.90588235294117647" blue="0.90588235294117647" alpha="1" colorSpace="calibratedRGB"/> <constraints> <constraint firstItem="2KM-dg-4iC" firstAttribute="leading" secondItem="gmn-rP-nco" secondAttribute="leading" id="BMb-Jy-tBo"/> - <constraint firstItem="ZOX-Fl-iot" firstAttribute="top" secondItem="gmn-rP-nco" secondAttribute="top" constant="24" id="KhF-W6-mdi"/> + <constraint firstItem="ZOX-Fl-iot" firstAttribute="top" secondItem="gmn-rP-nco" secondAttribute="top" constant="26" id="KhF-W6-mdi"/> <constraint firstAttribute="trailing" secondItem="2KM-dg-4iC" secondAttribute="trailing" id="PqR-fE-MWC"/> <constraint firstAttribute="centerX" secondItem="TXq-x6-7l1" secondAttribute="centerX" id="ZbO-vt-Hbl"/> <constraint firstItem="TXq-x6-7l1" firstAttribute="top" secondItem="gmn-rP-nco" secondAttribute="top" id="arX-ce-Ncl"/> <constraint firstItem="94u-WG-Ye2" firstAttribute="top" secondItem="TXq-x6-7l1" secondAttribute="bottom" id="fTp-7q-wUl"/> - <constraint firstItem="2KM-dg-4iC" firstAttribute="top" secondItem="gmn-rP-nco" secondAttribute="top" id="hcy-y5-ek2"/> + <constraint firstItem="2KM-dg-4iC" firstAttribute="bottom" secondItem="gmn-rP-nco" secondAttribute="top" id="hcy-y5-ek2"/> <constraint firstAttribute="centerX" secondItem="ZOX-Fl-iot" secondAttribute="centerX" id="qnR-f0-AkD"/> </constraints> </view> @@ -561,6 +537,8 @@ <outlet property="cannedSummary06" destination="cok-jA-aOh" id="pNr-vu-qPg"/> <outlet property="cannedSummary07" destination="exB-80-3yh" id="faQ-zN-fLL"/> <outlet property="editSummaryContainerView" destination="ZOX-Fl-iot" id="HH3-97-PIe"/> + <outlet property="handleHeightConstraint" destination="KhF-W6-mdi" id="hcY-YY-crJ"/> + <outlet property="handleView" destination="TXq-x6-7l1" id="vx4-49-JsA"/> <outlet property="summaryTextField" destination="94u-WG-Ye2" id="yjv-q4-KB6"/> <outlet property="topDividerHeightConstraint" destination="6fq-x8-XJr" id="QMl-gM-G2z"/> </connections> @@ -584,7 +562,7 @@ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ohj-LA-82c"> <rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <color key="backgroundColor" red="0.98039215690000003" green="0.98039215690000003" blue="0.98039215690000003" alpha="1" colorSpace="calibratedRGB"/> <fontDescription key="fontDescription" type="system" pointSize="16"/> <textInputTraits key="textInputTraits" autocorrectionType="no"/> </textView> @@ -1059,7 +1037,7 @@ <webView autoresizesSubviews="NO" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" allowsInlineMediaPlayback="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WeL-Mj-Zsh"> <rect key="frame" x="0.0" y="0.0" width="320" height="504"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <dataDetectorType key="dataDetectorTypes"/> <connections> <outlet property="delegate" destination="vXZ-lx-hvc" id="Pmz-tr-TG8"/> diff --git a/wikipedia/View Controllers/EditSummary/EditSummaryHandleView.h b/wikipedia/View Controllers/EditSummary/EditSummaryHandleView.h new file mode 100644 index 0000000..d30f873 --- /dev/null +++ b/wikipedia/View Controllers/EditSummary/EditSummaryHandleView.h @@ -0,0 +1,14 @@ +// Created by Monte Hurd on 4/24/14. + +#import <UIKit/UIKit.h> + +typedef NS_ENUM(NSUInteger, EditSummaryHandleState) { + EDIT_SUMMARY_HANDLE_BOTTOM = 0, + EDIT_SUMMARY_HANDLE_TOP = 1 +}; + +@interface EditSummaryHandleView : UIView + +@property (nonatomic) EditSummaryHandleState state; + +@end diff --git a/wikipedia/View Controllers/EditSummary/EditSummaryHandleView.m b/wikipedia/View Controllers/EditSummary/EditSummaryHandleView.m new file mode 100644 index 0000000..a395e21 --- /dev/null +++ b/wikipedia/View Controllers/EditSummary/EditSummaryHandleView.m @@ -0,0 +1,82 @@ +// Created by Monte Hurd on 4/24/14. + +#import "EditSummaryHandleView.h" + +struct LINE +{ + CGPoint pointA; + CGPoint pointB; +}; + +@implementation EditSummaryHandleView + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + self.state = EDIT_SUMMARY_HANDLE_BOTTOM; + } + return self; +} + +-(void)setState:(EditSummaryHandleState)state +{ + _state = state; + [self setNeedsDisplay]; +} + +// Convert unit space point to rect space point. +-(CGPoint)rectPointFromUnitPoint:(CGPoint)unitPoint +{ + return (CGPoint){ + unitPoint.x * self.bounds.size.width, + unitPoint.y * self.bounds.size.height + }; +} + +-(void)addLine:(struct LINE)line toPath:(UIBezierPath *)path +{ + [path moveToPoint:[self rectPointFromUnitPoint:line.pointA]]; + [path addLineToPoint:[self rectPointFromUnitPoint:line.pointB]]; +} + +- (void)drawRect:(CGRect)rect +{ + // Draw either a "=" shape or a "v" shape depending on state. + // Scales with this view's scale. + + CGFloat h = 0.12; // Half height (vertical deviation from vertical center) + CGFloat p = 0.10; // Padding on line sides + + struct LINE lineOne, lineTwo; + + switch (self.state) { + case EDIT_SUMMARY_HANDLE_TOP:{ + // A slight "v" shape. Coords in unit space. + lineOne = (struct LINE){{p, 0.5-h}, {0.5, 0.5+h}}; + lineTwo = (struct LINE){{0.5, 0.5+h}, {1.0-p, 0.5-h}}; + } + break; + case EDIT_SUMMARY_HANDLE_BOTTOM:{ + // Two lines resembling an equals "=" sign. Coords in unit space. + lineOne = (struct LINE){{p, 0.5-h}, {1.0-p, 0.5-h}}; + lineTwo = (struct LINE){{p, 0.5+h}, {1.0-p, 0.5+h}}; + } + break; + } + + UIBezierPath *path = [UIBezierPath bezierPath]; + + [self addLine:lineOne toPath:path]; + [self addLine:lineTwo toPath:path]; + + [path setLineWidth:2.0]; + [path setLineCapStyle:kCGLineCapRound]; + [path setLineJoinStyle:kCGLineJoinRound]; + + [[UIColor colorWithRed:0.72 green:0.72 blue:0.72 alpha:1.0] set]; + + [path stroke]; +} + +@end diff --git a/wikipedia/View Controllers/EditSummary/EditSummaryViewController.h b/wikipedia/View Controllers/EditSummary/EditSummaryViewController.h index fbb37f4..9229528 100644 --- a/wikipedia/View Controllers/EditSummary/EditSummaryViewController.h +++ b/wikipedia/View Controllers/EditSummary/EditSummaryViewController.h @@ -3,10 +3,12 @@ #import <UIKit/UIKit.h> +@class EditSummaryHandleView; + @interface EditSummaryViewController : UIViewController <UIGestureRecognizerDelegate, UITextFieldDelegate> -(NSString *)getSummary; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topConstraint; +@property (weak, nonatomic) NSLayoutConstraint *topConstraint; @end diff --git a/wikipedia/View Controllers/EditSummary/EditSummaryViewController.m b/wikipedia/View Controllers/EditSummary/EditSummaryViewController.m index 27f5c27..f52519a 100644 --- a/wikipedia/View Controllers/EditSummary/EditSummaryViewController.m +++ b/wikipedia/View Controllers/EditSummary/EditSummaryViewController.m @@ -6,6 +6,7 @@ #import "NavController.h" #import "Defines.h" #import "WMF_Colors.h" +#import "EditSummaryHandleView.h" #define NAV ((NavController *)self.navigationController) #define MAX_SUMMARY_LENGTH 255 @@ -36,6 +37,12 @@ @property (weak, nonatomic) IBOutlet UIView *editSummaryContainerView; +@property (nonatomic) CGFloat origHandleHeightConstant; + +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *handleHeightConstraint; + +@property (weak, nonatomic) IBOutlet EditSummaryHandleView *handleView; + @end @implementation EditSummaryViewController @@ -63,6 +70,8 @@ { [super viewDidLoad]; + self.origHandleHeightConstant = self.handleHeightConstraint.constant; + self.view.translatesAutoresizingMaskIntoConstraints = NO; self.borderWidth = 1.0f / [UIScreen mainScreen].scale; @@ -77,7 +86,9 @@ [self setupButtons]; self.aboutLabel.text = MWLocalizedString(@"edit-summary-description", nil); - self.summaryTextField.placeholder = MWLocalizedString(@"edit-summary-field-placeholder-text", nil); + + self.summaryTextField.attributedPlaceholder = + [self getAttributedPlaceholderForString:MWLocalizedString(@"edit-summary-field-placeholder-text", nil)]; self.summaryTextField.textColor = [UIColor darkGrayColor]; self.summaryTextField.returnKeyType = UIReturnKeyDone; @@ -93,18 +104,42 @@ object: nil]; [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped:)]]; + + [self.handleView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleViewTapped)]]; +} + +-(NSAttributedString *)getAttributedPlaceholderForString:(NSString *)string +{ + NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:string]; + + [str addAttribute:NSFontAttributeName + value:[UIFont systemFontOfSize:12.0] + range:NSMakeRange(0, str.length)]; + + [str addAttribute:NSForegroundColorAttributeName + value:[UIColor colorWithWhite:0.33 alpha:1.0] + range:NSMakeRange(0, str.length)]; + + return str; } -(void)viewTapped:(id)sender { if ([self isDockedAtBottom]) { [self dockAtLocation:DOCK_TOP]; + }else if (self.summaryTextField.isFirstResponder){ + [self.summaryTextField resignFirstResponder]; } +} + +-(void)handleViewTapped +{ + [self dockAtLocation:[self isDockedAtBottom] ? DOCK_TOP : DOCK_BOTTOM]; } -(void)setupButtons { - UIColor *topColor = WMF_COLOR_ORANGE; + UIColor *topColor = WMF_COLOR_GREEN; UIColor *bottomColor = WMF_COLOR_GREEN; [self setupButton: self.cannedSummary01 @@ -192,6 +227,10 @@ { button.selected = !button.selected; button.backgroundColor = (button.selected) ? [self getButtonAttributedTextColor:button] : [UIColor whiteColor]; + + if (self.summaryTextField.isFirstResponder){ + [self.summaryTextField resignFirstResponder]; + } } -(UIColor *)getButtonAttributedTextColor:(UIButton *)button @@ -242,6 +281,28 @@ ? NAVBAR_MODE_EDIT_WIKITEXT_PREVIEW : NAVBAR_MODE_EDIT_WIKITEXT_SUMMARY; if(NAV.navBarMode != newNavBarMode) NAV.navBarMode = newNavBarMode; + + [self adjustHandleHeightAnimated]; +} + +-(void)adjustHandleHeightAnimated +{ + [UIView animateWithDuration: 0.08f + delay: 0.0f + options: UIViewAnimationOptionTransitionNone + animations: ^{ + + if ([self isDockedAtBottom]) { + self.handleHeightConstraint.constant = self.origHandleHeightConstant; + self.handleView.state = EDIT_SUMMARY_HANDLE_BOTTOM; + }else{ + self.handleHeightConstraint.constant = self.origHandleHeightConstant * 1.4f; + self.handleView.state = EDIT_SUMMARY_HANDLE_TOP; + } + + [self.view layoutIfNeeded]; + } completion:^(BOOL done){ + }]; } -(BOOL)isDockedAtBottom @@ -325,7 +386,7 @@ [self.editSummaryContainerView convertPoint: CGPointMake(0, self.editSummaryContainerView.frame.size.height) toView: self.view]; - // When device is portrait, the editSummaryContainerView may be taller than the screen, so allow + // When device is landscape, the editSummaryContainerView may be taller than the screen, so allow // the edit summary panel to be scrolled up as far as necessary to allow the bottom of the // editSummaryContainerView to be scrolled completely on screen. Otherwise some canned edit // summaries won't be selectable! diff --git a/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m b/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m index 2493163..4ec61af 100644 --- a/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m +++ b/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m @@ -87,7 +87,6 @@ } break; - case NAVBAR_BUTTON_CHECK: case NAVBAR_BUTTON_ARROW_RIGHT: /* for captcha submit button */ { [self saveOrShowSignInActionSheetIfNotLoggedIn]; @@ -173,10 +172,10 @@ if (lastHightlight == highlight) return; lastHightlight = highlight; - UIButton *button = (UIButton *)[NAV getNavBarItem:NAVBAR_BUTTON_CHECK]; + UIButton *button = (UIButton *)[NAV getNavBarItem:NAVBAR_BUTTON_ARROW_RIGHT]; button.backgroundColor = highlight ? - WMF_COLOR_GREEN + WMF_COLOR_BLUE : [UIColor colorWithRed:0.98 green:0.98 blue:0.98 alpha:1.0]; diff --git a/wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m b/wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m index c1ed61d..95e3b69 100644 --- a/wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m +++ b/wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m @@ -16,7 +16,7 @@ #import "WMF_Colors.h" #import "MWLanguageInfo.h" -#define EDIT_TEXT_VIEW_FONT [UIFont systemFontOfSize:14.0f] +#define EDIT_TEXT_VIEW_FONT [UIFont systemFontOfSize:16.0f] #define EDIT_TEXT_VIEW_LINE_HEIGHT_MIN 25.0f #define EDIT_TEXT_VIEW_LINE_HEIGHT_MAX 25.0f @@ -80,7 +80,7 @@ if (lastHightlight == highlight) return; lastHightlight = highlight; - UIButton *button = (UIButton *)[NAV getNavBarItem:NAVBAR_BUTTON_EYE]; + UIButton *button = (UIButton *)[NAV getNavBarItem:NAVBAR_BUTTON_ARROW_RIGHT]; button.backgroundColor = highlight ? WMF_COLOR_BLUE @@ -145,7 +145,7 @@ UIView *tappedItem = userInfo[@"tappedItem"]; switch (tappedItem.tag) { - case NAVBAR_BUTTON_EYE: + case NAVBAR_BUTTON_ARROW_RIGHT: if (![self changesMade]) { [self showAlert:MWLocalizedString(@"wikitext-preview-changes-none", nil)]; [self showAlert:@""]; diff --git a/wikipedia/View Controllers/TopNav/NavController.m b/wikipedia/View Controllers/TopNav/NavController.m index 790424d..c8a7404 100644 --- a/wikipedia/View Controllers/TopNav/NavController.m +++ b/wikipedia/View Controllers/TopNav/NavController.m @@ -458,7 +458,7 @@ case NAVBAR_MODE_EDIT_WIKITEXT: self.label.text = MWLocalizedString(@"navbar-title-mode-edit-wikitext", nil); self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_X(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_EYE(50)]|"; + @"H:|[NAVBAR_BUTTON_X(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_ARROW_RIGHT(50)]|"; break; case NAVBAR_MODE_LOGIN: self.label.text = (!previewAndSaveVC) ? @@ -467,12 +467,12 @@ MWLocalizedString(@"navbar-title-mode-login-and-save", nil) ; self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_X(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; + @"H:|[NAVBAR_BUTTON_X(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; break; case NAVBAR_MODE_EDIT_WIKITEXT_LOGIN_OR_SAVE_ANONYMOUSLY: self.label.text = @""; self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; break; case NAVBAR_MODE_CREATE_ACCOUNT: self.label.text = (!previewAndSaveVC) ? @@ -481,17 +481,17 @@ MWLocalizedString(@"navbar-title-mode-create-account-and-save", nil) ; self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; break; case NAVBAR_MODE_EDIT_WIKITEXT_WARNING: self.label.text = MWLocalizedString(@"navbar-title-mode-edit-wikitext-warning", nil); self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; break; case NAVBAR_MODE_EDIT_WIKITEXT_DISALLOW: self.label.text = MWLocalizedString(@"navbar-title-mode-edit-wikitext-disallow", nil); self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-|"; break; case NAVBAR_MODE_EDIT_WIKITEXT_PREVIEW: case NAVBAR_MODE_EDIT_WIKITEXT_SUMMARY: @@ -501,22 +501,22 @@ MWLocalizedString(@"navbar-title-mode-edit-wikitext-summary", nil) ; self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_CHECK(50)]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_ARROW_RIGHT(50)]|"; break; case NAVBAR_MODE_EDIT_WIKITEXT_CAPTCHA: self.label.text = MWLocalizedString(@"navbar-title-mode-edit-wikitext-captcha", nil); self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL][NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_ARROW_RIGHT(50)]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_VERTICAL_LINE_2(singlePixel)][NAVBAR_BUTTON_ARROW_RIGHT(50)]|"; break; case NAVBAR_MODE_PAGE_HISTORY: self.label.text = MWLocalizedString(@"page-history-title", nil); self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-|"; break; case NAVBAR_MODE_CREDITS: self.label.text = MWLocalizedString(@"main-menu-credits", nil); self.navBarSubViewsHorizontalVFLString = - @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]|"; + @"H:|[NAVBAR_BUTTON_ARROW_LEFT(50)][NAVBAR_VERTICAL_LINE_1(singlePixel)]-(10)-[NAVBAR_LABEL]-(10)-|"; break; default: //NAVBAR_MODE_SEARCH self.navBarSubViewsHorizontalVFLString = diff --git a/wikipedia/View Controllers/WebView/WebViewController.m b/wikipedia/View Controllers/WebView/WebViewController.m index 4419a29..e2464d3 100644 --- a/wikipedia/View Controllers/WebView/WebViewController.m +++ b/wikipedia/View Controllers/WebView/WebViewController.m @@ -142,7 +142,7 @@ // Ensure the keyboard hides if the web view is scrolled self.webView.scrollView.delegate = self; - self.webView.backgroundColor = [UIColor colorWithRed:0.98 green:0.98 blue:0.98 alpha:1.0]; + self.webView.backgroundColor = [UIColor whiteColor]; [self.webView hideScrollGradient]; diff --git a/wikipedia/assets/styles.css b/wikipedia/assets/styles.css index d25bd84..8826250 100644 --- a/wikipedia/assets/styles.css +++ b/wikipedia/assets/styles.css @@ -1,5 +1,5 @@ body { - background-color: #fafafa; + background-color: #ffffff; padding: 0px; margin: 0px; color: #000; @@ -138,11 +138,11 @@ background-image: url('images/edit.png'); background-repeat: no-repeat; background-position: center; - background-color: #fafafa; + background-color: #ffffff; /* Having border seems to make the edit_section span respond better to touch events for some reason. */ border-style: solid; border-width: 1px; - border-color: #fafafa; + border-color: #ffffff; margin-top: 8px; } body[dir=rtl] .edit_section { diff --git a/www/less/pagestyles.less b/www/less/pagestyles.less index bb6a615..9d3f331 100644 --- a/www/less/pagestyles.less +++ b/www/less/pagestyles.less @@ -1,6 +1,6 @@ body { - background-color: #fafafa; + background-color: #ffffff; padding: 0px; margin: 0px; color: #000; @@ -161,11 +161,11 @@ background-image:url('images/edit.png'); background-repeat: no-repeat; background-position:center; - background-color:#fafafa; + background-color:#ffffff; /* Having border seems to make the edit_section span respond better to touch events for some reason. */ border-style:solid; border-width:1px; - border-color:#fafafa; + border-color:#ffffff; margin-top:8px; } -- To view, visit https://gerrit.wikimedia.org/r/129727 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I649738c22c048d8e15c1740f580eb83a699968e7 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd <mh...@wikimedia.org> Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits