Example #1
0
 public override nfloat GetHeightForRow(UITableView tableView, Foundation.NSIndexPath indexPath)
 {
     if (indexPath.Section == 0)
     {
         if (!HasLiveMatch)
         {
             return(40);
         }
         else
         {
             if (LiveIndexes.Contains(indexPath.Row))
             {
                 return(40);
             }
             return(120);
         }
     }
     else
     {
         if (!HasSoonMatch)
         {
             return(40);
         }
         else
         {
             if (SoonIndexes.Contains(indexPath.Row))
             {
                 return(40);
             }
             return(120);
         }
     }
 }
Example #2
0
        public override void PrepareForSegue(UIStoryboardSegue segue, Foundation.NSObject sender)
        {
            switch (segue.Identifier)
            {
            case "MatchFromActual":

                var vc = segue.DestinationViewController as MatchViewController;

                if (TableView.IndexPathForSelectedRow.Section == 0)
                {
                    vc.Match = LiveMatches.ElementAt(TableView.IndexPathForSelectedRow.Row - LiveIndexes.Where(i => i < TableView.IndexPathForSelectedRow.Row).Count());
                }
                else
                {
                    vc.Match = SoonMatches.ElementAt(TableView.IndexPathForSelectedRow.Row - SoonIndexes.Where(i => i < TableView.IndexPathForSelectedRow.Row).Count());
                }

                break;


            default:
                break;
            }
        }
Example #3
0
        public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
        {
            if ((indexPath.Section == 0 && !HasLiveMatch) || (indexPath.Section == 1 && !HasSoonMatch))
            {
                var cell = tableView.DequeueReusableCell("NoMatchCell");

                cell.BackgroundColor = UIColor.Clear.FromHex(LightGreen.hex);

                return(cell);
            }


            Match match;
            Team  homeTeam;
            Team  awayTeam;

            if (indexPath.Section == 0)
            {
                if (LiveIndexes.Contains(indexPath.Row))
                {
                    return(CreateLeagueNameCell(tableView, indexPath, LiveIndexes));
                }
                else
                {
                    LiveMatchCell cell = tableView.DequeueReusableCell("LiveMatchCell", indexPath) as LiveMatchCell;

                    cell.BackgroundColor = UIColor.Clear.FromHex(LightGreen.hex);

                    var color = cell.ViewWithTag(500).BackgroundColor;

                    //cell.ViewWithTag(500).BackgroundColor = cell.ViewWithTag(500).BackgroundColor.ColorWithAlpha((float)0.5);r

                    match    = LiveMatches.ElementAt(indexPath.Row - LiveIndexes.Where(i => i < indexPath.Row).Count());
                    homeTeam = LiveTeams.First(t => t.Id == match.HomeTeamId);
                    awayTeam = LiveTeams.First(t => t.Id == match.AwayTeamId);

                    if (match.State == StateEnum.Playing)
                    {
                        AnimateView(cell.ViewWithTag(800), true);
                    }

                    return(CreateActualTile(cell, match, homeTeam, awayTeam));
                }
            }
            else
            {
                if (SoonIndexes.Contains(indexPath.Row))
                {
                    return(CreateLeagueNameCell(tableView, indexPath, SoonIndexes));
                }
                else
                {
                    LiveMatchCell cell = tableView.DequeueReusableCell("LiveMatchCell", indexPath) as LiveMatchCell;

                    cell.BackgroundColor = UIColor.Clear.FromHex(LightGreen.hex);

                    match    = SoonMatches.ElementAt(indexPath.Row - SoonIndexes.Where(i => i < indexPath.Row).Count());
                    homeTeam = SoonTeams.First(t => t.Id == match.HomeTeamId);
                    awayTeam = SoonTeams.First(t => t.Id == match.AwayTeamId);

                    return(CreateActualTile(cell, match, homeTeam, awayTeam));
                }
            }
        }