// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { ModelloadData modelData = mModelloadDataList[position]; var viewHolder = holder as AdapteMultipleEstimatesViewHolder; TextView tvEstimateName = viewHolder.tvEstimateName; TextView tvEstimateAmount = viewHolder.tvEstimateAmount; RadioButton radiobutton = viewHolder.radiobutton; UIHelper.SetTextViewFont(tvEstimateName, (int)UIHelper.LinotteFont.LinotteSemiBold, mContext.Assets); UIHelper.SetTextViewFont(tvEstimateAmount, (int)UIHelper.LinotteFont.LinotteSemiBold, mContext.Assets); tvEstimateName.Text = modelData.EstimteNo; if (!string.IsNullOrEmpty(modelData.EstimateAmount)) { tvEstimateAmount.Text = modelData.EstimateAmount; } else { tvEstimateAmount.Text = "$000.00"; } if (!string.IsNullOrEmpty(UIHelper.SelectedMoveNumber) && modelData.EstimteNo == UIHelper.SelectedMoveNumber) { radiobutton.Checked = true; } else { radiobutton.Checked = false; } }
/// <summary> /// Event Name : OnIRadiobuttonActionClick /// Author : Sanket Prajapati /// Creation Date : 2 Dec 2017 /// Purpose : Use for set radio button check or uncheck and set single estimate id /// Revision : /// </summary> public void OnIRadiobuttonActionClick(int position) { if (modelloadDatalist.Count > 0) { ModelloadData modaldata = modelloadDatalist[position]; UIHelper.SelectedMoveNumber = modaldata.EstimteNo; SetAdapter(); } }
public bool OnItemMove(int oldPosition, int newPosition) { ModelloadData oldModelDummyData = mModelloadDataList[oldPosition]; ModelloadData newModelDummyData = new ModelloadData(oldModelDummyData.title, oldModelDummyData.subTitle); mModelloadDataList.Remove(oldModelDummyData); mModelloadDataList.Insert(newPosition, newModelDummyData); NotifyItemMoved(oldPosition, newPosition); return(true); }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { ModelloadData modelDummyData = mModelloadDataList[position]; var viewHolder = holder as AdapterDashboardViewHolder; viewHolder.mTextViewTitle.Text = modelDummyData.title; UIHelper.SetTextViewFont(viewHolder.mTextViewTitle, (int)UIHelper.LinotteFont.LinotteSemiBold, mContext.Assets); if (position == 0) { List <ModelloadData> mModelDummyDataServiceList = (List <ModelloadData>)modelDummyData.mObject; for (int i = 0; i < mModelDummyDataServiceList.Count; i++) { LayoutInflater vi = (LayoutInflater)mContext.GetSystemService(Context.LayoutInflaterService); View v = vi.Inflate(Resource.Layout.row_dashboard_my_service, null); viewHolder.mLinearLayoutDescription.Visibility = ViewStates.Gone; ImageView mImageViewIcon = v.FindViewById <ImageView>(Resource.Id.imageViewIcon); TextView mTextViewServiceName = v.FindViewById <TextView>(Resource.Id.textViewServiceName); UIHelper.SetTextViewFont(mTextViewServiceName, (int)UIHelper.LinotteFont.LinotteRegular, mContext.Assets); mTextViewServiceName.Text = mModelDummyDataServiceList[i].title; SetServiceIconAndName(mModelDummyDataServiceList[i].title, mImageViewIcon, mTextViewServiceName); viewHolder.mGridLayout.AddView(v); } } else if (position == 1) { ModelloadData mModelDummyDataMatters = (ModelloadData)modelDummyData.mObject; LayoutInflater vi = (LayoutInflater)mContext.GetSystemService(Context.LayoutInflaterService); View v = vi.Inflate(Resource.Layout.row_dashboard_my_service, null); ImageView mImageViewIcon = v.FindViewById <ImageView>(Resource.Id.imageViewIcon); TextView mTextViewServiceName = v.FindViewById <TextView>(Resource.Id.textViewServiceName); UIHelper.SetTextViewFont(mTextViewServiceName, (int)UIHelper.LinotteFont.LinotteRegular, mContext.Assets); viewHolder.mImageViewTitleIcon.SetImageResource(Resource.Drawable.icon_whm); mTextViewServiceName.Text = mModelDummyDataMatters.title; mTextViewServiceName.SetLines(5); mImageViewIcon.Visibility = ViewStates.Gone; viewHolder.mLinearLayoutDescription.AddView(v); } else { List <ModelloadData> mModelDummyDataValuationList = (List <ModelloadData>)modelDummyData.mObject; for (int i = 0; i < mModelDummyDataValuationList.Count; i++) { LayoutInflater vi = (LayoutInflater)mContext.GetSystemService(Context.LayoutInflaterService); View v = vi.Inflate(Resource.Layout.row_dashboard_valuation, null); TextView mTextViewKey = v.FindViewById <TextView>(Resource.Id.textViewKey); TextView mTextViewValue = v.FindViewById <TextView>(Resource.Id.textViewValue); viewHolder.mImageViewTitleIcon.SetImageResource(Resource.Drawable.icon_Dashboard_valuation); UIHelper.SetTextViewFont(mTextViewValue, (int)UIHelper.LinotteFont.LinotteRegular, mContext.Assets); UIHelper.SetTextViewFont(mTextViewKey, (int)UIHelper.LinotteFont.LinotteRegular, mContext.Assets); mTextViewKey.Text = mModelDummyDataValuationList[i].title; mTextViewValue.Text = mModelDummyDataValuationList[i].value; viewHolder.mLinearLayoutDescription.AddView(v); } } }