/// Método que anexa os componentes de UI a classe atual private void AttachUI() { // var toolbar = FindViewById<Toolbar> (Resource.Id.toolbar); // SetSupportActionBar(toolbar); // SupportActionBar.Title = "Catalogo"; _mPromotionsRecyclerView = FindViewById <RecyclerView> (Resource.Id.promotionsRecyclerView); _mPromotionLayoutManager = new LinearLayoutManager(this); _mPromotionsRecyclerView.SetLayoutManager(_mPromotionLayoutManager); _mPromotionAdapter = new PromotionAdapter(this, _mPromotions, _mProducts, _mCategories); // _mAdapter.ItemClick += OnItemClick; _mPromotionsRecyclerView.SetAdapter(_mPromotionAdapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.promotions_activity); mToolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); SupportActionBar.SetDisplayHomeAsUpEnabled(true); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetNavigationItemSelectedListener(this); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mPromotions.Add(new PromotionClass() { ID = 0, DrawableID = Resource.Drawable.ic_dashboard, Name = "Icon" }); mAdapter = new PromotionAdapter(this, mPromotions); mRecyclerView.SetAdapter(mAdapter); mLayoutManager = new GridLayoutManager(this, 2); mRecyclerView.SetLayoutManager(mLayoutManager); }