Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
[iOS] Copy over ProgressLabel from Xamarin.Auth
Browse files Browse the repository at this point in the history
It was being linked, but this fails with a static type registrar as the
full type name is the same. Switched namespace from Xamarin.Controls to
Xamarin.Social.
  • Loading branch information
ermau committed Dec 13, 2013
1 parent 5d6a8dd commit ca82476
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
48 changes: 48 additions & 0 deletions src/Xamarin.Social.iOS/ProgressLabel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using MonoTouch.UIKit;
using System.Drawing;

namespace Xamarin.Social
{
internal class ProgressLabel : UIView
{
UIActivityIndicatorView activity;

public ProgressLabel (string text)
: base (new RectangleF (0, 0, 200, 44))
{
BackgroundColor = UIColor.Clear;

activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White) {
Frame = new RectangleF (0, 11.5f, 21, 21),
HidesWhenStopped = false,
Hidden = false,
};
AddSubview (activity);

var label = new UILabel () {
Text = text,
TextColor = UIColor.White,
Font = UIFont.BoldSystemFontOfSize (20),
BackgroundColor = UIColor.Clear,
Frame = new RectangleF (25, 0, Frame.Width - 25, 44),
};
AddSubview (label);

var f = Frame;
f.Width = label.Frame.X + label.StringSize (label.Text, label.Font).Width;
Frame = f;
}

public void StartAnimating ()
{
activity.StartAnimating ();
}

public void StopAnimating ()
{
activity.StopAnimating ();
}
}
}

1 change: 0 additions & 1 deletion src/Xamarin.Social.iOS/ShareViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Xamarin.Auth;
using Xamarin.Controls;
using Xamarin.Utilities.iOS;

namespace Xamarin.Social
Expand Down
4 changes: 1 addition & 3 deletions src/Xamarin.Social.iOS/Xamarin.Social.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,12 @@
<Compile Include="..\Xamarin.Social\OAuth2Service.cs">
<Link>OAuth2Service.cs</Link>
</Compile>
<Compile Include="ProgressLabel.cs" />
<Compile Include="ShareViewController.cs" />
<Compile Include="..\Xamarin.Social\Services\AppDotNetService.cs">
<Link>Services\AppDotNetService.cs</Link>
</Compile>
<Compile Include="Services\Twitter5Service.cs" />
<Compile Include="..\..\Xamarin.Auth\src\Xamarin.Auth.iOS\ProgressLabel.cs">
<Link>ProgressLabel.cs</Link>
</Compile>
<Compile Include="..\..\Xamarin.Auth\src\Xamarin.Auth.iOS\UIViewControllerEx.cs">
<Link>UIViewControllerEx.cs</Link>
</Compile>
Expand Down

0 comments on commit ca82476

Please sign in to comment.