Exemplo n.º 1
0
        private void SetupClickListeners(View root)
        {
            // add workout button on click
            root.FindViewById <Button>(Resource.Id.add_workout_btn).Click += delegate
            {
                // collapse previously expanded item
                for (int i = 0; i < RecyclerViewData.Count; i++)
                {
                    if (RecyclerViewData[i].expanded)
                    {
                        RecyclerViewData[i].expanded = false;
                        AdapterHome.NotifyItemChanged(i);
                    }
                }
                RecyclerViewData.Add(new WorkoutItem()
                {
                    editMode = true
                });
                AdapterHome.NotifyDataSetChanged();
            };

            // left/right arrows in actionbar
            root.FindViewById <ImageButton>(Resource.Id.left_arrow_btn).Click  += delegate(object sender, EventArgs e){ ToolBarArrowsClickListener(sender, e, 0); };
            root.FindViewById <ImageButton>(Resource.Id.right_arrow_btn).Click += delegate(object sender, EventArgs e) { ToolBarArrowsClickListener(sender, e, 1); };
        }
Exemplo n.º 2
0
 private void OnItemClick(object sender, int position)
 {
     if (RecyclerViewData[position].expanded)
     {
         RecyclerViewData[position].expanded = false;
     }
     else
     {
         RecyclerViewData[position].expanded = true;
     }
     AdapterHome.NotifyItemChanged(position);
 }