Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #9 from ZZBHuang/trim-appearance
Browse files Browse the repository at this point in the history
Add credits and adjust appearance
  • Loading branch information
stewwu authored Jul 26, 2016
2 parents 89cfe5b + 001ec94 commit eaef77e
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 30 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The Components
### YMSPhotoPicker

YMSPhotoPicker is an UIComponent that let you select mutilple photos from your albums. You can also take a photo inside YMSPhotoPicker and select it with other photos. It has the exposed theme YMSPhotoPickerTheme that you can customize several parts of YMSPhotoPicker.

Part of the code in this package was derived from Yahoo Messenger and Yahoo Taiwan Auctions.

<img src="media/ymsphotopicker-demo.gif" alt="Square Cash Style Bar" width="300"/>
<img src="media/ymsphotopicker-theme.gif" alt="Square Cash Style Bar" width="300"/>
Expand Down
2 changes: 1 addition & 1 deletion YangMingShan.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'YangMingShan'
s.author = { "Team" => "[email protected]" }
s.version = '1.0.0'
s.version = '1.1.0'
s.summary = 'The collection of useful UI components that inspired by Yahoo apps.'
s.homepage = 'https://github.com/yahoo/YangMingShan'
s.license = "Yahoo! Inc. BSD license"
Expand Down
1 change: 1 addition & 0 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the BSD license. Please see LICENSE file in the project root for terms.
//
// Part of this code was derived from code authored by David Robles

#import <Photos/Photos.h>
#import <UIKit/UIKit.h>
Expand Down
8 changes: 4 additions & 4 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// YMSPhotoCell.m
// YangMingShan
//
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the BSD license. Please see LICENSE file in the project root for terms.
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the BSD license. Please see LICENSE file in the project root for terms.
//
// Part of this code was derived from code authored by David Robles
// This code includes sample code from the following StackOverflow posting: http://stackoverflow.com/questions/10497397/from-catransform3d-to-cgaffinetransform

#import "YMSPhotoCell.h"

Expand Down Expand Up @@ -42,10 +44,8 @@ - (void)awakeFromNib
self.longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] init];
[self addGestureRecognizer:self.longPressGestureRecognizer];

self.selectionOrderLabel.layer.borderColor = [UIColor whiteColor].CGColor;
self.selectionOrderLabel.textColor = [YMSPhotoPickerTheme sharedInstance].orderLabelTextColor;

self.selectionOrderLabel.layer.borderWidth = 1.0;
self.selectionVeil.layer.borderWidth = 4.0;

self.selectionOrderLabel.backgroundColor = [YMSPhotoPickerTheme sharedInstance].orderTintColor;
Expand Down
13 changes: 4 additions & 9 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
Expand All @@ -21,7 +21,7 @@
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.34999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="pHv-Ky-9IK">
<rect key="frame" x="18" y="8" width="24" height="24"/>
<rect key="frame" x="24" y="24" width="24" height="24"/>
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="AHi-eQ-HpO"/>
Expand All @@ -30,21 +30,16 @@
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="12"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
<constraint firstAttribute="bottom" secondItem="pHv-Ky-9IK" secondAttribute="bottom" constant="2" id="6Bf-bB-vaX"/>
<constraint firstAttribute="trailing" secondItem="5Nu-Tc-xoT" secondAttribute="trailing" id="7Ow-8j-oyf"/>
<constraint firstAttribute="bottom" secondItem="5Nu-Tc-xoT" secondAttribute="bottom" id="Ia0-V1-z0N"/>
<constraint firstItem="5Nu-Tc-xoT" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="LQI-8J-ihA"/>
<constraint firstItem="pHv-Ky-9IK" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="8" id="MfB-78-YZz"/>
<constraint firstAttribute="trailing" secondItem="pHv-Ky-9IK" secondAttribute="trailing" constant="8" id="YnI-6m-rM0"/>
<constraint firstAttribute="trailing" secondItem="pHv-Ky-9IK" secondAttribute="trailing" constant="2" id="YnI-6m-rM0"/>
<constraint firstItem="5Nu-Tc-xoT" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="Zzh-Mj-OTv"/>
<constraint firstAttribute="trailing" secondItem="fuA-cX-VUz" secondAttribute="trailing" id="cDk-je-E9K"/>
<constraint firstAttribute="bottom" secondItem="fuA-cX-VUz" secondAttribute="bottom" id="kwD-cK-9OX"/>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,16 @@ - (IBAction)presentPhotoPicker:(id)sender
YMSPhotoPickerViewController *pickerViewController = [[YMSPhotoPickerViewController alloc] init];
pickerViewController.numberOfPhotoToSelect = [numberOfPhotoSelectionString integerValue];

UIColor *customColor = [UIColor colorWithRed:64.0/255.0 green:0.0 blue:144.0/255.0 alpha:1.0];
UIColor *customCameraColor = [UIColor colorWithRed:86.0/255.0 green:1.0/255.0 blue:236.0/255.0 alpha:1.0];
UIColor *customColor = [UIColor colorWithRed:248.0/255.0 green:217.0/255.0 blue:44.0/255.0 alpha:1.0];

pickerViewController.theme.titleLabelTextColor = [UIColor whiteColor];
pickerViewController.theme.titleLabelTextColor = [UIColor blackColor];
pickerViewController.theme.navigationBarBackgroundColor = customColor;
pickerViewController.theme.tintColor = [UIColor whiteColor];
pickerViewController.theme.orderTintColor = customCameraColor;
pickerViewController.theme.orderLabelTextColor = [UIColor whiteColor];
pickerViewController.theme.cameraVeilColor = customCameraColor;
pickerViewController.theme.tintColor = [UIColor blackColor];
pickerViewController.theme.orderTintColor = customColor;
pickerViewController.theme.orderLabelTextColor = [UIColor blackColor];
pickerViewController.theme.cameraVeilColor = customColor;
pickerViewController.theme.cameraIconColor = [UIColor whiteColor];
pickerViewController.theme.statusBarStyle = UIStatusBarStyleLightContent;
pickerViewController.theme.statusBarStyle = UIStatusBarStyleDefault;

[self yms_presentCustomAlbumPhotoView:pickerViewController delegate:self];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ class DemoPhotoViewController: UIViewController, YMSPhotoPickerViewControllerDel

pickerViewController.numberOfPhotoToSelect = UInt(self.numberOfPhotoSelectionTextField.text!)!

let customColor = UIColor.init(red: 64.0/255.0, green: 0.0, blue: 144.0/255.0, alpha: 1.0)
let customCameraColor = UIColor.init(red: 86.0/255.0, green: 1.0/255.0, blue: 236.0/255.0, alpha: 1.0)
let customColor = UIColor.init(red:248.0/255.0, green:217.0/255.0, blue:44.0/255.0, alpha:1.0)

pickerViewController.theme.titleLabelTextColor = UIColor.whiteColor()
pickerViewController.theme.titleLabelTextColor = UIColor.blackColor()
pickerViewController.theme.navigationBarBackgroundColor = customColor
pickerViewController.theme.tintColor = UIColor.whiteColor()
pickerViewController.theme.orderTintColor = customCameraColor
pickerViewController.theme.orderLabelTextColor = UIColor.whiteColor()
pickerViewController.theme.cameraVeilColor = customCameraColor
pickerViewController.theme.tintColor = UIColor.blackColor()
pickerViewController.theme.orderTintColor = customColor
pickerViewController.theme.orderLabelTextColor = UIColor.blackColor()
pickerViewController.theme.cameraVeilColor = customColor
pickerViewController.theme.cameraIconColor = UIColor.whiteColor()
pickerViewController.theme.statusBarStyle = .LightContent
pickerViewController.theme.statusBarStyle = .Default

self.yms_presentCustomAlbumPhotoView(pickerViewController, delegate: self)
}
Expand Down
Binary file modified media/ymsphotopicker-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/ymsphotopicker-theme.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eaef77e

Please sign in to comment.