public static void Initialize() { mapping = new WardrobeMapping(); }
protected override void OnCreate(Bundle bundle) { // Heroku runt niet 24/7 dus pingen we onze server zodat de kans // groter is dat hij aan staat als we bij reminders aan komen. Task.Run(async() => { await RestHelper.PingHerokuAsync(); }); WardrobeMapping.Initialize(); System.Console.WriteLine("ping"); RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); SetContentView(Resource.Layout.main); //var bn = FindViewById<BottomNavigationView>(Resource.Id.bottom_navigation); //bn.InflateMenu(Resource.Menu.bottom_navigation_main); ImageButton settingsButton = FindViewById <ImageButton>(Resource.Id.settings); settingsButton.Click += delegate { StartActivity(typeof(Settings)); }; ImageButton remindersButton = FindViewById <ImageButton>(Resource.Id.reminders); remindersButton.Click += delegate { StartActivity(typeof(ReminderMainActivity)); }; var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); if (toolbar != null) { //SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); } bottomNavigation = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation); bottomNavigation.ItemIconTintList = null; bottomNavigation.NavigationItemSelected += BottomNavigation_NavigationItemSelected; ImageButton homeButton = FindViewById <ImageButton>(Resource.Id.homeknop); bottomNavigation.Selected = false; homeButton.Click += delegate { LoadFragment(Resource.Id.home); bottomNavigation.Selected = false; }; ImageButton level = FindViewById <ImageButton>(Resource.Id.levelknop); level.Click += delegate { int xp = UserProfile.Current.UserXp; var lrxp = UserProfile.Current.GetUserLevelAndRemainingXp(); Toast.MakeText(this.BaseContext, $"Je bent momenteel level {lrxp.level} met {xp} xp." + $"\nNog {lrxp.remainingxp} xp tot level {lrxp.level + 1}!", ToastLength.Short).Show(); }; UserProfile.Current = new UserProfile(); UserProfile.Current.Initialize(this); LoadFragment(Resource.Id.home); }