This repository has been archived by the owner on May 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
Showing
3 changed files
with
49 additions
and
4 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
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 (); | ||
} | ||
} | ||
} | ||
|
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