public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; recyclerViewHolder.account_to_display.Text = mList[position].AccountToDisplay; recyclerViewHolder.account_type.Text = mList[position].AccountType; recyclerViewHolder.currency_account_summary.Text = mList[position].CurrencySymbol; if (mList[position].AmountSystem > 0) { recyclerViewHolder.amount_system.SetTextColor(Android.Graphics.Color.ParseColor("#7bb89c")); recyclerViewHolder.currency_account_summary.SetTextColor(Android.Graphics.Color.ParseColor("#7bb89c")); } else if (mList[position].AmountSystem < 0) { recyclerViewHolder.amount_system.SetTextColor(Android.Graphics.Color.Red); recyclerViewHolder.currency_account_summary.SetTextColor(Android.Graphics.Color.Red); } else { recyclerViewHolder.amount_system.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.currency_account_summary.SetTextColor(Android.Graphics.Color.Blue); } recyclerViewHolder.amount_system.Text = mList[position].AmountSystem.ToString("#,##0.00"); recyclerViewHolder.as_btn.Click += delegate { Intent asd = new Intent(mContext, typeof(AccountSummaryDetailsActivity)); asd.PutExtra("account", mList[position].Account); mContext.StartActivity(asd); }; }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; recyclerViewHolder.ovl_ps.SetTextColor(Android.Graphics.Color.Red); double total_assets = mItems[position].LongPosition + mItems[position].ShortPosition; recyclerViewHolder.total_assets_ps.Text = total_assets.ToString("#,##0.00"); recyclerViewHolder.net_cash_amount_balances_ps.Text = mItems[position].NetBalance.ToString("#,##0.00"); recyclerViewHolder.initial_margin_ps.Text = mItems[position].Margin.ToString("#,##0.00"); recyclerViewHolder.maintenance_margin_ps.Text = mItems[position].MarginMC.ToString("#,##0.00"); recyclerViewHolder.net_asset_value_ps.Text = mItems[position].NetAssetValue.ToString("#,##0.00"); recyclerViewHolder.ovl_ps.Text = mItems[position].OVL ?? ""; recyclerViewHolder.total_assets_btn.Click += delegate { Intent assetAllocation = new Intent(mContext, typeof(AssetAllocationActivity)); mContext.StartActivity(assetAllocation); }; recyclerViewHolder.net_cash_balance_btn.Click += delegate { Intent accountSummary = new Intent(mContext, typeof(AccountSummaryActivity)); mContext.StartActivity(accountSummary); }; recyclerViewHolder.total_assets_layout.Click += delegate { Intent assetAllocation = new Intent(mContext, typeof(AssetAllocationActivity)); mContext.StartActivity(assetAllocation); }; recyclerViewHolder.net_cash_balance_layout.Click += delegate { Intent accountSummary = new Intent(mContext, typeof(AccountSummaryActivity)); mContext.StartActivity(accountSummary); }; }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { int resourceLayout = Resource.Layout.recyclerview_card_dot_layout; View row = LayoutInflater.From(parent.Context).Inflate(resourceLayout, parent, false); RecyclerViewHolder recyclerViewHolder = new RecyclerViewHolder(row, OnClick); return(recyclerViewHolder); }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { int layoutResource = Resource.Layout.recyclerview_account_summary_layout; View row = LayoutInflater.From(parent.Context).Inflate(layoutResource, parent, false); RecyclerViewHolder recyclerViewHolder = new RecyclerViewHolder(row, OnClick); return(recyclerViewHolder); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; if (position % 2 == 1) { recyclerViewHolder.desc_security_odd.Text = mItems[position].SecuritySubTypeDesc; recyclerViewHolder.balance_system_security_odd.Text = mItems[position].BalanceSystem.ToString("#,##0.00"); recyclerViewHolder.weight_security_odd.Text = mItems[position].WeightPerc.ToString("#0.00") + "%"; if (Convert.ToInt16(mItems[position].SecuritySubTypeCode) <= 0) { recyclerViewHolder.details_security_btn_odd.Visibility = ViewStates.Invisible; recyclerViewHolder.desc_security_odd.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.balance_system_security_odd.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.weight_security_odd.SetTextColor(Android.Graphics.Color.Blue); } //recyclerViewHolder.details_security_btn_odd.Click += delegate //{ // if (Convert.ToInt16(mItems[position].SecuritySubTypeCode) > 0) // { // Intent details = new Intent(mContext, typeof(AssetAllocationDetailsActivity)); // details.PutExtra("assetcode", mItems[position].SecuritySubTypeCode); // details.PutExtra("webclicode", mUser.WebCliCode); // details.PutExtra("clicode", mUser.CliCode); // details.PutExtra("description", mItems[position].SecuritySubTypeDesc); // mContext.StartActivity(details); // } //}; } else { recyclerViewHolder.desc_security_even.Text = mItems[position].SecuritySubTypeDesc; recyclerViewHolder.balance_system_security_even.Text = mItems[position].BalanceSystem.ToString("#,##0.00"); recyclerViewHolder.weight_security_even.Text = mItems[position].WeightPerc.ToString("#0.00") + "%"; if (Convert.ToInt16(mItems[position].SecuritySubTypeCode) <= 0) { recyclerViewHolder.details_security_btn_even.Visibility = ViewStates.Invisible; recyclerViewHolder.desc_security_even.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.balance_system_security_even.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.weight_security_even.SetTextColor(Android.Graphics.Color.Blue); } //recyclerViewHolder.details_security_btn_even.Click += delegate //{ // if (Convert.ToInt16(mItems[position].SecuritySubTypeCode) > 0) // { // Intent details = new Intent(mContext, typeof(AssetAllocationDetailsActivity)); // details.PutExtra("assetcode", mItems[position].SecuritySubTypeCode); // details.PutExtra("webclicode", mUser.WebCliCode); // details.PutExtra("clicode", mUser.CliCode); // details.PutExtra("description", mItems[position].SecuritySubTypeDesc); // mContext.StartActivity(details); // } //}; } }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; recyclerViewHolder.transaction_date_dot.Text = mItems[position].TransactionDate.HasValue ? mItems[position].TransactionDate.Value.ToString("dd/MM/yyyy") : ""; recyclerViewHolder.buy_sell_dot.Text = mItems[position].BuySell; recyclerViewHolder.quantity_dot.Text = mItems[position].Quantity.ToString("#,##0.00"); recyclerViewHolder.security_name_dot.Text = mItems[position].SecurityName; recyclerViewHolder.open_price_dot.Text = mItems[position].OpenPrice.ToString("#,##0.00"); recyclerViewHolder.net_amount_dot.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.net_amount_dot.Text = mItems[position].NetAmount.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; if (position % 2 == 1) { recyclerViewHolder.asset_description_odd.Text = mItems[position].AssetDescription; recyclerViewHolder.balance_odd.Text = mItems[position].Balance.ToString("#,##0.00"); recyclerViewHolder.weight_percentage_odd.Text = mItems[position].Weight.ToString("#0.00") + "%"; if (Convert.ToInt16(mItems[position].Code) <= 0) { recyclerViewHolder.details_btn_odd.Visibility = ViewStates.Invisible; recyclerViewHolder.asset_description_odd.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.balance_odd.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.weight_percentage_odd.SetTextColor(Android.Graphics.Color.Blue); } recyclerViewHolder.details_btn_odd.Click += delegate { if (Convert.ToInt16(mItems[position].Code) > 0) { Intent details = new Intent(mContext, typeof(AssetAllocationDetailsActivity)); details.PutExtra("assetcode", mItems[position].Code); details.PutExtra("webclicode", mUser.WebCliCode); details.PutExtra("clicode", mUser.CliCode); details.PutExtra("description", mItems[position].AssetDescription); mContext.StartActivity(details); } }; } else { recyclerViewHolder.asset_description_even.Text = mItems[position].AssetDescription; recyclerViewHolder.balance_even.Text = mItems[position].Balance.ToString("#,##0.00");; recyclerViewHolder.weight_percentage_even.Text = mItems[position].Weight.ToString("#0.00") + "%"; if (Convert.ToInt16(mItems[position].Code) <= 0) { recyclerViewHolder.details_btn_even.Visibility = ViewStates.Invisible; recyclerViewHolder.asset_description_even.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.balance_even.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.weight_percentage_even.SetTextColor(Android.Graphics.Color.Blue); } recyclerViewHolder.details_btn_even.Click += delegate { if (Convert.ToInt16(mItems[position].Code) > 0) { Intent details = new Intent(mContext, typeof(AssetAllocationDetailsActivity)); details.PutExtra("assetcode", mItems[position].Code); details.PutExtra("webclicode", mUser.WebCliCode); details.PutExtra("clicode", mUser.CliCode); details.PutExtra("description", mItems[position].AssetDescription); mContext.StartActivity(details); } }; } }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; recyclerViewHolder.quantity_closed_pl.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.estimated_pl.SetTextColor(Android.Graphics.Color.Blue); recyclerViewHolder.close_price_pl.SetTextColor(Android.Graphics.Color.Red); recyclerViewHolder.open_price_pl.SetTextColor(Android.Graphics.Color.ParseColor("#7bb89c")); recyclerViewHolder.closed_date_pl.Text = mItems[position].ClosedDate.HasValue ? mItems[position].ClosedDate.Value.ToString("dd/MM/yyyy") : ""; recyclerViewHolder.opened_date_pl.Text = mItems[position].OpenedDate.HasValue ? mItems[position].OpenedDate.Value.ToString("dd/MM/yyyy") : ""; recyclerViewHolder.close_bs_pl.Text = mItems[position].CloseBS; recyclerViewHolder.open_bs_pl.Text = mItems[position].OpenBS; recyclerViewHolder.security_name_pl.Text = mItems[position].SecurityName; recyclerViewHolder.quantity_closed_pl.Text = mItems[position].QuantityClosed.ToString("#,##0.00"); recyclerViewHolder.close_price_pl.Text = mItems[position].ClosePrice.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; recyclerViewHolder.open_price_pl.Text = mItems[position].OpenPrice.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; recyclerViewHolder.estimated_pl.Text = mItems[position].EstimatedProfitLoss.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { int layoutResource = 0; switch (viewType) { case 0: layoutResource = Resource.Layout.recyclerview_card_aa_even_layout; break; case 1: layoutResource = Resource.Layout.recyclerview_card_aa_odd_layout; break; } View row = LayoutInflater.From(parent.Context).Inflate(layoutResource, parent, false); RecyclerViewHolder recyclerViewHolder = new RecyclerViewHolder(row, OnClick); return(recyclerViewHolder); }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; recyclerViewHolder.security.Text = mItems[position].SecurityName; recyclerViewHolder.isin_all_details.Text = mItems[position].ISIN; recyclerViewHolder.qty.Text = mItems[position].Quantity.ToString("#,##0.0000"); recyclerViewHolder.maturity_date.Text = mItems[position].DateMaturity.ToString(); recyclerViewHolder.currency.Text = mItems[position].CurrencySymbol; recyclerViewHolder.market_price.Text = mItems[position].Price.ToString("#,##0.00"); recyclerViewHolder.average_price.Text = mItems[position].AveragePrice.ToString("#,##0.00"); recyclerViewHolder.unrealised_pl.Text = mItems[position].UnrealizedPnl.ToString("#,##0.00"); recyclerViewHolder.unrealised_pl_usd.Text = mItems[position].UnrealizedPnlUSD.ToString("#,##0.00"); recyclerViewHolder.gain_loss.Text = mItems[position].GainLoss.ToString("#,##0.00"); recyclerViewHolder.total_value.Text = mItems[position].Balance.ToString("#,##0.00"); recyclerViewHolder.total_value_usd.Text = mItems[position].BalanceSystem.ToString("#,##0.00"); recyclerViewHolder.weight_all_details.Text = mItems[position].Weight.ToString("#0.00") + "%"; recyclerViewHolder.accued_interest.Text = mItems[position].AccruedInterest.ToString("#,##0.00"); }
public override void OnBindViewHolder(ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; recyclerViewHolder.transaction_date.Text = mItems[position].TransactionDate.HasValue ? mItems[position].TransactionDate.Value.ToString("dd/MM/yyyy") : ""; recyclerViewHolder.due_date.Text = mItems[position].DueDate.HasValue ? mItems[position].DueDate.Value.ToString("dd/MM/yyyy") : ""; recyclerViewHolder.transaction_description.Text = mItems[position].TrnsDesc; recyclerViewHolder.balance.SetTextColor(Android.Graphics.Color.Blue); if (mItems[position].DBCR.Equals("D")) { recyclerViewHolder.dbcr_amount.Text = "-" + mItems[position].DbAmount.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; recyclerViewHolder.dbcr_amount.SetTextColor(Android.Graphics.Color.Red); balance = balance - mItems[position].DbAmount; recyclerViewHolder.balance.Text = balance.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; } else if (mItems[position].DBCR.Equals("C")) { recyclerViewHolder.dbcr_amount.Text = mItems[position].CrAmount.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; recyclerViewHolder.dbcr_amount.SetTextColor(Android.Graphics.Color.ParseColor("#7bb89c")); balance = balance + mItems[position].CrAmount; recyclerViewHolder.balance.Text = balance.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; } else if (mItems[position].DBCR.Equals("P")) { recyclerViewHolder.dbcr_amount.Text = string.Empty; if (mItems[position].CrAmount == 0 && mItems[position].DbAmount == 0) { balance = mItems[position].DbAmount; recyclerViewHolder.balance.Text = balance.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; } else if (mItems[position].CrAmount == 0) { balance = mItems[position].DbAmount; recyclerViewHolder.balance.Text = balance.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; } else if (mItems[position].DbAmount == 0) { balance = mItems[position].CrAmount; recyclerViewHolder.balance.Text = balance.ToString("#,##0.00") + " " + mItems[position].CurrencySymbol; } } }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { RecyclerViewHolder recyclerViewHolder = holder as RecyclerViewHolder; if (position % 2 == 1) { recyclerViewHolder.tit_nom_odd.Text = mItemsPosition[position].SecurityName; recyclerViewHolder.isin_odd.Text = mItemsPosition[position].ISIN; recyclerViewHolder.sumqty_odd.Text = mItemsPosition[position].Quantity.ToString("#,##0.0000"); recyclerViewHolder.pos_bal_sys_tot_usd_details_odd.Text = mItemsPosition[position].BalanceSystem.ToString("#,##0.00"); recyclerViewHolder.weight_odd.Text = mItemsPosition[position].Weight.ToString("#0.00") + "%"; recyclerViewHolder.all_details_btn_odd.Click += delegate { Intent all_details = new Intent(mContext, typeof(AllDetailsActivity)); all_details.PutExtra("tit_cod", mItemsPosition[position].SecurityCode); all_details.PutExtra("webclicode", mUser.WebCliCode); all_details.PutExtra("clicode", mUser.CliCode); all_details.PutExtra("assetcode", mAsset_code); all_details.PutExtra("description", mTitle); mContext.StartActivity(all_details); }; } else { recyclerViewHolder.tit_nom_even.Text = mItemsPosition[position].SecurityName; recyclerViewHolder.isin_even.Text = mItemsPosition[position].ISIN; recyclerViewHolder.sumqty_even.Text = mItemsPosition[position].Quantity.ToString("#,##0.0000"); recyclerViewHolder.pos_bal_sys_tot_usd_details_even.Text = mItemsPosition[position].BalanceSystem.ToString("#,##0.00"); recyclerViewHolder.weight_even.Text = mItemsPosition[position].Weight.ToString("#0.00") + "%"; recyclerViewHolder.all_details_btn_even.Click += delegate { Intent all_details = new Intent(mContext, typeof(AllDetailsActivity)); all_details.PutExtra("tit_cod", mItemsPosition[position].SecurityCode); all_details.PutExtra("webclicode", mUser.WebCliCode); all_details.PutExtra("clicode", mUser.CliCode); all_details.PutExtra("assetcode", mAsset_code); all_details.PutExtra("description", mTitle); mContext.StartActivity(all_details); }; } }