private void SetupRecyclerView() { _recyclerView = FindViewById <MvxRecyclerView>(Resource.Id.event_recyclerview); if (_recyclerView == null) { return; } _recyclerView.AddOnLayoutChangeListener(this); _recyclerView.Adapter = new MvxGenericRecyclerAdapter <IItemBase>((MvxAndroidBindingContext)BindingContext) { ModifyViewFunc = view1 => { SetupTextView(view1); SetupAttendeeRecyclerView(view1); } }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _recyclerView = FindViewById <MvxRecyclerView>(Resource.Id.details_recycler_view); if (_recyclerView != null) { _recyclerView.AddOnLayoutChangeListener(this); _recyclerView.Adapter = new DetailsAdapter((IMvxAndroidBindingContext)BindingContext); } _mvxSubscriptionToken = Mvx.Resolve <IMvxMessenger>().SubscribeOnMainThread <NewCommentMessage>(message => { var detailAdapter = _recyclerView.Adapter as DetailsAdapter; if (ViewModel.Items.Count > 1) { detailAdapter?.NotifyItemChanged(ViewModel.Items.Count - 1); } _recyclerView.ScrollToPosition(ViewModel.Items.Count - 1); }); SupportActionBar.SetDisplayHomeAsUpEnabled(true); // Check comment role if (Settings.UserRoles.All(r => r != Home.Feed.Comment.ToLower())) { var inputContainer = FindViewById <LinearLayout>(Resource.Id.details_input_container); if (inputContainer != null) { var layoutParams = inputContainer.LayoutParameters; layoutParams.Height = 0; inputContainer.LayoutParameters = layoutParams; } } }