public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.Fragment_Search, container, false); recyclerView = rootView.FindViewById <RecyclerView>(Resource.Id.recyclerView); adapter = new ClothingAdapter(); LinearLayoutManager layoutManager = new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false); recyclerView.SetLayoutManager(layoutManager); recyclerView.SetAdapter(adapter); return(rootView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { _rootView = inflater.Inflate(Resource.Layout.Fragment_Match, container, false); LinearLayout lloMatchColors = _rootView.FindViewById <LinearLayout>(Resource.Id.lloMatchColors); int i = 0; while (i < 3) { RectangleShape rect; if (i == 0) { rect = new RectangleShape(Application.Context, Color.Black); } else { rect = new RectangleShape(Application.Context, Color.Black); rect.Visibility = ViewStates.Invisible; } WindowManagerLayoutParams layoutParams = new WindowManagerLayoutParams(); layoutParams.Width = ViewGroup.LayoutParams.MatchParent; layoutParams.Height = 200; lloMatchColors.AddView(rect, layoutParams); rect.Id = i; rect.SetPaddingRelative(-10, 0, 0, 0); rect.SetOnClickListener(this); i++; } recyclerView = _rootView.FindViewById <RecyclerView>(Resource.Id.recyclerView); adapter = new ClothingAdapter(); LinearLayoutManager layoutManager = new LinearLayoutManager(Activity, LinearLayoutManager.Vertical, false); recyclerView.SetLayoutManager(layoutManager); recyclerView.SetAdapter(adapter); return(_rootView); }