public override void ViewDidLoad() { base.ViewDidLoad(); var shouldStar = false; var shouldWatch = false; StarButton.BackgroundColor = UIColor.FromRGB(0x2c, 0x3e, 0x50); StarButton.SetTitleColor(UIColor.White, UIControlState.Normal); StarButton.Layer.CornerRadius = 6f; StarButton.TouchUpInside += (sender, e) => { shouldStar = !shouldStar; DefaultValueService.Instance.Set("SHOULD_STAR_CODEHUB", shouldStar); var color = shouldStar ? UIColor.FromRGB(0xbd, 0xc3, 0xc7) : UIColor.FromRGB(0x2c, 0x3e, 0x50); StarButton.SetTitle(shouldStar ? "Good Choice!" : "Star", UIControlState.Normal); UIView.Animate(0.3f, () => StarButton.BackgroundColor = color); Alert(); }; WatchButton.BackgroundColor = UIColor.FromRGB(0x7f, 0x8c, 0x8d); WatchButton.SetTitleColor(UIColor.White, UIControlState.Normal); WatchButton.Layer.CornerRadius = 6f; WatchButton.TouchUpInside += (sender, e) => { shouldWatch = !shouldWatch; DefaultValueService.Instance.Set("SHOULD_WATCH_CODEHUB", shouldWatch); var color = shouldWatch ? UIColor.FromRGB(0xbd, 0xc3, 0xc7) : UIColor.FromRGB(0x7f, 0x8c, 0x8d); WatchButton.SetTitle(shouldWatch ? "Very Nice!" : "Watch", UIControlState.Normal); UIView.Animate(0.3f, () => WatchButton.BackgroundColor = color); Alert(); }; }
private void StarCodeHub() { _shouldStar = !_shouldStar; DefaultValueService.Instance.Set("SHOULD_STAR_CODEHUB", _shouldStar); var color = _shouldStar ? UIColor.FromRGB(0xbd, 0xc3, 0xc7) : UIColor.FromRGB(0x2c, 0x3e, 0x50); StarButton.SetTitle(_shouldStar ? "Good Choice!" : "Star", UIControlState.Normal); UIView.Animate(0.3f, () => StarButton.BackgroundColor = color); Alert(); }
private void StarCodeHub() { _shouldStar = !_shouldStar; Core.Settings.ShouldStar = _shouldStar; var color = _shouldStar ? UIColor.FromRGB(0xbd, 0xc3, 0xc7) : UIColor.FromRGB(0x2c, 0x3e, 0x50); StarButton.SetTitle(_shouldStar ? "Good Choice!" : "Star", UIControlState.Normal); UIView.Animate(0.3f, () => StarButton.BackgroundColor = color); Alert(); }