-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mike James
committed
Jul 6, 2016
1 parent
d8b2dd2
commit d1a0eba
Showing
18 changed files
with
861 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
MobileApps/iOS/Custom Controls/BeerDescriptionHeaderView.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Foundation; | ||
using System; | ||
using UIKit; | ||
using ObjCRuntime; | ||
|
||
using BeerDrinkin.DataObjects; | ||
using SDWebImage; | ||
using CoreImage; | ||
|
||
namespace BeerDrinkin.iOS | ||
{ | ||
public partial class BeerDescriptionHeaderView : UIView | ||
{ | ||
public BeerDescriptionHeaderView (IntPtr handle) : base (handle) | ||
{ | ||
} | ||
|
||
|
||
public static BeerDescriptionHeaderView Create() | ||
{ | ||
var arr = NSBundle.MainBundle.LoadNib("BeerDescriptionHeaderView", null, null); | ||
var v = Runtime.GetNSObject<BeerDescriptionHeaderView>(arr.ValueAt(0)); | ||
return v; | ||
} | ||
|
||
Beer beer; | ||
public void SetBeer(Beer beer) | ||
{ | ||
this.beer = beer; | ||
|
||
statsView.Name = beer.Name; | ||
statsView.Country = beer.OriginCountry; | ||
statsView.ABV = beer.Abv.ToString(); | ||
|
||
if (beer.HasImages) | ||
{ | ||
image.SetImage(new NSUrl(beer.Image.LargeUrl)); | ||
DarkenImage(); | ||
} | ||
} | ||
|
||
void DarkenImage() | ||
{ | ||
var img = image.Image; | ||
var ciImage = new CIImage(img); | ||
var hueAdjust = new CIHueAdjust(); // first filter | ||
hueAdjust.Image = ciImage; | ||
hueAdjust.Angle = 2.094f; | ||
var sepia = new CISepiaTone(); // second filter | ||
sepia.Image = hueAdjust.OutputImage; // output from last filter, input to this one | ||
sepia.Intensity = 0.3f; | ||
CIFilter color = new CIColorControls() | ||
{ // third filter | ||
Saturation = 2, | ||
Brightness = 1, | ||
Contrast = 3, | ||
Image = sepia.OutputImage // output from last filter, input to this one | ||
}; | ||
var output = color.OutputImage; | ||
var context = CIContext.FromOptions(null); | ||
// ONLY when CreateCGImage is called do all the effects get rendered | ||
var cgimage = context.CreateCGImage(output, output.Extent); | ||
var ui = UIImage.FromImage(cgimage); | ||
image.Image = ui; | ||
} | ||
|
||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
MobileApps/iOS/Custom Controls/BeerDescriptionHeaderView.designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
159 changes: 159 additions & 0 deletions
159
MobileApps/iOS/Custom Controls/BeerDescriptionHeaderView.xib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view contentMode="scaleToFill" id="1" customClass="BeerDescriptionHeaderView"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="394"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="lP8-sT-u6v" misplaced="YES" image="default_profile_header.jpeg"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="320"/> | ||
</imageView> | ||
<view contentMode="scaleToFill" id="4" customClass="BeerStatsView" translatesAutoresizingMaskIntoConstraints="NO" misplaced="YES"> | ||
<rect key="frame" x="20" y="249" width="560" height="110"/> | ||
<constraints> | ||
<constraint id="21" firstItem="4" firstAttribute="height" constant="110"/> | ||
</constraints> | ||
<color key="backgroundColor" colorSpace="calibratedWhite" white="0" alpha="0"/> | ||
</view> | ||
</subviews> | ||
<color key="backgroundColor" colorSpace="calibratedWhite" white="0" alpha="0"/> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
<point key="canvasLocation" x="541" y="330"/> | ||
<constraints> | ||
<constraint id="19" firstItem="4" firstAttribute="leading" secondItem="lP8-sT-u6v" secondAttribute="leading" constant="15"/> | ||
<constraint id="20" firstItem="lP8-sT-u6v" firstAttribute="trailing" secondItem="4" secondAttribute="trailing" constant="15"/> | ||
<constraint id="22" firstItem="1" firstAttribute="bottom" secondItem="4" secondAttribute="bottom" constant="35"> | ||
<variation key="heightClass=regular-widthClass=compact" constant="20"/> | ||
</constraint> | ||
<constraint id="27" firstItem="lP8-sT-u6v" firstAttribute="top" secondItem="1" secondAttribute="top"/> | ||
<constraint id="28" firstItem="lP8-sT-u6v" firstAttribute="leading" secondItem="1" secondAttribute="leading"/> | ||
<constraint id="29" firstItem="lP8-sT-u6v" firstAttribute="trailing" secondItem="1" secondAttribute="trailing"/> | ||
<constraint id="30" firstItem="1" firstAttribute="bottom" secondItem="lP8-sT-u6v" secondAttribute="bottom" constant="74"/> | ||
</constraints> | ||
<variation key="default"> | ||
<mask key="constraints"> | ||
<exclude reference="27"/> | ||
<exclude reference="28"/> | ||
<exclude reference="29"/> | ||
<exclude reference="30"/> | ||
</mask> | ||
</variation> | ||
<variation key="heightClass=regular-widthClass=compact"> | ||
<mask key="constraints"> | ||
<include reference="27"/> | ||
<include reference="28"/> | ||
<include reference="29"/> | ||
<include reference="30"/> | ||
</mask> | ||
</variation> | ||
<connections> | ||
<outlet property="statsView" destination="4" id="name-outlet-4"/> | ||
<outlet property="image" destination="lP8-sT-u6v" id="name-outlet-lP8-sT-u6v"/> | ||
</connections> | ||
</view> | ||
</objects> | ||
<resources> | ||
<image name="BeerDrinkin.png" width="526" height="526"/> | ||
<image name="957-beer-mug.png" width="22" height="28"/> | ||
<image name="708-search.png" width="28" height="28"/> | ||
<image name="769-male.png" width="28" height="28"/> | ||
<image name="back.png" width="21" height="21"/> | ||
<image name="740-gear.png" width="28" height="28"/> | ||
<image name="emptyStar.png" width="56" height="52"/> | ||
<image name="filledStar.png" width="56" height="52"/> | ||
<image name="713-refresh-1.png" width="24" height="28"/> | ||
<image name="748-heart.png" width="28" height="25"/> | ||
<image name="facebook_button.png" width="558" height="89"/> | ||
<image name="711-trash.png" width="21" height="28"/> | ||
<image name="702-share.png" width="21" height="28"/> | ||
<image name="856-lightning-bolt.png" width="14" height="28"/> | ||
<image name="BeerLight.png" width="33" height="42"/> | ||
<image name="locationPin.png" width="42" height="66"/> | ||
<image name="Map.png" width="750" height="785"/> | ||
<image name="camera-flash.png" width="16" height="24"/> | ||
<image name="Tick.png" width="56" height="52"/> | ||
<image name="Barcode.png" width="28" height="22"/> | ||
<image name="Arrows-Left-icon.png" width="128" height="128"/> | ||
<image name="BlueTick.png" width="56" height="52"/> | ||
<image name="goolgeButton.png" width="558" height="89"/> | ||
<image name="BeerBottle_Selected.png" width="44" height="117"/> | ||
<image name="BeerBottle.png" width="44" height="117"/> | ||
<image name="BeerTap_Selected.png" width="113" height="110"/> | ||
<image name="BeerTap.png" width="113" height="110"/> | ||
<image name="BarcodeDark.png" width="291" height="132"/> | ||
<image name="backArrow.png" width="22" height="22"/> | ||
<image name="close.png" width="41" height="41"/> | ||
<image name="Patterned Image.png" width="7103" height="2025"/> | ||
<image name="tabbar_profile.png" width="30" height="30"/> | ||
<image name="tabbar_search.png" width="30" height="30"/> | ||
<image name="tabbar_mybeers.png" width="18" height="30"/> | ||
<image name="tabbar_wishlist.png" width="18" height="30"/> | ||
<image name="Analytics.png" width="256" height="256"/> | ||
<image name="search_barcode.png" width="686" height="287"/> | ||
<image name="search_placeholder_beer.png" width="113" height="203"/> | ||
<image name="analytics_bug_blue.png" width="80" height="81"/> | ||
<image name="analytics_bug_white.png" width="80" height="81"/> | ||
<image name="analytics_time_blue.png" width="80" height="80"/> | ||
<image name="analytics_time_white.png" width="80" height="80"/> | ||
<image name="search_filter.png" width="25" height="21"/> | ||
<image name="ApplePayBTN_32pt__black_logo_.png" width="140" height="32"/> | ||
<image name="profile_headerBackground.png" width="749" height="500"/> | ||
<image name="settings_about.png" width="50" height="50"/> | ||
<image name="settings_analytics.png" width="54" height="54"/> | ||
<image name="settings_feedback.png" width="50" height="50"/> | ||
<image name="settings_notifications.png" width="50" height="42"/> | ||
<image name="settings_signIn.png" width="54" height="58"/> | ||
<image name="settings_twitter.png" width="64" height="46"/> | ||
<image name="settings_xamarin.png" width="63" height="67"/> | ||
<image name="starEmpty.png" width="52" height="51"/> | ||
<image name="starFilled.png" width="52" height="51"/> | ||
<image name="about_credits.png" width="32" height="20"/> | ||
<image name="about_facebook.png" width="18" height="34"/> | ||
<image name="about_heart.png" width="23" height="20"/> | ||
<image name="about_releaseNotes.png" width="23" height="28"/> | ||
<image name="about_support.png" width="28" height="28"/> | ||
<image name="about_twitter.png" width="39" height="32"/> | ||
<image name="account_settings.png" width="55" height="55"/> | ||
<image name="account_starBlueEmpty.png" width="32" height="32"/> | ||
<image name="account_starBlueFull.png" width="32" height="32"/> | ||
<image name="checkin_addLocation.png" width="53" height="51"/> | ||
<image name="checkin_camera.png" width="56" height="43"/> | ||
<image name="quickAction_myBeers.png" width="157" height="256"/> | ||
<image name="quickAction_profile.png" width="249" height="248"/> | ||
<image name="quickAction_search.png" width="248" height="248"/> | ||
<image name="quickAction_wishlist.png" width="152" height="254"/> | ||
<image name="inAppPurhcase_beer.png" width="117" height="155"/> | ||
<image name="inAppPurhcase_close.png" width="32" height="32"/> | ||
<image name="inAppPurhcase_heart.png" width="23" height="20"/> | ||
<image name="inAppPurhcase_tick.png" width="32" height="32"/> | ||
<image name="search_inAppPurcahsePadlock.png" width="42" height="53"/> | ||
<image name="search_ocr.png" width="149" height="148"/> | ||
<image name="intro_location_map.png" width="512" height="478"/> | ||
<image name="intro_location_map_success.png" width="512" height="478"/> | ||
<image name="Introduction_Facebook.png" width="465" height="140"/> | ||
<image name="Introduction_Map.png" width="512" height="421"/> | ||
<image name="Introduction_Photos.png" width="517" height="430"/> | ||
<image name="ScrollView_BlueLarge.png" width="30" height="30"/> | ||
<image name="ScrollView_BlueSmall.png" width="24" height="24"/> | ||
<image name="ScrollView_Green.png" width="30" height="30"/> | ||
<image name="ScrollView_Purple.png" width="31" height="30"/> | ||
<image name="Tick_White.png" width="118" height="89"/> | ||
<image name="checkin_barcode.png" width="328" height="63"/> | ||
<image name="checkin_close.png" width="32" height="33"/> | ||
<image name="star_blue_empty.png" width="25" height="25"/> | ||
<image name="star_blue_filled.png" width="25" height="25"/> | ||
<image name="default_profile_header.jpeg" width="1080" height="964"/> | ||
<image name="back_arrow.png" width="18" height="32"/> | ||
<image name="mike_james_avatar.png" width="206" height="206"/> | ||
<image name="icon_more.png" width="70" height="24"/> | ||
<image name="icon_settings.png" width="52" height="52"/> | ||
</resources> | ||
<simulatedMetricsContainer key="defaultSimulatedMetrics"> | ||
<simulatedScreenMetrics key="destination" type="retina4"/> | ||
</simulatedMetricsContainer> | ||
</document> |
Oops, something went wrong.