private void RewardCommitResponse(RewardResponseModel rewardResponse) { Action onSubmmitCompleted = (() => { RestoreRewardButtonState(); }); if (rewardResponse != null) { if (rewardResponse.RewardAction == "UPDATE" && rewardResponse.UpdatedReward != null) { this.Reward = rewardResponse.UpdatedReward; Refresh(); } if (rewardResponse.ResponseCode > 0 && string.IsNullOrEmpty(rewardResponse.ResponseMessage)) { AddButtonTapGreenAnimation(() => { var overlay = Platform.AddOverlay(UIApplication.SharedApplication.KeyWindow.Frame, Colors.RewardsGreenAnimationCircleColor, true); SubmitComplete(RewardButton, rewardResponse, onSubmmitCompleted); RewardCompleteView rewardComplete = RewardCompleteView.Create(); rewardComplete.onViewClosed += RestoreRewardButtonState; overlay.AddSubview(rewardComplete); RewardButton.SetBackgroundImage(UIImage.FromBundle("claim-btn_success"), UIControlState.Normal); lblClaimIt.Text = string.Empty; lblPointsButtonText.Text = "Claimed"; rewardComplete.Update(overlay, rewardResponse, Reward, this); }); return; } //if (Overlay != null) //{ AddButtonTapRedAnimation(() => { var overlay = Platform.AddOverlay(UIApplication.SharedApplication.KeyWindow.Frame, Colors.RewardsRedAnimationCircleColor, true); SubmitComplete(RewardButton, rewardResponse, onSubmmitCompleted); RewardCompleteView rewardComplete = RewardCompleteView.Create(); rewardComplete.onViewClosed += RestoreRewardButtonState; overlay.AddSubview(rewardComplete); RewardButton.SetBackgroundImage(UIImage.FromBundle("claim-btn_fail"), UIControlState.Normal); lblClaimIt.Text = string.Empty; lblPointsButtonText.Text = "Didn't Get"; LockImage.Hidden = true; rewardComplete.Update(overlay, rewardResponse, Reward, this); }); //} } }
public static RewardCompleteView Create() { var arr = NSBundle.MainBundle.LoadNib("RewardCompleteView", null, null); RewardCompleteView view = arr.Count > 0 ? arr.GetItem <RewardCompleteView>(0) : null; view.TableView.AllowsSelection = false; view.TableView.ScrollEnabled = false; view.TableView.RegisterNibForCellReuse(FeedTableViewCell.Nib, FeedTableViewCell.ClassName); //view.TableView.RegisterNibForCellReuse(MasterFeedTableViewCell.Nib, MasterFeedTableViewCell.ClassName); view.TableView.Source = new FeedTableSource(view.TableView); view.TableView.RowHeight = UITableView.AutomaticDimension; view.TableView.EstimatedRowHeight = 130.0f; //view.TableView.SeparatorColor = UIColor.Clear; view.TableView.Layer.BorderWidth = 0; view.TableView.Layer.BorderColor = new CoreGraphics.CGColor(0, 0, 0, 0);//UIColor.Clear; view.Layer.CornerRadius = 4.0f; view.TableView.ReloadData(); return(view); }
public NavDelegate(RewardCompleteView viewController) { rewardCompleteView = viewController; }