Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            RegisterForPushNotifications();

            RegisterFragments(bundle);
            SetContentView(Resource.Layout.MainView);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            _drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow_light, (int)GravityFlags.Start);
            _drawerToggle = new MvxActionBarDrawerToggle(this, _drawerLayout,
                                                         Resource.String.drawer_open, Resource.String.drawer_close);
            _drawerToggle.DrawerClosed += (_, e) => InvalidateOptionsMenu();
            _drawerToggle.DrawerOpened += (_, e) => InvalidateOptionsMenu();
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            _drawerToggle.DrawerIndicatorEnabled = true;
            _drawerLayout.SetDrawerListener(_drawerToggle);
            _drawerLayout.Post(() => _drawerToggle.SyncState());
            _bindableProgress = new BindableProgress(this);
            SetUpBindings();

            Akavache.BlobCache.ApplicationName = "MyHealth";

            ViewModel.ShowMenu();
            ViewModel.ShowHome();

            var authContext = new PlatformParameters(this);

            Task.Run(() => SignIn(authContext));
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            RegisterHockeyApp();

            // Settings needed by the Microsoft Graph service client.
            MicrosoftGraphService.SetAuthenticationUiContext(new PlatformParameters(this));
            MicrosoftGraphService.SetClientId(AppSettings.DroidClientId);
            MicrosoftGraphService.SetRedirectUri(AppSettings.RedirectUri);

            if (Settings.ADAuthenticationEnabled)
            {
                Task.Run(() => MicrosoftGraphService.SignInAsync());
            }

            RegisterForPushNotifications();

            _fragmentManager = FragmentManager;
            RegisterFragments(bundle);
            SetContentView(Resource.Layout.MainView);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            _drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow_light, (int)GravityFlags.Start);
            _drawerToggle = new MvxActionBarDrawerToggle(this, _drawerLayout,
                                                         Resource.String.drawer_open, Resource.String.drawer_close);
            _drawerToggle.DrawerClosed += (_, e) => InvalidateOptionsMenu();
            _drawerToggle.DrawerOpened += (_, e) => InvalidateOptionsMenu();
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            _drawerToggle.DrawerIndicatorEnabled = true;
            _drawerLayout.SetDrawerListener(_drawerToggle);
            _drawerLayout.Post(() => _drawerToggle.SyncState());
            _bindableProgress = new BindableProgress(this);
            SetUpBindings();

            Akavache.BlobCache.ApplicationName = "MyHealth";

            ViewModel.ShowMenu();
            ViewModel.ShowHome();
        }