Skip to content

Commit

Permalink
More darkening
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike James committed Jul 6, 2016
1 parent d8b2dd2 commit d1a0eba
Show file tree
Hide file tree
Showing 18 changed files with 861 additions and 100 deletions.
4 changes: 3 additions & 1 deletion ClientSDKs/BeerDrinkin.DataObjects/Beer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ public class Beer : BaseDataObject
public string BreweryDbId { get; set; }
public string RateBeerId { get; set; }

public string CoverPhoto { get; set;}

public string Name { get; set; }
public string Description { get; set; }
public Brewery Brewery { get; set; }
public string BreweryId { get; set; }
public string StyleId { get; set; }

public string OriginCountry { get; set;}
public double? Abv { get; set; }

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions MobileApps/iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ static void SetupGlobalAppearances ()
//NavigationBar
UINavigationBar.Appearance.BarTintColor = Helpers.Style.Colors.NavigationBar;
UINavigationBar.Appearance.TintColor = Helpers.Style.Colors.NavigationTint;
UINavigationBar.Appearance.Translucent = false;

UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes
{
Expand Down
20 changes: 16 additions & 4 deletions MobileApps/iOS/BeerDrinkin.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@
</InterfaceDefinition>
<InterfaceDefinition Include="Main.storyboard" />
<InterfaceDefinition Include="Custom Controls\ProfileHeaderView.xib" />
<InterfaceDefinition Include="UITableViewCells\Beer Description\StarRatingTableViewCell.xib" />
<InterfaceDefinition Include="Custom Controls\BeerDescriptionHeaderView.xib" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
Expand Down Expand Up @@ -550,14 +552,23 @@
<DependentUpon>CheckInViewController.cs</DependentUpon>
</Compile>
<Compile Include="Services\SpotlightService.cs" />
<Compile Include="ProfileHeaderView.cs" />
<Compile Include="ProfileHeaderView.designer.cs">
<DependentUpon>ProfileHeaderView.cs</DependentUpon>
</Compile>
<Compile Include="View Controllers\UserProfile\AccountViewController.cs" />
<Compile Include="View Controllers\UserProfile\AccountViewController.designer.cs">
<DependentUpon>AccountViewController.cs</DependentUpon>
</Compile>
<Compile Include="UITableViewCells\StarRatingTableViewCell.cs" />
<Compile Include="UITableViewCells\StarRatingTableViewCell.designer.cs">
<DependentUpon>StarRatingTableViewCell.cs</DependentUpon>
</Compile>
<Compile Include="Custom Controls\BeerStatsView.cs" />
<Compile Include="Custom Controls\ProfileHeaderView.cs" />
<Compile Include="Custom Controls\ProfileHeaderView.designer.cs">
<DependentUpon>ProfileHeaderView.cs</DependentUpon>
</Compile>
<Compile Include="Custom Controls\BeerDescriptionHeaderView.cs" />
<Compile Include="Custom Controls\BeerDescriptionHeaderView.designer.cs">
<DependentUpon>BeerDescriptionHeaderView.cs</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Import Project="..\packages\Xamarin.Insights.1.10.5\build\Xamarin.iOS10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.10.5\build\Xamarin.iOS10\Xamarin.Insights.targets')" />
Expand Down Expand Up @@ -840,5 +851,6 @@
<Folder Include="View Controllers\UserProfile\" />
<Folder Include="UITableViewCells\Discover\" />
<Folder Include="Services\" />
<Folder Include="UITableViewCells\Beer Description\" />
</ItemGroup>
</Project>
68 changes: 68 additions & 0 deletions MobileApps/iOS/Custom Controls/BeerDescriptionHeaderView.cs
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;
}

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

159 changes: 159 additions & 0 deletions MobileApps/iOS/Custom Controls/BeerDescriptionHeaderView.xib
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>
Loading

0 comments on commit d1a0eba

Please sign in to comment.