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

Commit ca82476

Browse files
committed
[iOS] Copy over ProgressLabel from Xamarin.Auth
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.
1 parent 5d6a8dd commit ca82476

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System;
2+
using MonoTouch.UIKit;
3+
using System.Drawing;
4+
5+
namespace Xamarin.Social
6+
{
7+
internal class ProgressLabel : UIView
8+
{
9+
UIActivityIndicatorView activity;
10+
11+
public ProgressLabel (string text)
12+
: base (new RectangleF (0, 0, 200, 44))
13+
{
14+
BackgroundColor = UIColor.Clear;
15+
16+
activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White) {
17+
Frame = new RectangleF (0, 11.5f, 21, 21),
18+
HidesWhenStopped = false,
19+
Hidden = false,
20+
};
21+
AddSubview (activity);
22+
23+
var label = new UILabel () {
24+
Text = text,
25+
TextColor = UIColor.White,
26+
Font = UIFont.BoldSystemFontOfSize (20),
27+
BackgroundColor = UIColor.Clear,
28+
Frame = new RectangleF (25, 0, Frame.Width - 25, 44),
29+
};
30+
AddSubview (label);
31+
32+
var f = Frame;
33+
f.Width = label.Frame.X + label.StringSize (label.Text, label.Font).Width;
34+
Frame = f;
35+
}
36+
37+
public void StartAnimating ()
38+
{
39+
activity.StartAnimating ();
40+
}
41+
42+
public void StopAnimating ()
43+
{
44+
activity.StopAnimating ();
45+
}
46+
}
47+
}
48+

src/Xamarin.Social.iOS/ShareViewController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
using MonoTouch.Foundation;
2424
using MonoTouch.UIKit;
2525
using Xamarin.Auth;
26-
using Xamarin.Controls;
2726
using Xamarin.Utilities.iOS;
2827

2928
namespace Xamarin.Social

src/Xamarin.Social.iOS/Xamarin.Social.iOS.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,12 @@
8282
<Compile Include="..\Xamarin.Social\OAuth2Service.cs">
8383
<Link>OAuth2Service.cs</Link>
8484
</Compile>
85+
<Compile Include="ProgressLabel.cs" />
8586
<Compile Include="ShareViewController.cs" />
8687
<Compile Include="..\Xamarin.Social\Services\AppDotNetService.cs">
8788
<Link>Services\AppDotNetService.cs</Link>
8889
</Compile>
8990
<Compile Include="Services\Twitter5Service.cs" />
90-
<Compile Include="..\..\Xamarin.Auth\src\Xamarin.Auth.iOS\ProgressLabel.cs">
91-
<Link>ProgressLabel.cs</Link>
92-
</Compile>
9391
<Compile Include="..\..\Xamarin.Auth\src\Xamarin.Auth.iOS\UIViewControllerEx.cs">
9492
<Link>UIViewControllerEx.cs</Link>
9593
</Compile>

0 commit comments

Comments
 (0)