Esempio n. 1
0
        public override View GetView(Context context, View convertView, ViewGroup parent)
        {
            if (HeaderView != null)
            {
                return(HeaderView.GetView(context, convertView, parent));
            }

            if (Caption != null)
            {
                var view = (convertView as TextView) ?? new TextView(context, null, Android.Resource.Attribute.ListSeparatorTextViewStyle);
                if (Caption.Length >= 0)
                {
                    view.Text       = Caption;
                    view.Visibility = ViewStates.Visible;
                }
                else
                {
                    view.Text       = string.Empty;
                    view.Visibility = ViewStates.Visible;
                }
                return(view);
            }

            // invisible/empty section header, could be re-shown by setting the caption and refreshing the list
            return(new View(context, null)
            {
                LayoutParameters = new ListView.LayoutParams(ListView.LayoutParams.FillParent, 0),
                Visibility = ViewStates.Gone,
            });
        }