-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow customization of ProgressHUD through ProgressHUDAppearance
- Loading branch information
1 parent
4ecc282
commit 6d58d5a
Showing
4 changed files
with
66 additions
and
38 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using UIKit; | ||
|
||
namespace BigTed; | ||
|
||
public static class ProgressHUDAppearance | ||
{ | ||
public static UIColor DefaultHudBackgroundColour { get; } = | ||
OperatingSystem.IsIOSVersionAtLeast(13, 0) || OperatingSystem.IsMacCatalystVersionAtLeast(13) ? | ||
UIColor.SystemBackground.ColorWithAlpha(0.8f) : | ||
UIColor.White.ColorWithAlpha(0.8f); | ||
|
||
public static UIColor DefaultHudForegroundColor { get; } = | ||
OperatingSystem.IsIOSVersionAtLeast(13, 0) || OperatingSystem.IsMacCatalystVersionAtLeast(13) ? | ||
UIColor.Label.ColorWithAlpha(0.8f) : | ||
UIColor.FromWhiteAlpha(0.0f, 0.8f); | ||
|
||
public static UIColor DefaultHudToastBackgroundColor { get; } = UIColor.Clear; | ||
public static UIFont DefaultHudFont { get; } = UIFont.BoldSystemFontOfSize(16f); | ||
public static UITextAlignment DefaultHudTextAlignment { get; } = UITextAlignment.Center; | ||
public const float DefaultRingRadius = 14f; | ||
public const float DefaultRingThickness = 1f; | ||
|
||
public static float RingRadius { get; set; } = DefaultRingRadius; | ||
public static float RingThickness { get; set; } = DefaultRingThickness; | ||
|
||
|
||
public static UIColor HudBackgroundColour { get; set; } = DefaultHudBackgroundColour; | ||
public static UIColor HudForegroundColor { get; set; } = DefaultHudForegroundColor; | ||
public static UIColor HudToastBackgroundColor { get; set; } = DefaultHudToastBackgroundColor; | ||
public static UIFont HudFont { get; set; } = DefaultHudFont; | ||
public static UITextAlignment HudTextAlignment { get; set; } = DefaultHudTextAlignment; | ||
|
||
public static UIImage? ErrorImage { get; set; } | ||
public static UIImage? SuccessImage { get; set; } | ||
public static UIImage? InfoImage { get; set; } | ||
public static UIImage? ErrorOutlineImage { get; set; } | ||
public static UIImage? SuccessOutlineImage { get; set; } | ||
public static UIImage? InfoOutlineImage { get; set; } | ||
public static UIImage? ErrorOutlineFullImage { get; set; } | ||
public static UIImage? SuccessOutlineFullImage { get; set; } | ||
public static UIImage? InfoOutlineFullImage { get; set; } | ||
} |
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