Exemple #1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View       workoutView = inflater.Inflate(Resource.Layout.log_workout, parent, false);
            ViewHolder holder      = new WorkoutViewHolder(workoutView);

            return(holder);
        }
Exemple #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            WorkoutViewHolder myHolder = holder as WorkoutViewHolder;

            myHolder.tvWorkoutTitle.Text = workout_list.ElementAt(position).Name;

            List <ExerciseSets> exerciseSets = handler.GetExercisesNSetsWorkout(workout_list.ElementAt(position).Id);

            if (exerciseSets.Count > 0)
            {
                myHolder.rvExercises.SetLayoutManager(new LinearLayoutManager(myHolder.rvExercises.Context));
                myHolder.rvExercises.SetAdapter(new ExerciseNSetsAdapter(myHolder.rvExercises.Context, exerciseSets));
            }
        }