示例#1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, this.BindingContext.LayoutInflaterHolder);
            var view = this.InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new DisasterIncidentViewHolder(view, itemBindingContext));
        }
        public override Object OnCreateHeaderItemViewHolder(ViewGroup p0, int p1)
        {
            var itemBindingContext = new MvxAndroidBindingContext(p0.Context, BindingContext.LayoutInflaterHolder);

            var viewHolder =
                new MvxRecyclerViewHolder(
                    InflateViewForHolder(HeaderFooterDetails.HeaderLayoutId, p0, p1, itemBindingContext),
                    itemBindingContext)
            {
                DataContext = BindingContext.DataContext
            };

            viewHolder.Click += (e, a) => {
                if (HeaderClickCommand?.CanExecute(viewHolder.DataContext) ?? false)
                {
                    HeaderClickCommand.Execute(viewHolder.DataContext);
                }
            };

            viewHolder.LongClick += (e, a) =>
            {
                if (HeaderLongClickCommand?.CanExecute(viewHolder.DataContext) ?? false)
                {
                    HeaderLongClickCommand.Execute(viewHolder.DataContext);
                }
            };

            return(viewHolder);
        }
示例#3
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var view = InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new PhotosViewHolder(view, itemBindingContext, _itemClickAction));
        }
示例#4
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var inflatedView       = InflateViewForHolder(parent, viewType, itemBindingContext);

            switch (viewType)
            {
            case MainTemplateSelector.Item:
                return(new MainRecyclerViewLogViewHolder(inflatedView, itemBindingContext)
                {
                    Click = TimeEntriesLogViewModel.EditCommand,
                    ContinueCommand = TimeEntriesLogViewModel.ContinueTimeEntryCommand
                });

            case MainTemplateSelector.Suggestions:
                return(new MainRecyclerViewSuggestionsViewHolder(inflatedView, itemBindingContext)
                {
                    Click = SuggestionsViewModel.StartTimeEntryCommand
                });

            default:
                return(new MvxRecyclerViewHolder(inflatedView, itemBindingContext));
            }

            throw new ArgumentOutOfRangeException(nameof(viewType), $"Invalid viewType provided to {nameof(MainRecyclerAdapter)}");
        }
示例#5
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);

            if (viewType == TypeFooter)
            {
                View view = View.Inflate(parent.Context, Resource.Layout.FooterLoading, null);

                // looks gravity.center can not be written in axml, I have to write it here, I don't know why.
                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                layoutParams.Gravity  = GravityFlags.Center;
                view.LayoutParameters = layoutParams;
                this.Footer           = new FooterHolder(view, itemBindingContext);
                return(Footer);
            }
            else
            {
                var vh = new TimelineItemView(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext)
                {
                    Click     = ItemClick,
                    LongClick = ItemLongClick
                };
                return(vh);
            }
        }
示例#6
0
 protected MvxCachingFragmentActivity(IntPtr javaReference, JniHandleOwnership transfer)
     : base(javaReference, transfer)
 {
     BindingContext = new MvxAndroidBindingContext(this, this);
     this.AddEventListeners();
     FragmentCacheConfiguration = new FragmentCacheConfiguration();
 }
示例#7
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            RecyclerView.ViewHolder viewHolder = null;
            var itemBindingContext             = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);

            View view = null;

            if (viewType == MessageSentType)
            {
                view       = itemBindingContext.BindingInflate(Resource.Layout.item_sentMessage, parent, false);
                viewHolder = new SentItemViewHolder(view, itemBindingContext)
                {
                };
            }
            else
            {
                view       = itemBindingContext.BindingInflate(Resource.Layout.item_receivedMessage, parent, false);
                viewHolder = new ReceivedItemViewHolder(view, itemBindingContext)
                {
                };
            }


            return(viewHolder);
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            base.OnCreateViewHolder(parent, viewType);
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, bindingContext.LayoutInflaterHolder);
            var holder             = new EditPointViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext);

            return(holder);
        }
示例#9
0
        public override MvxRecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var itemView           = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.PhotoHolder, parent, false);
            var holder             = new PhotoHolder(itemView, itemBindingContext);

            return(holder);
        }
示例#10
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);

            var view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.VacationRow, parent, false);

            return(new VacationItemViewHolder(view, itemBindingContext));
        }
示例#11
0
        public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, this.BindingContext.LayoutInflaterHolder);

            View = this.InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new MenuItemViewHolder(View, itemBindingContext, OnClick));
        }
示例#12
0
        protected MvxOverlay(Context context)
        {
            Context = MvxContextWrapper.Wrap(context, this);

            BindingContext = new MvxAndroidBindingContext(Context, this);

            _viewAdapter = new MvxOverlayAdapter(this);
        }
示例#13
0
        public override ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var view = InflateViewForHolder(parent, viewType, itemBindingContext);

            var peopleOnBoardHolder = new ClientListViewHolder(view, itemBindingContext);

            return(peopleOnBoardHolder);
        }
示例#14
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            RecyclerView.ViewHolder viewHolder = null;
            var itemBindingContext             = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var view = itemBindingContext.BindingInflate(Resource.Layout.item_myContact, parent, false);

            viewHolder = new MyContactItemViewHolder(view, itemBindingContext);
            return(viewHolder);
        }
示例#15
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);

            return(new CryptoCurrencyViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext, _vm, _activity)
            {
                Click = ItemClick,
                LongClick = ItemLongClick
            });
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var  itemBindingContext = new MvxAndroidBindingContext(parent.Context, this.BindingContext.LayoutInflaterHolder);
            View itemView           = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.task_item, parent, false);

            return(new TaskItemHolder(itemView, itemBindingContext)
            {
                Click = ItemClick
            });
        }
示例#17
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var itemView           = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.item_user, parent, false);
            var holder             = new UserHolder(itemView, itemBindingContext);

            holder.SetOnElementClickListener(this);

            return(holder);
        }
        public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, _bindingContext.LayoutInflaterHolder);

            return(new MvxRecyclerViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext)
            {
                Click = ItemClick,
                LongClick = ItemLongClick
            });
        }
示例#19
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var view = InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new TaskViewHolder(view, itemBindingContext));
            //var view = BindingContext.BindingInflate(Resource.Layout.TaskItem, parent);
            //var itemViewHolder = new TaskViewHolder(view, BindingContext);
            //return itemViewHolder;
        }
示例#20
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, this.BindingContext.LayoutInflaterHolder);
            var view = this.InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new MonkeyViewHolder(view, itemBindingContext, this)
            {
                Click = ItemClick, LongClick = ItemLongClick
            });
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var  itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            View view = InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new SelectedItemViewHolder(view, itemBindingContext, OnClick)
            {
                Click = ItemClick,
                LongClick = ItemLongClick
            });
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, this.BindingContext.LayoutInflaterHolder);
            var view   = this.InflateViewForHolder(parent, viewType, itemBindingContext);
            var holder = new RewardsCategoryCellHolder(view, itemBindingContext)
            {
                Click = ItemClick
            };

            return(holder);
        }
示例#23
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);

            // Create an instance of MyCustomViewHolder instead of MvxViewHolder
            return(new MyCustomViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext)
            {
                Click = ItemClick,
                LongClick = ItemLongClick
            });
        }
示例#24
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, this.BindingContext.LayoutInflaterHolder);
            var view = this.InflateViewForHolder(parent, viewType, itemBindingContext);

            view.LayoutParameters.Height = parent.MeasuredHeight / 5;
            return(new HomeRecyclerHolder(view, itemBindingContext)
            {
                Click = ItemClick,
                LongClick = ItemLongClick
            });
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            Debug.WriteLine("On create view holder");
            Debug.WriteLine("View type => " + viewType);
            Debug.WriteLine("Item template selector => " + ItemTemplateId);
            Debug.Write("Selector layout id => " + ItemTemplateSelector.GetItemLayoutId(viewType));
            base.OnCreateViewHolder(parent, viewType);
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var view = InflateViewForHolder(parent, viewType, itemBindingContext);

            return(new SkillViewHolder(view, itemBindingContext));
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);
            var inflatedView       = InflateViewForHolder(parent, viewType, itemBindingContext);
            var viewHolder         = new SuggestionsRecyclerViewHolder(inflatedView, itemBindingContext)
            {
                Click     = ItemClick,
                LongClick = ItemLongClick
            };

            return(viewHolder);
        }
示例#27
0
        public View GetInfoContents(Marker marker)
        {
            var anno = (marker.Tag as AnnotationTag).Annotation;
            int?id   = GetViewIdForInfoContent(anno);

            if (id != null)
            {
                MvxAndroidBindingContext bindingContext = new MvxAndroidBindingContext(_context, _bindingContext.LayoutInflaterHolder);
                View view = bindingContext.BindingInflate(id.Value, null);
                MvxBindingInfoViewHolder vh = GetInfoContentsViewHolder(view, bindingContext);
            }
            return(null);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            m_bindingContext = new MvxAndroidBindingContext(
                this,
                new LayoutInflaterProvider(LayoutInflater),
                CreateViewModel());

            var view = m_bindingContext.BindingInflate(GetLayoutResourceId(), null);

            SetContentView(view);
        }
        public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemBindingContext = new MvxAndroidBindingContext(parent.Context, BindingContext.LayoutInflaterHolder);

            var vh = new MvxRecyclerViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext)
            {
                Click     = ItemClick,
                LongClick = ItemLongClick,
                Id        = ItemTemplateSelector.GetItemLayoutId(viewType)
            };

            return(vh);
        }
示例#30
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // setup the application
            Setup.Instance.EnsureInitialized(ApplicationContext);

            _bindingContext = new MvxAndroidBindingContext(this, new LayoutInflaterProvider(LayoutInflater), new FooBarViewModel());

            var view = _bindingContext.BindingInflate(Resource.Layout.Main, null);

            SetContentView(view);
        }
示例#31
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Initialize binding setup
            BindingSetup.Instance.Initlialize(ApplicationContext);

            // Create service agent and view model
            ICustomerServiceAgent serviceAgent = new MockCustomerServiceAgent();
            var customerViewModel = new CustomerViewModel(serviceAgent);

            // Create binding context, passing view model
            _bindingContext = new MvxAndroidBindingContext(this, this, customerViewModel);

            // Create view by inflating binding on binding context
            var view = _bindingContext.BindingInflate(Resource.Layout.Main, null);

            // Set content view passing inflated view with bindings
            SetContentView(view);
        }
 public CustomViewElement(Context context)
 {
     BindingContext = new MvxAndroidBindingContext(context, (IMvxLayoutInflater)context);
 }