コード例 #1
0
        protected override RecyclerView.ViewHolder CreateSectionHeaderViewHolder(ViewGroup parent)
        {
            var sectionHeaderTextView = RecyclerViewAdapter.CreateTextView(parent);

            sectionHeaderTextView.SetBackgroundColor(Color.LightBlue);
            sectionHeaderTextView.TextAlignment = TextAlignment.Center;

            return(new ViewHolder(sectionHeaderTextView));
        }
コード例 #2
0
        protected override RecyclerView.ViewHolder CreateItemViewHolder(ViewGroup parent)
        {
            var itemTextView = RecyclerViewAdapter.CreateTextView(parent);
            var viewHolder   = new ViewHolder(itemTextView);

            itemTextView.Click += (sender, e) =>
            {
                this.AddNewRow(viewHolder.Section);
            };

            return(viewHolder);
        }
コード例 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            var recyclerView  = this.FindViewById <RecyclerView>(Resource.Id.RecyclerView);
            var adapter       = new RecyclerViewAdapter();
            var layoutManager = new LinearLayoutManager(this);

            recyclerView.SetAdapter(adapter);
            recyclerView.SetLayoutManager(layoutManager);
        }