예제 #1
0
 public override void OnBindViewHolder(v7Widget.RecyclerView.ViewHolder holder, int position)
 {
     RecipeViewHolder vh = holder as RecipeViewHolder;
     Tuple<string, string, int, int, int> tupleInQuestion = mRObject.getObjectInPosition (position);
     string tempLeftText = tupleInQuestion.Item1;
     string tempRightText = tupleInQuestion.Item2;
     this.Recid = tupleInQuestion.Item5;
     if (tupleInQuestion.Item3 == 5) {
         vh.LeftText.SetBackgroundColor (Android.Graphics.Color.Red);
         vh.RightText.SetBackgroundColor (Android.Graphics.Color.Red);
     } else if (tupleInQuestion.Item3 == 4) {
         vh.LeftText.SetBackgroundColor (Android.Graphics.Color.Orange);
         vh.RightText.SetBackgroundColor (Android.Graphics.Color.Orange);
     } else if (tupleInQuestion.Item3 == 3) {
         vh.LeftText.SetBackgroundColor (Android.Graphics.Color.Yellow);
         vh.RightText.SetBackgroundColor (Android.Graphics.Color.Yellow);
     }
       else if (tupleInQuestion.Item3 == 2) {
         vh.LeftText.SetBackgroundColor (Android.Graphics.Color.GreenYellow);
         vh.RightText.SetBackgroundColor (Android.Graphics.Color.GreenYellow);
     } else if (tupleInQuestion.Item3 == 1) {
         vh.LeftText.SetBackgroundColor (Android.Graphics.Color.Green);
         vh.RightText.SetBackgroundColor (Android.Graphics.Color.Green);
     }
     vh.LeftText.Text = tempLeftText;
     vh.RightText.Text = tempRightText;
 }
예제 #2
0
        public void deployRecyclerView(PlannedMealAdapter mAdapter, v7Widget.RecyclerView.LayoutManager mLayoutManager,
			v7Widget.RecyclerView mRecyclerView)
        {
            this.mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView);
            this.mRecyclerView.SetAdapter (mAdapter);
            this.mRecyclerView.SetLayoutManager (mLayoutManager);
        }
예제 #3
0
        public v7Widget.RecyclerView superDeployRecyclerView(PlannedMealAdapter mAdapter, v7Widget.RecyclerView.LayoutManager mLayoutManager,
			v7Widget.RecyclerView mRecyclerView)
        {
            mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView);
            mRecyclerView.SetAdapter (mAdapter);
            mRecyclerView.SetLayoutManager (mLayoutManager);
            return mRecyclerView;
        }
 public override void OnBindViewHolder(v7Widget.RecyclerView.ViewHolder holder, int position)
 {
     SideBySideViewHolder vh = holder as SideBySideViewHolder;
     int realPosition = position * 2;
     int tempLeftImage = mSideBySideObject.getObjectInPosition (realPosition).Item1;
     string tempLeftText = mSideBySideObject.getObjectInPosition (realPosition).Item2;
     int tempRightImage = mSideBySideObject.getObjectInPosition (realPosition + 1).Item1;
     string tempRightText = mSideBySideObject.getObjectInPosition (realPosition + 1).Item2;
     if (tempLeftImage != -1){
         vh.LeftImage.SetImageResource(tempLeftImage);
         vh.LeftText.Text = tempLeftText;
     }
     if (tempRightImage != -1) {
         vh.RightImage.SetImageResource(tempRightImage);
         vh.RightText.Text = tempRightText;
     }
 }
예제 #5
0
 public override void OnBindViewHolder(v7Widget.RecyclerView.ViewHolder holder, int position)
 {
     PlannedMealViewHolder vh = holder as PlannedMealViewHolder;
     Tuple<string, string, string> newTuple = mPMObject.getObjectInPosition (position);
     vh.LeftText.Text = newTuple.Item1;
     vh.MiddleText.Text = newTuple.Item2;
     vh.RightText.Text = newTuple.Item3;
 }