This repository was archived by the owner on Jul 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 609
Expand file tree
/
Copy pathGoProViewController.cs
More file actions
48 lines (40 loc) · 1.69 KB
/
GoProViewController.cs
File metadata and controls
48 lines (40 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using UIKit;
using System;
using CodeHub.iOS.ViewControllers.Application;
using MvvmCross.Platform;
using CodeHub.Core.Services;
namespace CodeHub.iOS.ViewControllers.Walkthrough
{
public partial class GoProViewController : BaseViewController
{
public GoProViewController()
: base("GoProViewController", null)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
TellMeMoreButton.BackgroundColor = UIColor.FromRGB(0x27, 0xae, 0x60);
TellMeMoreButton.SetTitleColor(UIColor.White, UIControlState.Normal);
TellMeMoreButton.Layer.CornerRadius = 6f;
OnActivation(d => d(TellMeMoreButton.GetClickedObservable().Subscribe(_ => TellMeMore())));
}
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
var features = Mvx.Resolve<IFeaturesService>();
if (features.IsProEnabled)
{
TitleLabel.Text = "Pro Enabled!";
DescriptionLabel.Text = "Thank you for your continued support! The following Pro features have been activated for your device:\n\n• Private Repositories\n• Enterprise Support\n• Push Notifications";
}
}
private void TellMeMore()
{
var view = new UpgradeViewController();
view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);
view.NavigationItem.LeftBarButtonItem.GetClickedObservable().Subscribe(_ => DismissViewController(true, null));
PresentViewController(new ThemedNavigationController(view), true, null);
}
}
}