protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); //RECYCLER VIEW mObject = new SideBySideObject (); mAdapter = new SideBySideAdapter (mObject, this, false); SetContentView (Resource.Layout.BrowseNationalities); mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView); mRecyclerView.SetAdapter (mAdapter); mLayoutManager = new v7Widget.LinearLayoutManager (this); mRecyclerView.SetLayoutManager (mLayoutManager); //MENU VIEW Button menu_button = FindViewById<Button> (Resource.Id.menu_button); MenuButtonSetupSuperClass (menu_button); // menu_button.Click += (s, arg) => { // menu_button.SetBackgroundResource(Resource.Drawable.pressed_lines); // PopupMenu menu = new PopupMenu (this, menu_button); // menu.Inflate (Resource.Menu.Main_Menu); // menu.MenuItemClick += this.MenuButtonClick; // menu.DismissEvent += (s2, arg2) => { // menu_button.SetBackgroundResource(Resource.Drawable.menu_lines); // Console.WriteLine ("menu dismissed"); // }; // menu.Show (); // }; }
public override void OnViewCreated(View view, Bundle savedInstanceState) { Layout = view.FindViewById<Android.Support.V7.Widget.RecyclerView>(ListLayoutResource); LayoutManager = new Android.Support.V7.Widget.LinearLayoutManager(Activity); Layout.SetLayoutManager(LayoutManager); }
void InitializeAdapter() { _position = Element.Position; LayoutManager.Reset(_position); var adapter = new ItemViewAdapter(this); adapter.RegisterAdapterDataObserver(new PositionUpdater(this)); Control.SetAdapter(adapter); }
protected override void OnCreate(Bundle savedInstanceState) { SetContentView(Resource.Layout.RecyclerView); base.OnCreate(savedInstanceState); //recycler view mRoomlist = new RoomList(); recyclerView = FindViewById <RecyclerView>(Resource.Id.recycler1); mLayoutManager = new LinearLayoutManager(this); recyclerView.SetLayoutManager(mLayoutManager); mAdapter = new RoomPhotoAdapter(mRoomlist); mAdapter.ItemClick += MAdapter_ItemClick; recyclerView.SetAdapter(mAdapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.layout3); mRecyclerView = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.recyclerView); // Plug in the linear layout manager: mLayoutManager = new Android.Support.V7.Widget.LinearLayoutManager(this); mRecyclerView.SetLayoutManager(mLayoutManager); // Plug in my adapter: var mAdapter = new RecyclerAdapter(Resource.Mipmap.us); mRecyclerView.SetAdapter(mAdapter); }
protected override void OnLayout(bool changed, int left, int top, int right, int bottom) { int width = right - left; int height = bottom - top; LayoutManager.Layout(width, height); base.OnLayout(changed, left, top, right, bottom); Control.Measure( widthMeasureSpec: new MeasureSpecification(width, MeasureSpecificationType.Exactly), heightMeasureSpec: new MeasureSpecification(height, MeasureSpecificationType.Exactly) ); Control.Layout(0, 0, width, height); }
public static void OnAttachedToRecyclerView(Android.Support.V7.Widget.RecyclerView.Adapter innerAdapter, Android.Support.V7.Widget.RecyclerView recyclerView, Com.Zhy.Adapter.Recyclerview.Utils.WrapperUtils.SpanSizeCallback callback) { innerAdapter.OnAttachedToRecyclerView(recyclerView); Android.Support.V7.Widget.RecyclerView.LayoutManager layoutManager = recyclerView .GetLayoutManager(); if (layoutManager is Android.Support.V7.Widget.GridLayoutManager) { Android.Support.V7.Widget.GridLayoutManager gridLayoutManager = (Android.Support.V7.Widget.GridLayoutManager )layoutManager; Android.Support.V7.Widget.GridLayoutManager.SpanSizeLookup spanSizeLookup = gridLayoutManager .GetSpanSizeLookup(); gridLayoutManager.SetSpanSizeLookup(new _SpanSizeLookup_29(callback, gridLayoutManager , spanSizeLookup)); gridLayoutManager.SpanCount = (gridLayoutManager.SpanCount); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); mPhotoAlbum = new Album(); // Set our view from the "main" layout resource SetContentView(Resource.Layout.MainMenuPage); mLayoutManager = new LinearLayoutManager(this); mAdapter = new PhotoAdapter(mPhotoAlbum); mAdapter.ItemClick += MAdapter_ItemClick; mRecyclerview = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.RvList); mRecyclerview.SetLayoutManager(mLayoutManager);; mRecyclerview.SetAdapter(mAdapter); }
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); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); //RECYCLER VIEW mObject = new PlannedMealObject (); mAdapter = new PlannedMealAdapter (mObject); SetContentView (Resource.Layout.Main); mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView); mRecyclerView.SetAdapter (mAdapter); mLayoutManager = new v7Widget.LinearLayoutManager (this); mRecyclerView.SetLayoutManager (mLayoutManager); //SEARCH VIEW SearchView searchView = FindViewById<SearchView> (Resource.Id.main_search); searchView.SetBackgroundColor (Android.Graphics.Color.DarkOrange); searchView.SetOnQueryTextListener ((SearchView.IOnQueryTextListener) this); int id = Resources.GetIdentifier("android:id/search_src_text", null, null); TextView textView = (TextView) searchView.FindViewById(id); textView.SetTextColor(Android.Graphics.Color.White); textView.SetHintTextColor (Android.Graphics.Color.White); searchView.SetQueryHint ("Search Recipes..."); LinearLayout search_container = FindViewById<LinearLayout> (Resource.Id.search_container); search_container.Click += (sender, e) => { if (searchView.Iconified != false){ searchView.Iconified = false; } }; //MENU VIEW Button menu_button = FindViewById<Button> (Resource.Id.menu_button); menu_button.Click += (s, arg) => { menu_button.SetBackgroundResource(Resource.Drawable.pressed_lines); PopupMenu menu = new PopupMenu (this, menu_button); menu.Inflate (Resource.Menu.Main_Menu); menu.MenuItemClick += this.MenuButtonClick; menu.DismissEvent += (s2, arg2) => { menu_button.SetBackgroundResource(Resource.Drawable.menu_lines); Console.WriteLine ("menu dismissed"); }; menu.Show (); }; this.GenerateUpcomingMeals ("http://speedychef.azurewebsites.net/search/GenerateUpcomingMeals?user=tester&date1=" + DateTime.Now + "&date2=" + DateTime.Now.AddDays (7.0), "GenerateUpcomingMeals"); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); this.mostRecentKeywords = ""; this.asc = "Asc"; this.ordertype = "Diff"; //RECYCLER VIEW mObject = new RecipeObject (); mAdapter = new RecipeAdapter (mObject, this); mAdapter.itemClick += this.OnItemClick; SetContentView (Resource.Layout.Search); mRecyclerView = FindViewById<v7Widget.RecyclerView> (Resource.Id.recyclerView); mRecyclerView.SetAdapter (mAdapter); mLayoutManager = new v7Widget.LinearLayoutManager (this); mRecyclerView.SetLayoutManager (mLayoutManager); //SEARCH VIEW SearchView searchView = FindViewById<SearchView> (Resource.Id.main_search); searchView.SetBackgroundColor (Android.Graphics.Color.DarkOrange); searchView.SetOnQueryTextListener ((SearchView.IOnQueryTextListener)this); int id = Resources.GetIdentifier ("android:id/search_src_text", null, null); TextView textView = (TextView)searchView.FindViewById (id); textView.SetTextColor (Android.Graphics.Color.White); textView.SetHintTextColor (Android.Graphics.Color.White); searchView.SetQueryHint ("Search Recipes..."); LinearLayout search_container = FindViewById<LinearLayout> (Resource.Id.search_container); search_container.Click += (sender, e) => { if (searchView.Iconified != false) { searchView.Iconified = false; } }; //MENU VIEW Button menu_button = FindViewById<Button> (Resource.Id.menu_button); menu_button.Click += (s, arg) => { menu_button.SetBackgroundResource (Resource.Drawable.pressed_lines); PopupMenu menu = new PopupMenu (this, menu_button); menu.Inflate (Resource.Menu.Main_Menu); menu.MenuItemClick += this.MenuButtonClick; menu.DismissEvent += (s2, arg2) => { menu_button.SetBackgroundResource (Resource.Drawable.menu_lines); Console.WriteLine ("menu dismissed"); }; menu.Show (); }; this.filter_button = FindViewById<Button> (Resource.Id.filter_button); RegisterForContextMenu (filter_button); filter_button.Click += (s, arg) => { ((Button) s).ShowContextMenu(); }; if(CachedData.Instance.PreviousActivity.GetType() == typeof(SubtypeBrowseActivity)){ string selectionInput = CachedData.Instance.SelectedSubgenre.Replace(' ', ','); string url = "http://speedychef.azurewebsites.net/search/searchbyunion?inputKeywords=" + this.mostRecentKeywords + "&ordertype=" + this.ordertype + "&ascending=" + this.asc + "&subgenre=" + selectionInput; this.ProcessSingleSearchQuery (url, "SearchByUnion"); } if(CachedData.Instance.SubmissionFromMain){ string url = "http://speedychef.azurewebsites.net/search/search?inputKeywords=" + CachedData.Instance.LastSubmissionFromMain + "&ordertype=" + this.ordertype + "&ascending=" + this.asc; this.ProcessSingleSearchQuery (url, "Search"); CachedData.Instance.SubmissionFromMain = false; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.catalog_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); mStores.Add(new StoreClass() { ID = 0, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 1, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 0, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 1, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 0, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 1, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 0, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 1, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 0, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 1, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 0, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mStores.Add(new StoreClass() { ID = 1, IsFavorite = true, Name = "Store_Name", DrawableID = Resource.Drawable.icon, Sphere = "Store_Sphere" }); mAdapter = new CatalogAdapter(this, mStores); mRecyclerView.SetAdapter(mAdapter); mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); mRecyclerView.SetLayoutManager(mLayoutManager); }