Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            MainApp.ChangeLanguage(this);
            SetTheme(Resource.Style.MyAppTheme);
            base.OnCreate(savedInstanceState);

            startActivity = MainApp.Instance.SharedPreferences.GetString("startactivity", null);
            string str = MainApp.Instance.SharedPreferences.GetString("language", null);

            SetContentView(Resource.Layout.activity_main);

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerlayout_main);
            drawerLayout.AddDrawerListener(this);
            drawerLayout.SetStatusBarBackground(Resource.Color.color_status_bar);

            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_main);

            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);
            drawerLayout.AddDrawerListener(drawerToggle);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.baseline_menu_black);

            navigationView = FindViewById <NavigationView>(Resource.Id.navview_main);
            navigationView.NavigationItemSelected += NavViewItemSelected;
            navigationView.Alpha = 0.99f;
            InstantiateFragment();
        }
Пример #2
0
        private void Setup()
        {
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerlayout_main);
            drawerLayout.AddDrawerListener(this);
            drawerLayout.SetStatusBarBackground(Resource.Color.color_primary);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_main);

            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar,
                                                     Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);
            drawerLayout.AddDrawerListener(drawerToggle);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.baseline_menu_black);

            navigationView = FindViewById <NavigationView>(Resource.Id.navview_main);
            navigationView.NavigationItemSelected += NavViewItemSelected;
            navigationView.Alpha = 0.99f;

            startActivity = AndroidDependencyContainer.Instance.AppInfoSettings.StartScreen;
        }