protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.SetLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.Vertical, false)); var adapter = new RestaurantAdapter(SampleData.GetRestaurants()); recyclerView.SetAdapter(adapter); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerView); recyclerView.SetLayoutManager(new LinearLayoutManager (this, LinearLayoutManager.Vertical, false)); var restaurantAdapter = new RestaurantAdapter(SampleData.GetRestaurants()); restaurantAdapter.ItemClick += RestaurantAdapter_ItemClick; recyclerView.SetAdapter(restaurantAdapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); var layoutMan = new GridLayoutManager(this, 2, GridLayoutManager.Vertical, false); listOfRestaurants = SampleData.GetRestaurants(this); restauAdapter = new RestaurantAdapter(listOfRestaurants); restauAdapter.ItemClick += OnItemClick; recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.SetLayoutManager(layoutMan); recyclerView.SetAdapter(restauAdapter); }