public HeaderListView(Context context, IAttributeSet attrs, HeaderAdapter adapter)
     : base(context, attrs, adapter)
 {
     if (attrs != null)
     {
         HeaderTemplateId = MvxAttributeHelpers.ReadAttributeValue(context, attrs, Resource.Styleable.HeaderListView, Resource.Styleable.HeaderListView_HeaderTemplate);
     }
 }
        public MvxSectionedRecyclerView(Context context, IAttributeSet attrs) : base(context, attrs)
        {
            //create the adapter with parameters from attributes
            var headerTemplateId = MvxAttributeHelpers.ReadAttributeValue(context, attrs,
                                                                          MvxAndroidBindingResource.Instance.ExpandableListViewStylableGroupId,
                                                                          MvxAndroidBindingResource.Instance.GroupItemTemplateId);
            IMvxRecyclerAdapter adapter = new MvxSectionedRecyclerAdapter(false, headerTemplateId);

            Adapter = adapter;
        }
示例#3
0
        public BindableGroupListView(Context context, IAttributeSet attrs, BindableGroupListAdapter adapter)
            : base(context, attrs, adapter)
        {
            var groupTemplateId = MvxAttributeHelpers.ReadAttributeValue(context, attrs,
                                                                         MvxAndroidBindingResource.Instance
                                                                         .ListViewStylableGroupId,
                                                                         AndroidBindingResource.Instance
                                                                         .BindableListGroupItemTemplateId);

            adapter.GroupTemplateId = groupTemplateId;
        }
示例#4
0
        public RecurringListView(Context context, IAttributeSet attrs, RecurringAdapter adapter)
            : base(context, attrs)
        {
            var itemTemplateId = MvxAttributeHelpers.ReadAttributeValue(context, attrs,
                                                                        MvxAndroidBindingResource.Instance.ListViewStylableGroupId,
                                                                        MvxAndroidBindingResource.Instance.ListItemTemplateId);

            adapter.ItemTemplateId = itemTemplateId;
            Adapter = adapter;
            Adapter.CustomItemClick = this;
            SetupItemClickListeners();
        }
示例#5
0
        void InitFooters(Context context, IAttributeSet attrs)
        {
            var footerId = MvxAttributeHelpers.ReadAttributeValue(context, attrs, MvxAndroidBindingResource.Instance.ListViewStylableGroupId,
                                                                  AndroidBindingResource.Instance.MvxListViewWithHeader_FooterLayout);

            if (footerId != 0)
            {
                var bindingContext = MvxAndroidBindingContextHelpers.Current();
                var view           = bindingContext.BindingInflate(footerId, null);

                AddFooterView(view, null, false);
            }
        }
示例#6
0
        public MvxListViewWithHeader(Context context, IAttributeSet attrs) : base(context, attrs, null)
        {
            var headerId = MvxAttributeHelpers.ReadAttributeValue(context, attrs, MvxAndroidBindingResource.Instance.ListViewStylableGroupId,
                                                                  AndroidBindingResource.Instance.MvxListViewWithHeader_HeaderLayout);
            var footerId = MvxAttributeHelpers.ReadAttributeValue(context, attrs, MvxAndroidBindingResource.Instance.ListViewStylableGroupId,
                                                                  AndroidBindingResource.Instance.MvxListViewWithHeader_FooterLayout);

            var headers = GetFixedViewInfos(headerId);
            var footers = GetFixedViewInfos(footerId);

            var adapter = new MvxAdapter(context);

            adapter.ItemTemplateId = MvxAttributeHelpers.ReadListItemTemplateId(context, attrs);

            var headerAdapter = new HeaderMvxAdapter(headers, footers, adapter);

            Adapter = headerAdapter;
        }
示例#7
0
        public BindableExpandableListView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            var expandableAdapter = new BindableExpandableListAdapter(context);

            var groupTemplateId = MvxAttributeHelpers.ReadAttributeValue(context, attrs,
                                                                         MvxAndroidBindingResource.Instance
                                                                         .ListViewStylableGroupId,
                                                                         AndroidBindingResource.Instance
                                                                         .BindableListGroupItemTemplateId);

            var itemTemplateId = MvxAttributeHelpers.ReadListItemTemplateId(context, attrs);

            expandableAdapter.GroupTemplateId = groupTemplateId;
            expandableAdapter.ItemTemplateId  = itemTemplateId;

            SetAdapter(expandableAdapter);

            InitHeaders(context, attrs);
            InitFooters(context, attrs);
        }
示例#8
0
 public static int ReadTemplateId(Context context, IAttributeSet attrs)
 {
     return(MvxAttributeHelpers.ReadAttributeValue(context, attrs, Resource.Styleable.ARLinearLayout, Resource.Styleable.ARLinearLayout_MvxItemTemplate));
 }
示例#9
0
 private void ApplyAttributes(Context c, IAttributeSet attrs)
 {
     _headerId = MvxAttributeHelpers.ReadAttributeValue(c, attrs, Resource.Styleable.ARListView, Resource.Styleable.ARListView_MvxHeaderTemplate);
     _footerId = MvxAttributeHelpers.ReadAttributeValue(c, attrs, Resource.Styleable.ARListView, Resource.Styleable.ARListView_MvxFooterTemplate);
 }