-
Notifications
You must be signed in to change notification settings - Fork 0
/
BusinessListAdapter.cs
109 lines (92 loc) · 3.5 KB
/
BusinessListAdapter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//using System.Collections.Generic;
//using Android.Content;
//using Android.Views;
//using Android.Widget;
//using ImageSlider.Model;
//namespace ImageSlider.Adapter
//{
// class BusinessListAdapter : BaseAdapter<BusinessModel>
// {
// List<BusinessModel> businesses;
// Context context;
// Java.IO.File fileName1;
// ISharedPreferences prefs;
// public BusinessListAdapter(Context mContext, List<BusinessModel> businessList)
// {
// this.businesses = businessList;
// this.context = mContext;
// }
// public override BusinessModel this[int position]
// {
// get
// {
// return businesses[position];
// }
// }
// public override int Count
// {
// get
// {
// return businesses.Count;
// }
// }
// public override long GetItemId(int position)
// {
// return position;
// }
// public override View GetView(int position, View convertView, ViewGroup parent)
// {
// var view = convertView;
// ViewHolder holder;
// var local = new LocalOnClickListener();
// if (view == null)
// {
// holder = new ViewHolder();
// //view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.layout1, parent, false);
// view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.business_List_Child, null);
// holder.HeadingText = (TextView)view.FindViewById(Resource.Id.headingView);
// holder.BusinessType = (TextView)view.FindViewById(Resource.Id.selectOption);
// holder.BusinessMark = (CheckBox)view.FindViewById(Resource.Id.checkBox);
// //holder.HeadingText.Visibility = ViewStates.Gone;
// view.Tag = holder;
// }
// else
// {
// holder = (ViewHolder)view.Tag;
// }
// holder.BusinessType.Text = businesses[position].BusinessSubType;
// string currentText = businesses[position].BusinessType;
// string previousText = null;
// if (position > 0)
// {
// previousText = businesses[position - 1].BusinessType;
// }
// if (previousText == null || !previousText.Equals(currentText))
// {
// holder.HeadingText.Visibility = ViewStates.Visible;
// holder.HeadingText.Text = currentText;
// }
// else
// {
// holder.HeadingText.Visibility = ViewStates.Gone;
// }
// local.HandleOnClick = () =>
// {
// if (holder.BusinessMark.Checked)
// {
// Utilities.GlobalBusinessList.Add(businesses[position].BusinessTypeID);
// }
// else
// {
// var item = Utilities.GlobalBusinessList.FindIndex(x => x == businesses[position].BusinessTypeID);
// if (item >= 0)
// {
// Utilities.GlobalBusinessList.RemoveAt(item);
// }
// }
// };
// holder.BusinessMark.SetOnClickListener(local);
// return view;
// }
// }
//}