public override View GetView(int position, View convertView, ViewGroup parent) { var view = convertView; var item = items[position]; if (view == null) { view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.adapter_list_todoke, parent, false); } view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.adapter_list_todoke, parent, false); view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_time).Text = item.nohin_yti_time; view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_tenpoName).Text = item.tokuisaki_rk; view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_berth).Text = item.kansen_kbn; string sumi = item.Qty.Substring(0, 7); string kei = item.Qty.Substring(7, 7); string mate = item.Qty.Substring(14, 7); view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_per).Text = int.Parse(sumi).ToString() + "/" + int.Parse(kei).ToString(); BootstrapProgressBar pgBar = view.FindViewById <BootstrapProgressBar>(Resource.Id.txt_adp_todoke_progressbar); pgBar.Progress = Convert.ToInt32((double.Parse(sumi) / double.Parse(kei)) * 100); pgBar.SetBootstrapSize(DefaultBootstrapSize.Xl); return(view); }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = convertView; VendorAdapterViewHolder holder = null; if (view != null) { holder = view.Tag as VendorAdapterViewHolder; } if (holder == null) { holder = new VendorAdapterViewHolder(); var item = vendorList[position]; view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.adapter_list_vendor, parent, false); view.FindViewById <TextView>(Resource.Id.nyukaTime).Text = item.ven_yti_time; view.FindViewById <TextView>(Resource.Id.vendorName).Text = item.vendor_nm; string sumi = item.kosu_sumi; string kei = item.kosu_kei; view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_per).Text = int.Parse(sumi).ToString() + "/" + int.Parse(kei).ToString(); BootstrapProgressBar pgBar = view.FindViewById <BootstrapProgressBar>(Resource.Id.txt_adp_todoke_progressbar); pgBar.Progress = Convert.ToInt32((double.Parse(sumi) / double.Parse(kei)) * 100); } return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var groupAdd = FindViewById <BootstrapProgressBarGroup>(Resource.Id.example_progress_bar_group_add_group); var groupRound = FindViewById <BootstrapProgressBarGroup>(Resource.Id.example_progress_bar_group_round_group); var bootstrapProgressBar1 = FindViewById <BootstrapProgressBar>(Resource.Id.example_progress_bar_group_progress_1); var bootstrapProgressBar2 = FindViewById <BootstrapProgressBar>(Resource.Id.example_progress_bar_group_progress_2); FindViewById <Button>(Resource.Id.example_progress_bar_group_add).SetOnClickListener(new Utils.ViewOnClick(v => { Random rand = new Random(); BootstrapProgressBar bar = new BootstrapProgressBar(this) { Progress = 10 }; int brand = 5; while (brand == 5) { brand = rand.Next(7); } bar.BootstrapBrand = DefaultBootstrapBrand.FromAttributeValue(brand); if (groupAdd.CumulativeProgress + 10 <= 100) { groupAdd.AddView(bar); } else { groupAdd.RemoveViews(2, groupAdd.ChildCount - 3); } })); FindViewById <Button>(Resource.Id.example_progress_bar_group_round).SetOnClickListener(new Utils.ViewOnClick(v => { groupRound.Rounded = !rounded; })); FindViewById <Button>(Resource.Id.example_progress_bar_group_progress).SetOnClickListener(new Utils.ViewOnClick(v => { Random rand = new Random(); int progress = rand.Next(30) + 10; switch (rand.Next(2)) { case 0: bootstrapProgressBar1.Progress = progress; break; case 1: bootstrapProgressBar2.Progress = progress; break; } })); }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = convertView; var item = items[position]; if (view == null) { view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.adapter_list_todoke, parent, false); } view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.adapter_list_todoke, parent, false); view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_time).Text = item.tsumikomi_yti_time; view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_tenpoName).Text = item.tokuisaki_rk; view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_berth).Text = item.berth; view.FindViewById <TextView>(Resource.Id.txt_adp_todoke_per).Text = item.kosu_sumi + "/" + item.kosu_kei; BootstrapProgressBar pgBar = view.FindViewById <BootstrapProgressBar>(Resource.Id.txt_adp_todoke_progressbar); pgBar.Progress = Convert.ToInt32((double.Parse(item.kosu_sumi) / double.Parse(item.kosu_kei)) * 100); return(view); }
/// <summary> /// Create a animated progress bar /// </summary> /// <param name="bar">Progress bar to be converted</param> /// <returns>An animated progress bar</returns> public static BootstrapProgressBar AsAnimated(this BootstrapProgressBar bar) { bar["class"] += " progress-striped active"; return(bar); }
/// <summary> /// Create a striped progress bar /// </summary> /// <param name="bar">Progress bar to be converted</param> /// <returns>A striped progress bar</returns> public static BootstrapProgressBar AsStriped(this BootstrapProgressBar bar) { bar["class"] += " progress-striped"; return(bar); }