Beispiel #1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View view = convertView;

            if (view == null)
            {
                view = context.LayoutInflater.Inflate(
                    Resource.Layout.ActiveBetRow, parent, false);
            }

            Team team = this[position];

            view.FindViewById <TextView>(Resource.Id.team).Text      = team.Name;
            view.FindViewById <TextView>(Resource.Id.activeBet).Text = team.Bet;
            TextView lastBet = view.FindViewById <TextView>(Resource.Id.lastBet);


            List <BetDetails> betDetails = AWSDataAccess.GetBetDetailsByTeamId(team.Id);

            if (betDetails.Count > 0)
            {
                lastBet.Text = AWSDataAccess.DoFormat(betDetails[betDetails.Count - 1].Quantity);
                //
            }


            //Button nextBet = view.FindViewById<Button>(Resource.Id.nextBet);

            //nextBet.Click += delegate { nextBet.Text = string.Format("{0}!", team.Id); }; ;

            return(view);
        }
Beispiel #2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View view = convertView;

            if (view == null)
            {
                view = context.LayoutInflater.Inflate(
                    Resource.Layout.ClosedBetRow, parent, false);
            }

            Team team = this[position];

            view.FindViewById <TextView>(Resource.Id.closedBetTeam).Text = team.Name;
            view.FindViewById <TextView>(Resource.Id.closedBet).Text     = team.Bet;
            view.FindViewById <TextView>(Resource.Id.win).Text           = AWSDataAccess.DoFormat(team.Win);
            //Button nextBet = view.FindViewById<Button>(Resource.Id.nextBet);

            //nextBet.Click += delegate { nextBet.Text = string.Format("{0}!", team.Id); }; ;

            return(view);
        }
Beispiel #3
0
        private void BetTeamsSpinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            //this.progressDialog = ProgressDialog.Show(Activity, "", "Loading bet", true);
            //progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
            //progressDialog.Show();

            #region With Progress Dialog
            if (activeBetTeams.Count > 0)
            {
                this.betDetails = AWSDataAccess.GetBetDetailsByTeamId(
                    activeBetTeams[e.Position].Id);
                if (betDetails.Count > 0)
                {
                    lastBet.Text = AWSDataAccess.DoFormat(betDetails
                                                          [betDetails.Count - 1].Quantity);
                    //Activity.RunOnUiThread(() =>
                    //{
                    //});

                    betType.Text = activeBetTeams[e.Position].Bet;

                    //Activity.RunOnUiThread(() =>
                    //{

                    //});
                }
            }
            #endregion

            //new Thread(new ThreadStart(delegate
            //{

            //    if (activeBetTeams.Count > 0)
            //    {
            //        List<BetDetails> betDetails = AWSDataAccess.GetBetDetailsByTeamId(
            //            activeBetTeams[e.Position].Id);
            //        if (betDetails.Count > 0)
            //        {
            //            Activity.RunOnUiThread(() =>
            //            {
            //                lastBet.Text = AWSDataAccess.DoFormat(betDetails
            //                    [betDetails.Count - 1].Quantity);
            //            });

            //            Activity.RunOnUiThread(() =>
            //            {
            //                betType.Text = activeBetTeams[e.Position].Bet;
            //            });
            //        }
            //    }

            //    Thread.Sleep(10);
            //    progressDialog.Dismiss();


            //})).Start();

            //if (Interlocked.CompareExchange(ref running,1,0)==0)
            //{

            //}
        }