Click here to Skip to main content
15,881,413 members
Articles / Mobile Apps / Android

Sectioned ListView for Android Using Mono C#

Rate me:
Please Sign up or sign in to vote.
4.33/5 (8 votes)
14 Mar 2013CPOL6 min read 39.5K   1.2K   23  
Develop a Preferences style sectioned list adapter using Android Mono C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;

namespace FoodTypeSectionList
{
    public class MeatType
    {
        private String _name, _description;
        private double _price;
        public MeatType() { _name = _description = String.Empty; _price = 0.0; }
        public MeatType(String name, String description, double price) { _name = name; _description = description; _price = price; }
        public String Name { get { return _name; } set { _name = value; } }
        public String Description { get { return _description; } set { _description = value; } }
        public double PricePerPound { get { return _price; } set { _price = value; } }
    }

    public class VegetableType
    {
        private String _name, _description;
        private double _price;
        public VegetableType() { _name = _description = String.Empty; _price = 0.0; }
        public VegetableType(String name, String description, double price) { _name = name; _description = description; _price = price; }
        public String Name { get { return _name; } set { _name = value; } }
        public String Description { get { return _description; } set { _description = value; } }
        public double PricePerPound { get { return _price; } set { _price = value; } }
    }

    public class FruitType
    {
        private String _name, _description;
        private double _price;
        public FruitType() { _name = _description = String.Empty; _price = 0.0; }
        public FruitType(String name, String description, double price) { _name = name; _description = description; _price = price; }
        public String Name { get { return _name; } set { _name = value; } }
        public String Description { get { return _description; } set { _description = value; } }
        public double PricePerPound { get { return _price; } set { _price = value; } }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions