Skip to content

Commit

Permalink
iOS: Moved more theme values into GlobalTheme. Updated player view sc…
Browse files Browse the repository at this point in the history
…roll views.

Related to issue #405.
  • Loading branch information
ycastonguay committed Apr 18, 2013
1 parent 6d31421 commit 4804e3a
Show file tree
Hide file tree
Showing 19 changed files with 141 additions and 49 deletions.
9 changes: 5 additions & 4 deletions MPfm/MPfm.iOS/Classes/Controllers/LoopsViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using MPfm.MVP.Views;
using MPfm.Player.Objects;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MPfm.iOS.Classes.Controllers.Base;
using MPfm.MVP.Views;
using MPfm.Player.Objects;
using MPfm.iOS.Classes.Objects;

namespace MPfm.iOS
{
Expand All @@ -35,10 +36,10 @@ public LoopsViewController(Action<IBaseView> onViewReady)

public override void ViewDidLoad()
{
// Add custom background to button
viewBackground.BackgroundColor = GlobalTheme.PlayerPanelBackgroundColor;
btnAddLoop.Layer.CornerRadius = 8;
btnAddLoop.Layer.BackgroundColor = UIColor.LightGray.CGColor;
btnAddLoop.Alpha = 0.8f;
btnAddLoop.Alpha = GlobalTheme.PlayerPanelButtonAlpha;
base.ViewDidLoad();
}

Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public override void ViewDidLoad()
btnDeleteMarker.BackgroundColor = GlobalTheme.SecondaryColor;
btnDeleteMarker.Layer.CornerRadius = 8;

sliderPosition.SetThumbImage(UIImage.FromBundle("Images/Sliders/thumb"), UIControlState.Normal);
sliderPosition.SetMinTrackImage(UIImage.FromBundle("Images/Sliders/slider2").StretchableImage(8, 0), UIControlState.Normal);
sliderPosition.SetMaxTrackImage(UIImage.FromBundle("Images/Sliders/slider").StretchableImage(8, 0), UIControlState.Normal);

sliderPosition.Transform = CGAffineTransform.MakeScale(0.7f, 0.7f);
sliderPosition.Frame = new RectangleF(90, sliderPosition.Frame.Y + 1, sliderPosition.Frame.Width * 1.4f, sliderPosition.Frame.Height);

Expand Down
4 changes: 3 additions & 1 deletion MPfm/MPfm.iOS/Classes/Controllers/MarkersViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public override void ViewDidLoad()
tableView.WeakDataSource = this;
tableView.WeakDelegate = this;

btnAddMarker.BackgroundColor = GlobalTheme.SecondaryColor;
viewBackground.BackgroundColor = GlobalTheme.PlayerPanelBackgroundColor;
btnAddMarker.BackgroundColor = UIColor.LightGray;
btnAddMarker.Alpha = GlobalTheme.PlayerPanelButtonAlpha;

UILongPressGestureRecognizer longPress = new UILongPressGestureRecognizer(HandleLongPress);
longPress.MinimumPressDuration = 1.0f;
Expand Down

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

12 changes: 8 additions & 4 deletions MPfm/MPfm.iOS/Classes/Controllers/PitchShiftingViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ public PitchShiftingViewController(Action<IBaseView> onViewReady)

public override void ViewDidLoad()
{
// Add custom background to button
viewBackground.BackgroundColor = GlobalTheme.PlayerPanelBackgroundColor;
btnReset.Layer.CornerRadius = 8;
btnReset.Layer.BackgroundColor = UIColor.LightGray.CGColor;
btnReset.Alpha = 0.8f;
btnReset.Alpha = GlobalTheme.PlayerPanelButtonAlpha;

slider.SetThumbImage(UIImage.FromBundle("Images/Sliders/thumb"), UIControlState.Normal);
slider.SetMinTrackImage(UIImage.FromBundle("Images/Sliders/slider2").StretchableImage(8, 0), UIControlState.Normal);
slider.SetMaxTrackImage(UIImage.FromBundle("Images/Sliders/slider").StretchableImage(8, 0), UIControlState.Normal);

// Use Appearance API (iOS 5+) for segmented control
UITextAttributes attr = new UITextAttributes();
attr.Font = UIFont.FromName("HelveticaNeue-Bold", 12);
attr.TextColor = UIColor.White;
segmentedControl.TintColor = GlobalTheme.SecondaryColor;
segmentedControl.TintColor = UIColor.LightGray;
segmentedControl.SetTitleTextAttributes(attr, UIControlState.Normal);
segmentedControl.Alpha = 0.8f;
segmentedControl.Alpha = GlobalTheme.PlayerPanelButtonAlpha;

base.ViewDidLoad();
}
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MPfm.iOS.Classes.Controllers.Base;
using MPfm.MVP.Views;
using MPfm.Sound.AudioFiles;
using MonoTouch.Foundation;
using MonoTouch.MediaPlayer;
using MonoTouch.UIKit;
using MPfm.iOS.Classes.Controllers.Base;
using MPfm.iOS.Classes.Objects;

namespace MPfm.iOS
{
Expand All @@ -41,6 +42,7 @@ public override void ViewDidLoad()
lblArtistName.Text = string.Empty;
lblAlbumTitle.Text = string.Empty;
lblTitle.Text = string.Empty;
viewBackground.BackgroundColor = GlobalTheme.PlayerPanelBackgroundColor;

base.ViewDidLoad();
}
Expand Down
2 changes: 1 addition & 1 deletion MPfm/MPfm.iOS/Classes/Controllers/PlayerViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public override void DidReceiveMemoryWarning()

public override void ViewDidLoad()
{
// Load button bitmaps
btnPrevious.SetImage(UIImage.FromBundle("Images/Buttons/previous"), UIControlState.Normal);
btnPrevious.SetImage(UIImage.FromBundle("Images/Buttons/previous_on"), UIControlState.Highlighted);
btnPlayPause.SetImage(UIImage.FromBundle("Images/Buttons/pause"), UIControlState.Normal);
Expand All @@ -77,6 +76,7 @@ public override void ViewDidLoad()

viewPosition.BackgroundColor = GlobalTheme.BackgroundColor;
viewMain.BackgroundColor = GlobalTheme.BackgroundColor;
viewPageControls.BackgroundColor = GlobalTheme.PlayerPanelBackgroundColor;

sliderPosition.SetThumbImage(UIImage.FromBundle("Images/Sliders/thumb"), UIControlState.Normal);
sliderPosition.SetMinTrackImage(UIImage.FromBundle("Images/Sliders/slider2").StretchableImage(8, 0), UIControlState.Normal);
Expand Down

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

12 changes: 8 additions & 4 deletions MPfm/MPfm.iOS/Classes/Controllers/TimeShiftingViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ public TimeShiftingViewController(Action<IBaseView> onViewReady)

public override void ViewDidLoad()
{
// Add custom background to button
viewBackground.BackgroundColor = GlobalTheme.PlayerPanelBackgroundColor;
btnReset.Layer.CornerRadius = 8;
btnReset.Layer.BackgroundColor = GlobalTheme.SecondaryColor.CGColor;
btnReset.Alpha = 0.8f;
btnReset.Layer.BackgroundColor = UIColor.LightGray.CGColor;
btnReset.Alpha = GlobalTheme.PlayerPanelButtonAlpha;
btnDetectTempo.Layer.CornerRadius = 8;
btnDetectTempo.Layer.BackgroundColor = UIColor.LightGray.CGColor;
btnDetectTempo.Alpha = 0.8f;
segmentedControl.Alpha = 0.8f;
segmentedControl.Alpha = GlobalTheme.PlayerPanelButtonAlpha;

slider.SetThumbImage(UIImage.FromBundle("Images/Sliders/thumb"), UIControlState.Normal);
slider.SetMinTrackImage(UIImage.FromBundle("Images/Sliders/slider2").StretchableImage(8, 0), UIControlState.Normal);
slider.SetMaxTrackImage(UIImage.FromBundle("Images/Sliders/slider").StretchableImage(8, 0), UIControlState.Normal);

// Use Appearance API (iOS 5+) for segmented control
UITextAttributes attr = new UITextAttributes();
Expand Down

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

20 changes: 2 additions & 18 deletions MPfm/MPfm.iOS/Classes/Objects/GlobalTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ namespace MPfm.iOS.Classes.Objects
{
public static class GlobalTheme
{
// Main: Wet Asphalt / Midnight Blue -- Secondary: Alizarin / Pomegranate
//public static UIColor MainColor { get { return UIColor.FromRGBA(0.2274f, 0.2862f, 0.3686f, 1); } }
//public static UIColor MainDarkColor { get { return UIColor.FromRGBA(0.1725f, 0.2431f, 0.3137f, 1); } }
public static UIColor MainColor { get { return UIColor.FromRGBA(0.2118f, 0.2706f, 0.3098f, 1); } }
public static UIColor MainDarkColor { get { return UIColor.FromRGBA(0.1490f, 0.1843f, 0.2118f, 1); } }
public static UIColor MainLightColor { get { return UIColor.FromRGBA(0.2745f, 0.3490f, 0.4f, 1); } }
Expand All @@ -31,20 +28,7 @@ public static class GlobalTheme
public static UIColor LightColor { get { return UIColor.FromRGBA(1.0f, 1.0f, 1.0f, 1); } }
public static UIColor BackgroundColor { get { return UIColor.FromRGBA(0.1255f, 0.1569f, 0.1804f, 1); } }
public static UIColor WaveFormColor { get { return UIColor.FromRGBA(1, 1, 0.25f, 1); } }

//public static UIColor MainColor { get { return UIColor.FromRGBA(0.2196f, 0.2470f, 0.2784f, 1); } }
//public static UIColor SecondaryColor { get { return UIColor.FromRGBA(0.1843f, 0.2039f, 0.2274f, 1); } }
//public static UIColor BackgroundColor { get { return UIColor.FromRGBA(0.1568f, 0.1568f, 0.1568f, 1); } }

// Concrete / Asbestos
// public static UIColor MainColor { get { return UIColor.FromRGBA(0.5843f, 0.6470f, 0.6509f, 1); } }
// public static UIColor SecondaryColor { get { return UIColor.FromRGBA(0.4980f, 0.5490f, 0.5529f, 1); } }
// public static UIColor BackgroundColor { get { return UIColor.FromRGBA(0.1568f, 0.1568f, 0.1568f, 1); } }

// // Alizarin / Pomegranate
// public static UIColor MainColor { get { return UIColor.FromRGBA(0.9059f, 0.2980f, 0.2353f, 1); } }
// public static UIColor SecondaryColor { get { return UIColor.FromRGBA(0.7529f, 0.2235f, 0.1686f, 1); } }
// public static UIColor BackgroundColor { get { return UIColor.FromRGBA(0.1568f, 0.1568f, 0.1568f, 1); } }

public static UIColor PlayerPanelBackgroundColor { get { return UIColor.FromRGBA(0, 0, 0, 0.6f); } }
public static float PlayerPanelButtonAlpha { get { return 0.8f; } }
}
}
10 changes: 9 additions & 1 deletion MPfm/MPfm.iOS/XIB/iPhone/LoopsViewController_iPhone.xib
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">viewBackground</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="574708960"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">actionAddLoop:</string>
Expand Down Expand Up @@ -271,7 +279,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">14</int>
<int key="maxID">15</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down
13 changes: 10 additions & 3 deletions MPfm/MPfm.iOS/XIB/iPhone/MarkersViewController_iPhone.xib
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
<string key="NSFrame">{{20, 44}, {280, 416}}</string>
<reference key="NSSuperview" ref="745961191"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
Expand Down Expand Up @@ -141,7 +140,7 @@
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwLjUAA</bytes>
<bytes key="NSWhite">MAA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
Expand Down Expand Up @@ -192,6 +191,14 @@
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">viewBackground</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="745961191"/>
</object>
<int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">actionAddMarker:</string>
Expand Down Expand Up @@ -272,7 +279,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">11</int>
<int key="maxID">12</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down
15 changes: 14 additions & 1 deletion MPfm/MPfm.iOS/XIB/iPhone/PitchShiftingViewController_iPhone.xib
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">viewBackground</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="63380813"/>
</object>
<int key="connectionID">22</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">actionReset:</string>
Expand Down Expand Up @@ -368,7 +376,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">21</int>
<int key="maxID">22</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -400,6 +408,7 @@
<string key="lblTitle">UILabel</string>
<string key="segmentedControl">UISegmentedControl</string>
<string key="slider">UISlider</string>
<string key="viewBackground">UIView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="btnReset">
Expand All @@ -422,6 +431,10 @@
<string key="name">slider</string>
<string key="candidateClassName">UISlider</string>
</object>
<object class="IBToOneOutletInfo" key="viewBackground">
<string key="name">viewBackground</string>
<string key="candidateClassName">UIView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
Expand Down
Loading

0 comments on commit 4804e3a

Please sign in to comment.