protected override void OnCreate (Bundle savedInstanceState)
		{ 
 
			base.OnCreate (savedInstanceState);   
			SetContentView (Resource.Layout.Main);
			drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); 

			// Init toolbar
			var toolbar = FindViewById<Toolbar>(Resource.Id.app_bar);
			SetSupportActionBar(toolbar);
			SupportActionBar.SetTitle (Resource.String.app_name);
			SupportActionBar.SetDisplayHomeAsUpEnabled(true);
			SupportActionBar.SetDisplayShowHomeEnabled(true);

			// Attach item selected handler to navigation view
			var navigationView = FindViewById<NavigationView>(Resource.Id.nav_view);
			navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

			// Create ActionBarDrawerToggle button and add it to the toolbar
			var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);
			drawerLayout.SetDrawerListener(drawerToggle);
			drawerToggle.SyncState();

			//load default home screen
			var ft= FragmentManager.BeginTransaction ();
			ft.AddToBackStack (null);
			ft.Add (Resource.Id.HomeFrameLayout, new HomeFragment ());
			ft.Commit ();  
		}
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _fragmentManager = FragmentManager;

            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 += _drawerToggle_DrawerClosed;
            _drawerToggle.DrawerOpened += _drawerToggle_DrawerOpened;

            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            _drawerToggle.DrawerIndicatorEnabled = true;
            _drawerLayout.SetDrawerListener(_drawerToggle);

            ViewModel.ShowMenu();
            ViewModel.ShowPasswordOverview();
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            int calcNo = Intent.GetIntExtra("CalculationType",-1);

            SetContentView (Resource.Layout.PercentDrawer);

            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawerLayout);
            drawerLayout.SetBackgroundColor(Android.Graphics.Color.AntiqueWhite);
            ColorDrawable colorDrawable = new ColorDrawable (Color.Black);
            this.ActionBar.SetBackgroundDrawable (colorDrawable);

            drawerToggle = new ActionBarDrawerToggle (this, drawerLayout, Resource.String.DrawerOpenDescription, Resource.String.DrawerCloseDescription);

            drawerLayout.SetDrawerListener (drawerToggle);

            drawerListView = FindViewById<ListView> (Resource.Id.drawerListView);
            drawerListView.Adapter = new ArrayAdapter<string> (this, Android.Resource.Layout.SimpleListItem1, calculationTitles);
            drawerListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => OnMenuItemClick(e.Position);
            drawerListView.SetItemChecked (calcNo, true);
            OnMenuItemClick (calcNo);

            ActionBar.SetDisplayHomeAsUpEnabled (true);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            fragmentManager = FragmentManager;
            //fragmentManager.AddOnBackStackChangedListener(this);

            registerFragments(bundle);
            SetContentView(Resource.Layout.activity_home);

            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer);

            toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            if (toolbar != null)
            {
                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                drawerToggle = new MvxActionBarDrawerToggle(
                    this,                  /* host Activity */
                    drawerLayout,         /* DrawerLayout object */
                    toolbar,  /* nav drawer icon to replace 'Up' caret */
                    Resource.String.drawer_open,  /* "open drawer" description */
                    Resource.String.drawer_close  /* "close drawer" description */
                );

                drawerLayout.SetDrawerListener(drawerToggle);
            }

            ViewModel.ShowMenu ();
        }
Esempio n. 5
0
        void InitUI()
        {
            mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawerLayout);
            mDrawerList = FindViewById<ListView> (Resource.Id.sliderMenu);

            var adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, operations);
            mDrawerList.Adapter = adapter;

            ActionBar.SetDisplayHomeAsUpEnabled (true);
            ActionBar.SetHomeButtonEnabled (true);

            mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
                Resource.Drawable.ic_drawer, //nav menu toggle icon
                Resource.String.app_name, // nav drawer open - description for accessibility
                Resource.String.app_name // nav drawer close - description for accessibility
            );

            mDrawerLayout.DrawerClosed += (sender, e) => {
                ActionBar.Title = Resources.GetString(Resource.String.app_name);
                InvalidateOptionsMenu();
            };

            mDrawerLayout.DrawerOpened += (sender, e) => {
                ActionBar.Title = Resources.GetString(Resource.String.app_name);
                InvalidateOptionsMenu();
            };

            mDrawerLayout.SetDrawerListener(mDrawerToggle);

            //FragmentManager.BeginTransaction ().Replace (Resource.Id.container, new ServiceFragment ()).Commit ();
            //FragmentManager.BeginTransaction ().Replace (Resource.Id.container, new LinearFragment ()).Commit ();
            FragmentManager.BeginTransaction ().Replace (Resource.Id.container, new EditTextSampleFragment ()).Commit ();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            _logging.WriteLine(Lib.Logging.MessageType.Information, "Starting application in MainActivity OnCreate method");
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            SetContentView(Resource.Layout.Main);
            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawerLayout);

            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, Resource.String.DrawerOpenDescription, Resource.String.DrawerCloseDescription);

            drawerLayout.SetDrawerListener(drawerToggle);
            ActionBar.SetIcon(Android.Resource.Color.Transparent);
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            drawerListView = FindViewById<ListView>(Resource.Id.drawerListView);
            menuAdapter = new MenuAdapter (this);
            drawerListView.Adapter = menuAdapter;
            drawerListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => OnMenuItemClick(e.Position);
            var aboutFrag = menuAdapter.MenuItems.FirstOrDefault(x => x.Manager.GetType() == typeof(AboutFragment));
            var aboutPos = menuAdapter.MenuItems.IndexOf (aboutFrag);
            drawerListView.SetItemChecked(aboutPos, true);	// Highlight the About Fragment at startup
            OnMenuItemClick(aboutPos);                     // Load About Fragment at startup
        }
Esempio n. 7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            locationManager = GetSystemService(Context.LocationService) as LocationManager;

            //set the user current location
            setlocation();

            //setup the map
            SetupMap();


            //set left drawer staff
            leftDrawerLayaout = FindViewById<DrawerLayout>(Resource.Id.myDrawer);
            leftDrawer = FindViewById<ListView>(Resource.Id.leftListView);

            //get users 
            populateUsersOnDrawer();

            leftDrawerToggle = new ActionBarDrawerToggle(this, leftDrawerLayaout, Resource.Drawable.menu, Resource.String.drawer_open, Resource.String.drawer_close);
            leftDrawerLayaout.SetDrawerListener(leftDrawerToggle);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayShowTitleEnabled(true);
           
            //start message service 
            StartService(new Intent(this, typeof(MsgApiService)));

        }
        //public List<DrawerItem> items;
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create your application here
            SetContentView (Resource.Layout.activity_drawer_welcomeLayout);
            try
            {
                mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.myDrawer_layout);
                mLeftDrawer = FindViewById<ListView> (Resource.Id.leftListView);

                mDrawerToggle = new myActionBarDrawerToggle (this, mDrawerLayout, Resource.Drawable.ic_drawer, Resource.String.open_drawer, Resource.String.close_drawer);

                mLeftDrawer.Adapter=new MenuListAdapter(this);
                this.mLeftDrawer.ItemClick += (sender, e) => SelectItem(e.Position);

                mDrawerLayout.SetDrawerListener (mDrawerToggle);

                ActionBar.SetDisplayHomeAsUpEnabled (true);
                ActionBar.SetHomeButtonEnabled (true);
                ActionBar.SetDisplayShowTitleEnabled (true);
            }
            catch (Exception ex) {
                var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
                toast.Show ();
            }
        }
Esempio n. 9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource.
            SetContentView(Resource.Layout.Main);
            _DrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawerMain);

            // Set the toolbar
            _Toolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);

            _DrawerToggle = new HelpsAppCompatDrawerToggle(this, _DrawerLayout, Resource.String.menuTitle, _CurrentViewTitle);
            _DrawerLayout.SetDrawerListener(_DrawerToggle);

            // Set up action bar
            SetUpSupportActionBar(bundle);
            
            _DrawerToggle.SyncState();

            // Set up the menu layout.
            SetUpMenu();
            
            //Fetch booking data
            FetchBookingData();

        }
Esempio n. 10
0
        private void InitializeElements()
        {
            CreateActionBar();

            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.new_drawer_layout);
            mLeftDrawer   = FindViewById <ListView>(Resource.Id.leftDrawerReport);

            var mleftDrawerItems = new List <string>();

            mleftDrawerItems.Add(Resources.GetString(Resource.String.logout));
            mDrawerToggle       = new ActionBarDrawerToggle(this, mDrawerLayout, Resource.Drawable.menu_navbar_ham_new, Resource.String.open_drawer, Resource.String.close_drawer);
            mLeftDrawerAdapter  = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, mleftDrawerItems);
            mLeftDrawer.Adapter = mLeftDrawerAdapter;
            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            mLeftDrawer.ItemClick += ListView_ItemClick;

            pager = FindViewById <ViewPager>(Resource.Id.pager);
            pager.OffscreenPageLimit = 2;
            tabLayout = FindViewById <TabLayout>(Resource.Id.tabLayout);

            floatingActionButton        = FindViewById <FloatingActionButton>(Resource.Id.fab);
            floatingActionButton.Click += FloatingActionButtonClick;

            InitializePagerAdapter();
        }
Esempio n. 11
0
		protected override void OnCreate (Android.OS.Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.Main);
			Toolbar = FindViewById<Toolbar> (Resource.Id.toolbar);
			drawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);
			if (Toolbar != null) {
				SetSupportActionBar (Toolbar);
				SupportActionBar.SetDisplayHomeAsUpEnabled (true);
				SupportActionBar.SetHomeButtonEnabled (true);
			}

			var navigationDrawer = this.FindViewById<NavigationView> (Resource.Id.nav_view);
			navigationDrawer.NavigationItemSelected += Nv_NavigationItemSelected;

			// animating menu
			actionBarToggle = new ActionBarDrawerToggle (
				this, 
				drawerLayout, 
				Resource.String.openDrawer,
				Resource.String.closeDrawer
			);



			drawerLayout.SetDrawerListener (actionBarToggle);
			actionBarToggle.SyncState ();
			DoFirstRun (savedInstanceState);
		}
Esempio n. 12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);



            //toolbar
            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer   = FindViewById <ListView>(Resource.Id.left_drawer);

            //init leftdrawer items here ####
            ListviewAssistant = new ListViewAssistant(this, mLeftDrawer);


            //make sure fragment is init
            // add all the possible fragments
            MainFragment = new FragmentHelper(new FragHome(), "FragHome", Resource.Id.FragmentContainer);
            //MainFragment.Add(new FragAbout(), "FragAbout");
            //MainFragment.Add(new FragModule(), "FragModule");
            //MainFragment.Add(new FragProfile(), "FragProfile");
            //MainFragment.Add(new FragSettings(), "FragSettings");
            MainFragment.FinalizeAdd(SupportFragmentManager.BeginTransaction());
            //Manage The fragment here
            ListviewAssistant.ItemClick += ListviewAssistant_ItemClick;

            SetSupportActionBar(mToolbar);

            mDrawerToggle = new MyActionBarDrawerToggle(this, mDrawerLayout,
                                                        Resource.String.openDrawer,     //top bar title when string is opened
                                                        Resource.String.ApplicationName //top bar title when closed
                                                        );

            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            //SupportActionBar.SetTitle(Resource.String.ApplicationName);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true); //this replace the next' lines code because it is depreciated in 22
            //SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            mDrawerToggle.SyncState();

            if (bundle != null) //first time
            {
                if (bundle.GetString("DrawerState") == "Opened")
                {
                    SupportActionBar.SetTitle(Resource.String.openDrawer);
                }
                else
                {
                    SupportActionBar.SetTitle(Resource.String.ApplicationName);
                }
            }
            else
            {
                SupportActionBar.SetTitle(Resource.String.ApplicationName);
            }
        }
Esempio n. 13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

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

            //toolbar.setTitleTextColor(0xFFFFFFFF);
            SetSupportActionBar(toolbar);


            drawer   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            home     = FindViewById <TextView>(Resource.Id.home);
            faq      = FindViewById <TextView>(Resource.Id.faq);
            feedback = FindViewById <TextView>(Resource.Id.feedback);
            aboutSp  = FindViewById <TextView>(Resource.Id.aboutSP);
            fab      = FindViewById <FloatingActionButton>(Resource.Id.fab);
            sign_out = FindViewById <ImageView>(Resource.Id.sign_out);
            close    = FindViewById <ImageView>(Resource.Id.close);

            home.SetOnClickListener(this);
            faq.SetOnClickListener(this);
            feedback.SetOnClickListener(this);
            aboutSp.SetOnClickListener(this);


            BottomNavigationView bottomNavigationView = FindViewById <BottomNavigationView>(Resource.Id.navigation);

            bottomNavigationView.SetOnNavigationItemSelectedListener(this);
            IsPlayServicesAvailable();
            bottomNavigationView.SelectedItemId = (Resource.Id.navigation_home);


            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.SetDrawerListener(toggle);
            toggle.SyncState();
            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);



            close.Click += (o, e) =>
            {
                if (drawer.IsDrawerOpen(GravityCompat.Start))
                {
                    drawer.CloseDrawer(GravityCompat.Start);
                }
            };

            sign_out.Click += (o, e) =>
            {
                Intent intent = new Intent(this, typeof(LoginActivity));
                intent.AddFlags(ActivityFlags.NewTask);
                intent.AddFlags(ActivityFlags.ClearTask);
                StartActivity(intent);
            };
        }
Esempio n. 14
0
        protected void SetDrawerLayout(DrawerLayout drawerLayout, Toolbar toolbar)
        {
            // Create ActionBarDrawerToggle button and add it to the toolbar
            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();
        }
Esempio n. 15
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            AndroidExtensions.Initialize(this);
            SetContentView(Resource.Layout.Main);

            this.drawer       = FindViewById <DrawerLayout> (Resource.Id.drawer_layout);
            this.drawerToggle = new MoyeuActionBarToggle(this,
                                                         drawer,
                                                         Resource.Drawable.ic_drawer,
                                                         Resource.String.open_drawer,
                                                         Resource.String.close_drawer)
            {
                OpenCallback = () => {
                    ActionBar.Title = Title;
                    CurrentFragment.HasOptionsMenu = false;
                    InvalidateOptionsMenu();
                },
                CloseCallback = () => {
                    var currentFragment = CurrentFragment;
                    if (currentFragment != null)
                    {
                        ActionBar.Title = ((IMoyeuSection)currentFragment).Title;
                        currentFragment.HasOptionsMenu = true;
                    }
                    InvalidateOptionsMenu();
                },
            };
            drawer.SetDrawerShadow(Resource.Drawable.drawer_shadow, (int)GravityFlags.Left);
            drawer.SetDrawerListener(drawerToggle);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            Hubway.Instance.Subscribe(this);
            FavoriteManager.FavoritesChanged += (sender, e) => aroundAdapter.Refresh();

            drawerMenu = FindViewById <ListView> (Resource.Id.left_drawer);
            drawerMenu.AddFooterView(new Space(this));
            drawerMenu.ItemClick += HandleSectionItemClick;
            menuNormalTf          = Typeface.Create(Resources.GetString(Resource.String.menu_item_fontFamily),
                                                    TypefaceStyle.Normal);
            menuHighlightTf = Typeface.Create(Resources.GetString(Resource.String.menu_item_fontFamily),
                                              TypefaceStyle.Bold);
            drawerMenu.Adapter = new DrawerMenuAdapter(this);

            drawerAround            = FindViewById <ListView> (Resource.Id.left_drawer_around);
            drawerAround.ItemClick += HandleAroundItemClick;
            drawerAround.Adapter    = aroundAdapter = new DrawerAroundAdapter(this);

            drawerMenu.SetItemChecked(0, true);
            if (CheckGooglePlayServices())
            {
                client = CreateApiClient();
                SwitchTo(mapFragment = new HubwayMapFragment(this));
                ActionBar.Title      = ((IMoyeuSection)mapFragment).Title;
            }
        }
Esempio n. 16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            // Init toolbar
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetTitle(Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            //Load Fragment
            homeFragment      = new HomeFragment();
            aboutFragment     = new AboutFragment();
            devicesFragment   = new DevicesFragment();
            postFragment      = new PostFragment();
            reviewFragment    = new ReviewFragment();
            writePostFragment = new WritePostFragment();

            //Fragment helper
            mStackFragments = new Stack <SupportFragment>();

            // Attach item selected handler to navigation view
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            // Create ActionBarDrawerToggle button and add it to the toolbar
            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();

            //load default home screen
            //var ft = FragmentManager.BeginTransaction();
            //ft.AddToBackStack(null);
            //ft.Add(Resource.Id.HomeFrameLayout, new HomeFragment());
            //ft.Commit();
            Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction();

            tx.Add(Resource.Id.HomeFrameLayout, homeFragment);
            tx.Add(Resource.Id.HomeFrameLayout, devicesFragment);
            tx.Add(Resource.Id.HomeFrameLayout, postFragment);
            tx.Add(Resource.Id.HomeFrameLayout, reviewFragment);
            tx.Add(Resource.Id.HomeFrameLayout, writePostFragment);
            tx.Add(Resource.Id.HomeFrameLayout, aboutFragment);
            tx.Hide(aboutFragment);
            tx.Hide(devicesFragment);
            tx.Hide(postFragment);
            tx.Hide(reviewFragment);
            tx.Hide(writePostFragment);

            mCurrentFragment = homeFragment;
            tx.Commit();
        }
Esempio n. 17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Review);

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            // Create ActionBarDrawerToggle button and add it to the toolbar
            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);


            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();

            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            setupDrawerContent(navigationView);

            navigationView.NavigationItemSelected += HomeNavigationView_NavigationItemSelected;

            zvijezdice          = FindViewById <RatingBar>(Resource.Id.ratingBar1);
            posaljiReviewButton = FindViewById <Button>(Resource.Id.button2);
            recenzijaText       = FindViewById <EditText>(Resource.Id.OpisRezenzije1);
            string input     = Intent.GetStringExtra("rent");
            string userinput = Intent.GetStringExtra("user");

            najam    = JsonConvert.DeserializeObject <Data_classes.Rent>(input);
            korisnik = JsonConvert.DeserializeObject <List <User> >(userinput);



            posaljiReviewButton.Click += (b, e) =>
            {
                if (recenzijaText.Text != null)
                {
                    korisnik = JsonConvert.DeserializeObject <List <User> >(userinput);
                    var klijent = new RestClient("http://marichely.m/");
                    var zahtjev = new RestRequest("reviews", Method.POST);
                    zahtjev.RequestFormat = DataFormat.Json;
                    zahtjev.AddHeader("rentid", najam.Rentid.ToString());
                    zahtjev.AddHeader("userapikey", korisnik[0].ApiKey);
                    CreateReview posalji = new CreateReview();
                    posalji.Description = recenzijaText.Text;
                    posalji.Stars       = zvijezdice.NumStars;
                    string test = JsonConvert.SerializeObject(posalji);
                    zahtjev.AddParameter("text/json", test, ParameterType.RequestBody); //text/json
                    IRestResponse odgovor = klijent.Execute(zahtjev);
                    if ((int)odgovor.StatusCode == 200)
                    {
                        Toast.MakeText(this, "Review Sent", ToastLength.Short).Show();
                    }
                }
            };
        }
Esempio n. 18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.ProfilePage);

            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);



            SetSupportActionBar(mToolbar);


            mBtnChangePassword = FindViewById <Button>(Resource.Id.btnChangePassword);

            mBtnChangePassword.Click += (object sender, EventArgs args) =>
            {
                //Pull up dialog
                FragmentTransaction    transaction    = FragmentManager.BeginTransaction(); //This pulls up the dialog
                dialog_Change_Password changePassword = new dialog_Change_Password();
                changePassword.Show(transaction, "dialog fragment");
            };

            mDrawerToggle = new MyActionBarDrawerToggle(
                this,                                       //Host Activity
                mDrawerLayout,                              //DrawerLayout
                Resource.String.openDrawer,                 //Opened Message
                Resource.String.closeDrawer                 //Closed Message
                );
            mDrawerLayout.SetDrawerListener(mDrawerToggle); //gives drawer toggle permission to call the methods
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            mDrawerToggle.SyncState();

            mNavView  = FindViewById <NavigationView>(Resource.Id.nav_view);
            mHomeItem = FindViewById <AdapterView>(Resource.Id.nav_home);
            mNavView.NavigationItemSelected += MNavView_NavigationItemSelected;

            if (bundle != null)
            {
                if (bundle.GetString("DrawerState") == "Opened")
                {
                    SupportActionBar.SetTitle(Resource.String.openDrawer);
                }
                else
                {
                    SupportActionBar.SetTitle(Resource.String.closeDrawer);
                }
            }
            else
            {
                //first time activity is ran
                SupportActionBar.SetTitle(Resource.String.closeDrawer);
            }
        }
Esempio n. 19
0
        private void SetToggle(ActionBarDrawerToggle toggle)
        {
            _drawer.SetDrawerListener(toggle);

            toggle.SyncState();

            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
        }
Esempio n. 20
0
        private void InitDrawerLayout()
        {
            DrawerLayout          mDrawerLayout = (DrawerLayout)FindViewById(Resource.Id.drawer_layout);
            ActionBarDrawerToggle mDrawerToggle = new NewActionBarDrawerToggle(this, mDrawerLayout,
                                                                               toolbar, Resource.String.app_name, Resource.String.app_name);

            mDrawerToggle.SyncState();
            mDrawerLayout.SetDrawerListener(mDrawerToggle);
        }
Esempio n. 21
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ConfigTables);
            suppToolbar         = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            drawerLayout        = FindViewById <DrawerLayout>(Resource.Id.Drawer);
            viewDrawer          = FindViewById <ListView>(Resource.Id.ListView);
            mUserName           = FindViewById <TextView>(Resource.Id.drawerUsername);
            mUserNameAndSurname = FindViewById <TextView>(Resource.Id.drawerUserNameSurname);

            if (SupportFragmentManager.FindFragmentByTag("Fragment1") != null)
            {
                mFragmentConfigTables = SupportFragmentManager.FindFragmentByTag("Fragment1") as FragmentConfigTablesAndColumns;
            }
            else
            {
                mFragmentConfigTables = new FragmentConfigTablesAndColumns();
                mFragmentParameters   = new FragmentParameters();

                var trans = SupportFragmentManager.BeginTransaction();
                trans.Add(Resource.Id.fragmentContainer, mFragmentConfigTables, "Fragment1");
                trans.Commit();

                mCurrentFragment = mFragmentConfigTables;
            }

            ISharedPreferences preferences = Application.Context.GetSharedPreferences("RememberMe", FileCreationMode.Private);
            string             UserName    = preferences.GetString("UserName", "");
            string             Name        = preferences.GetString("Name", "");
            string             Surname     = preferences.GetString("Surname", "");

            mUserName.Text           = UserName;
            mUserNameAndSurname.Text = Name + " " + Surname;

            listDrawer = new List <string>();
            listDrawer.Add("Configuration columns");
            listDrawer.Add("Configuration table");
            listDrawer.Add("Stats columns");
            listDrawer.Add("Stats tables");
            listDrawer.Add("User table");

            adapterDrawer      = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, listDrawer);
            viewDrawer.Adapter = adapterDrawer;

            viewDrawer.ItemClick += ViewDrawer_ItemClick;

            SetSupportActionBar(suppToolbar);

            drawerToogle = new MyActionBarDrawerToggle(this /*host*/, drawerLayout, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.SetDrawerListener(drawerToogle);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            drawerToogle.SyncState();
        }
Esempio n. 22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.MainLayout);

            // inject views
            Geneticist.Splice(this);

            // set up chrome
            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, Resource.String.drawer_open, Resource.String.drawer_close);
            drawerLayout.SetDrawerListener(drawerToggle);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            //var styledAttributes = Theme.ObtainStyledAttributes(new[] { Android.Resource.Attribute.ActionBarSize });
            //var actionBarSize = (int)styledAttributes.GetDimension(0, 0);
            //styledAttributes.Recycle();

            // set up list view
            stickyList.EmptyView = FindViewById(Resource.Id.empty);
            stickyList.DrawingListUnderStickyHeader = true;
            stickyList.AreHeadersSticky             = true;
            stickyList.StickyHeaderTopOffset        = 0;// -20;
            stickyList.AddHeaderView(LayoutInflater.Inflate(Resource.Layout.ListHeader, null));
            stickyList.AddFooterView(LayoutInflater.Inflate(Resource.Layout.ListFooter, null));
            stickyList.ItemClick += (sender, e) =>
                                    Toast.MakeText(this, "Item " + e.Position + " clicked!", ToastLength.Short).Show();
            stickyList.HeaderClick += (sender, e) =>
                                      Toast.MakeText(this, "Header " + e.HeaderId + " currentlySticky ? " + e.CurrentlySticky, ToastLength.Short).Show();
            stickyList.StickyHeaderChanged       += (sender, e) => ViewHelper.SetAlpha(e.Header, 1);
            stickyList.StickyHeaderOffsetChanged += (sender, e) =>
            {
                if (fadeHeader)
                {
                    ViewHelper.SetAlpha(e.Header, 1 - (e.Offset / (float)e.Header.MeasuredHeight));
                }
            };

            // set up data
            adapter            = new StickyAdapter(this);
            stickyList.Adapter = adapter;

            // actions
            openExpandableListButton.Click += (sender, e) => StartActivity(new Intent(this, typeof(ExpandableListActivity)));
            restoreButton.Click            += (sender, e) => adapter.Restore();
            updateButton.Click             += (sender, e) => adapter.NotifyDataSetChanged();
            clearButton.Click                += (sender, e) => adapter.Clear();
            stickyCheckBox.CheckedChange     += (sender, e) => stickyList.AreHeadersSticky = e.IsChecked;
            fadeCheckBox.CheckedChange       += (sender, e) => fadeHeader = e.IsChecked;
            drawBehindCheckBox.CheckedChange += (sender, e) => stickyList.DrawingListUnderStickyHeader = e.IsChecked;
            fastScrollCheckBox.CheckedChange += (sender, e) =>
            {
                stickyList.SetFastScrollEnabled(e.IsChecked);
                stickyList.FastScrollAlwaysVisible = e.IsChecked;
            };
        }
Esempio n. 23
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.SearchPage);

            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolbar_search);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout_search);

            SetSupportActionBar(mToolbar);



            FragmentTransaction transaction = FragmentManager.BeginTransaction();
            SlidingTabsFragment fragment    = new SlidingTabsFragment();

            transaction.Replace(Resource.Id.search_fragment, fragment);
            transaction.Commit();
            try
            {
                mDrawerToggle = new MyActionBarDrawerToggle(
                    this,                                       //Host Activity
                    mDrawerLayout,                              //DrawerLayout
                    Resource.String.openDrawer,                 //Opened Message
                    Resource.String.closeDrawer                 //Closed Message
                    );
                mDrawerLayout.SetDrawerListener(mDrawerToggle); //gives drawer toggle permission to call the methods
                SupportActionBar.SetHomeButtonEnabled(true);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetDisplayShowTitleEnabled(true);
                mDrawerToggle.SyncState();
            }
            catch
            {
            }

            mNavView  = FindViewById <NavigationView>(Resource.Id.nav_view_search);
            mHomeItem = FindViewById <AdapterView>(Resource.Id.nav_home);
            mNavView.NavigationItemSelected += MNavView_NavigationItemSelected;

            if (bundle != null)
            {
                if (bundle.GetString("DrawerState") == "Opened")
                {
                    SupportActionBar.SetTitle(Resource.String.openDrawer);
                }
                else
                {
                    SupportActionBar.SetTitle(Resource.String.closeDrawer);
                }
            }
            else
            {
                //first time activity is ran
                SupportActionBar.SetTitle(Resource.String.closeDrawer);
            }
        }
Esempio n. 24
0
        private void SetUpSlideMenu(NavigationView mNavigationView)
        {
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, mDrawerLayout, setUpToolbar(), Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            mDrawerLayout.SetDrawerListener(toggle);
            toggle.SyncState();

            mNavigationView.NavigationItemSelected += (object sender, NavigationView.NavigationItemSelectedEventArgs e) =>
            {
                e.MenuItem.SetChecked(true);
                onOptionsItemSelected(e.MenuItem);
                mDrawerLayout.CloseDrawers();
            };

            // Poner título de la cabecera
            View headerView = mNavigationView.InflateHeaderView(Resource.Layout.cabecera_nav);

            headerView.FindViewById <TextView>(Resource.Id.nav_drawer_texto_nombre).Text = user.Nombre;
            headerView.FindViewById <TextView>(Resource.Id.nav_drawer_texto_perfil).Text = user.Perfil;
            headerView.FindViewById <TextView>(Resource.Id.nav_drawer_texto_cuenta).Text = user.Cuenta;

            if (user.Perfil != "")
            {
                switch (user.Perfil)
                {
                case PERFIL_DESARROLLADOR:
                    Log.Info(TAG, "Menu de perfil de supervisor");
                    mNavigationView.InflateMenu(Resource.Menu.menu_nav_drawer_developer);
                    break;

                case PERFIL_SUPERVISOR:
                    Log.Info(TAG, "Menu de perfil de supervisor");
                    mNavigationView.InflateMenu(Resource.Menu.menu_nav_drawer_supervisor);
                    break;

                case PERFIL_RESPONSABLE:
                    Log.Info(TAG, "Menu de perfil de supervisor");
                    mNavigationView.InflateMenu(Resource.Menu.menu_nav_drawer_supervisor);
                    break;

                case PERFIL_CONDUCTOR:
                    Log.Info(TAG, "Menu de perfil de conductor");
                    mNavigationView.InflateMenu(Resource.Menu.menu_nav_drawer_driver);
                    break;

                case PERFIL_VIGILANTE:
                    Log.Info(TAG, "Menu de perfil de vigilante");
                    mNavigationView.InflateMenu(Resource.Menu.menu_nav_drawer_guard);
                    break;

                default:
                    Log.Info(TAG, "No Hay Menu");
                    throw new Java.Lang.RuntimeException("Perfil de usuario no encontrado.");
                }
            }
        }
Esempio n. 25
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.main);

            sections = Resources.GetTextArray(Resource.Array.drawer_sections);

            currentSectionTitle = drawerTitle = Title;

            drawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            drawerListView = FindViewById <ListView>(Resource.Id.left_drawer);

            drawerListView.Adapter = new ArrayAdapter <string>(this, Resource.Layout.item_menu, sections);

            drawerListView.ItemClick += (sender, args) => ListItemClicked(args.Position);


            drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow_light, (int)GravityFlags.Start);



            //DrawerToggle is the animation that happens with the indicator next to the actionbar
            drawerToggle = new DrawerToggle(this, drawerLayout,
                                            Resource.Drawable.ic_navigation_drawer_light,
                                            Resource.String.drawer_open,
                                            Resource.String.drawer_close);

            //Display the current fragments title and update the options menu
            drawerToggle.DrawerClosed += (o, args) =>
            {
                ActionBar.Title = currentSectionTitle;
                InvalidateOptionsMenu();
            };

            //Display the drawer title and update the options menu
            drawerToggle.DrawerOpened += (o, args) =>
            {
                ActionBar.Title = drawerTitle;
                InvalidateOptionsMenu();
            };

            //Set the drawer lister to be the toggle.
            drawerLayout.SetDrawerListener(drawerToggle);



            //If first time you will want to go ahead and click first item.
            if (savedInstanceState == null)
            {
                ListItemClicked(0);
            }


            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Home1);
            user = JsonConvert.DeserializeObject <User>(Intent.GetStringExtra("User"));

            userItem.Name = user.Name;

            CheckUser();
            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer   = FindViewById <ListView>(Resource.Id.left_drawer);

            SetSupportActionBar(mToolbar);


            TextView Name = FindViewById <TextView>(Resource.Id.textViewName);

            Name.Text = HomeActivity1.userItem.Name;

            var textImage = FindViewById <TextView>(Resource.Id.imageViewProfile);

            if (userItem.Color == null)
            {
                userItem.Color = GetRandomColor();
                CheckUser();
            }

            textImage.SetBackgroundColor(Color.ParseColor(userItem.Color));
            textImage.Text = Name.Text[0].ToString().ToUpper();

            LeftDrawerAdapter adapter = new LeftDrawerAdapter(this);

            mLeftDrawer.Adapter = adapter;

            mLeftDrawer.ItemClick += (sender, e) =>
            {
                string str = mLeftDrawer.GetItemAtPosition(e.Position).ToString();
                mLeftDrawerItemClicked(str);
            };

            mDrawerToggle = new MyActionBarDrawerToggle(
                this,                           //Host Activity
                mDrawerLayout,                  //DrawerLayout
                Resource.String.openDrawer,     //Opened Message
                Resource.String.closeDrawer     //Closed Message
                );

            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            mDrawerToggle.SyncState();

            GetFriendList();
        }
Esempio n. 27
0
    protected override void OnCreate(Bundle savedInstanceState)
    {
      base.OnCreate(savedInstanceState);
      SetContentView(Resource.Layout.main);

      sections = Resources.GetTextArray(Resource.Array.drawer_sections);

      currentSectionTitle = drawerTitle = Title;

      drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
      drawerListView = FindViewById<ListView>(Resource.Id.left_drawer);

      drawerListView.Adapter = new ArrayAdapter<string>(this, Resource.Layout.item_menu, sections);

      drawerListView.ItemClick += (sender, args) => ListItemClicked(args.Position);


      drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);



      //DrawerToggle is the animation that happens with the indicator next to the actionbar
      drawerToggle = new DrawerToggle(this, drawerLayout,
                                                Resource.Drawable.ic_drawer_light,
                                                Resource.String.drawer_open,
                                                Resource.String.drawer_close);

      //Display the current fragments title and update the options menu
      drawerToggle.DrawerClosed += (o, args) =>
      {
        ActionBar.Title = currentSectionTitle;
        InvalidateOptionsMenu();
      };

      //Display the drawer title and update the options menu
      drawerToggle.DrawerOpened += (o, args) =>
      {
        ActionBar.Title = drawerTitle;
        InvalidateOptionsMenu();
      };

      //Set the drawer lister to be the toggle.
      drawerLayout.SetDrawerListener(drawerToggle);



      //If first time you will want to go ahead and click first item.
      if (savedInstanceState == null)
      {
        ListItemClicked(0);
      }


      ActionBar.SetDisplayHomeAsUpEnabled(true);
      ActionBar.SetHomeButtonEnabled(true);
    }
Esempio n. 28
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetTheme(Resource.Style.MyTheme);
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            SetContentView(Resource.Layout.Form_Room_List);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);


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

            SetSupportActionBar(toolbar);
            this.SupportActionBar.SetHomeButtonEnabled(true);
            this.SupportActionBar.SetDisplayHomeAsUpEnabled(true);


            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;
            navigationView.SetCheckedItem(Resource.Id.nav_rooms);


            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();

            Rooms_Finder rf   = new Rooms_Finder();
            string       text = Intent.GetStringExtra("Data") ?? "Data not available";

            List <Campus_Harburg_Core.Struct_Room> list;

            try
            {
                list = rf.dataToList(text);
            }
            catch (Exception ex)
            {
                list = new List <Struct_Room>();


                Struct_Room msg = new Struct_Room();
                msg.building = "Fehler";
                msg.name     = "Während der Verarbeitung der Daten ist leider ein Fehler aufgetreten!";
                msg.time     = ex.Message;
                list.Add(msg);
            }

            list.Sort((s1, s2) => s1.building.CompareTo(s2.building));
            listView = FindViewById <ListView>(Resource.Id.List);

            listView.Adapter    = new ListAdapter_Rooms(this, list);
            listView.ItemClick += OnListItemClick;
        }
Esempio n. 29
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.user);
            // Create your application here

            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolBar);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.Drawer_layout);
            mLeftDrawer   = FindViewById <ListView>(Resource.Id.left_drawer);

            SetSupportActionBar(mToolbar);
            var trans = SupportFragmentManager.BeginTransaction();
            SlidingTabsFragment fragment = new SlidingTabsFragment();

            trans.Add(Resource.Id.sample_content_fragment, fragment);
            trans.Commit();



            mLeftDataSet = new List <string>();
            mLeftDataSet.Add("Расписание");
            //mLeftDataSet.Add("Преподаватели");
            mLeftDataSet.Add("Напоминание");
            // mLeftDataSet.Add("Местоположение");
            mLeftDataSet.Add("Выход");
            mLeftAdapter        = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet);
            mLeftDrawer.Adapter = mLeftAdapter;
            mDrawerToggle       = new MyActionBarDrawerToggle(
                this,                       //host activity
                mDrawerLayout,              //DrawerLayout
                Resource.String.raspisanie, //открыто сообщение
                Resource.String.raspisanie  //зактрыто сообщение
                );

            mLeftDrawer.ItemClick += mLeftDrawer_ItemClick;

            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            mDrawerToggle.SyncState();
            //////////////
            FIO       = Intent.GetStringExtra("fio");
            ID_gruppi = Intent.GetIntExtra("id_gruppi", 1);
            student1 ts = new student1();

            ts.ID_GRUPPI(ID_gruppi);
            if (student1.flag == 0)
            {
                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                alert.SetMessage("Здравствуйте " + FIO);
                Dialog dialog = alert.Create();
                dialog.Show();
                student1.flag++;
            }
        }
 void SetupNavigationDrawer()
 {
     SupportActionBar.SetDisplayHomeAsUpEnabled (true);
     SupportActionBar.SetHomeButtonEnabled (true);
     NavigationDrawer = FindViewById<DrawerLayout> (Resource.Id.NavigationDrawer);
     DrawerToggle = new ActionBarDrawerToggle (this, NavigationDrawer, Toolbar,
         Resource.String.label_open_navigation, Resource.String.label_close_navigation);
     NavigationDrawer.SetDrawerListener (DrawerToggle);
     DrawerToggle.SyncState ();
 }
        protected void SetupNavigationDrawer()
        {
            drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            drawerToggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.open, Resource.String.close);
            drawer.SetDrawerListener(drawerToggle);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
        }
Esempio n. 32
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            mTitle       = Resources.GetString(Resource.String.system_overview);
            mDrawerTitle = Resources.GetString(Resource.String.app_name);

            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mNavView      = FindViewById <NavigationView>(Resource.Id.nav_view);

            // set a custom shadow that overlays the main content when the drawer opens
            mDrawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow, GravityCompat.Start);

            // enable ActionBar app icon to behave as action to toggle nav drawer
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // ActionBarDrawerToggle ties together the the proper interactions
            // between the sliding drawer and the action bar app icon
            mDrawerToggle = new CustomActionBarDrawerToggle(
                this,                        /* host Activity */
                mDrawerLayout,               /* DrawerLayout object */
                Resource.String.drawer_open, /* "open drawer" description for accessibility */
                Resource.String.drawer_close /* "close drawer" description for accessibility */
                );

            mDrawerLayout.SetDrawerListener(mDrawerToggle);

            mNavView.SetNavigationItemSelectedListener(this);
            FragmentManager.AddOnBackStackChangedListener(this);

            if (savedInstanceState == null)
            {
                ShowSystemOverview();
            }

            if (Intent.Extras != null)
            {
                foreach (var key in Intent.Extras.KeySet())
                {
                    var value = Intent.Extras.GetString(key);
                    Log.Debug(TAG, "Key: {0} Value: {1}", key, value);
                }
            }

            var playAvailable = IsPlayServicesAvailable();

            if (playAvailable)
            {
                FirebaseApp.InitializeApp(this);
                Log.Debug(TAG, "InstanceID token: " + FirebaseInstanceId.Instance.Token);
                Log.Debug(TAG, "google app id: " + Resource.String.google_app_id);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.mainlist_layout);

            _sortByAll      = FindViewById <TextView>(Resource.Id.sort_all);
            _sortByApproved = FindViewById <TextView>(Resource.Id.sort_approved);
            _sortByClosed   = FindViewById <TextView>(Resource.Id.sort_closed);

            _fabButton = FindViewById <FloatingActionButton>(Resource.Id.fab);

            _recyclerView  = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _layoutManager = new LinearLayoutManager(this);
            _recyclerView.SetLayoutManager(_layoutManager);
            _adapter = new VacationsAdapter(_recyclerView);
            _recyclerView.SetAdapter(_adapter);

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

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(true);

            _drawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            _navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            var swipeHandler    = new SwipeToDeleteCallback(0, ItemTouchHelper.Left, this, _adapter);
            var itemTouchHelper = new ItemTouchHelper(swipeHandler);

            itemTouchHelper.AttachToRecyclerView(_recyclerView);

            _drawerToggle = new MyActionBarDrawerToggle(
                this,
                _drawerLayout,
                Resource.String.openDrawer,
                Resource.String.closeDrawer
                );
            _drawerLayout.SetDrawerListener(_drawerToggle);
            _drawerToggle.SyncState();

            _sortByApproved.Click += (s, e) =>
            {
                _drawerLayout.CloseDrawers();
            };
            _sortByClosed.Click += (s, e) =>
            {
                _drawerLayout.CloseDrawers();
            };
            _sortByAll.Click += (s, e) =>
            {
                _drawerLayout.CloseDrawers();
            };
        }
Esempio n. 34
0
        private void InitView()
        {
            SetSupportActionBar(Toolbar);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,
                                                                     Drawer, Toolbar, Resource.String.open, Resource.String.close);

            Drawer.SetDrawerListener(toggle);
            toggle.SyncState();
            NavigationView.SetNavigationItemSelectedListener(this);
            NavigationView.SetCheckedItem(Resource.Id.nav_all_sessions);
        }
Esempio n. 35
0
        protected override void OnCreateActivity(Bundle bundle)
        {
            base.OnCreateActivity(bundle);

            SetContentView(Resource.Layout.MainDrawerActivity);

            DrawerListView            = FindViewById <ListView> (Resource.Id.DrawerListView);
            DrawerListView.Adapter    = drawerAdapter = new DrawerListAdapter();
            DrawerListView.ItemClick += OnDrawerListViewItemClick;

            DrawerLayout = FindViewById <DrawerLayout> (Resource.Id.DrawerLayout);
            DrawerToggle = new ActionBarDrawerToggle(this, DrawerLayout, Resource.Drawable.IcDrawer, Resource.String.EntryName, Resource.String.EntryName);

            DrawerLayout.SetDrawerShadow(Resource.Drawable.drawershadow, (int)GravityFlags.Start);
            DrawerLayout.SetDrawerListener(DrawerToggle);

            Timer.OnCreate(this);
            var lp = new ActionBar.LayoutParams(ActionBar.LayoutParams.WrapContent, ActionBar.LayoutParams.WrapContent);

            lp.Gravity = GravityFlags.Right | GravityFlags.CenterVertical;

            var bus = ServiceContainer.Resolve <MessageBus> ();

            drawerSyncStarted  = bus.Subscribe <SyncStartedMessage> (SyncStarted);
            drawerSyncFinished = bus.Subscribe <SyncFinishedMessage> (SyncFinished);

            DrawerSyncView = FindViewById <FrameLayout> (Resource.Id.DrawerSyncStatus);

            syncRetryButton        = DrawerSyncView.FindViewById <ImageButton> (Resource.Id.SyncRetryButton);
            syncRetryButton.Click += OnSyncRetryClick;

            syncStatusText = DrawerSyncView.FindViewById <TextView> (Resource.Id.SyncStatusText);

            ActionBar.SetCustomView(Timer.Root, lp);
            ActionBar.SetDisplayShowCustomEnabled(true);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            if (bundle == null)
            {
                OpenPage(DrawerListAdapter.TimerPageId);
            }
            else
            {
                // Restore page stack
                pageStack.Clear();
                var arr = bundle.GetIntArray(PageStackExtra);
                if (arr != null)
                {
                    pageStack.AddRange(arr);
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            wIIDBServiceIntent = new Intent(WorkingInetInteractDB.aecServiceIntent);
            downloadedReceiver = new DownloadedReceiver();

            authentication = true;

            SetContentView(Resource.Layout.MainDrawer);
            _title      = _drawerTitle = Title;
            _menuTitles = Resources.GetStringArray(Resource.Array.MenuArray);
            _drawer     = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            _drawerList = FindViewById <ListView>(Resource.Id.left_drawer);

            _drawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);

            _drawerList.Adapter    = new ArrayAdapter <string>(this, Resource.Layout.DrawerListItem, _menuTitles);
            _drawerList.ItemClick += (sender, args) => SelectItem(args.Position);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            //DrawerToggle is the animation that happens with the indicator next to the ActionBar icon. You can choose not to use this.
            _drawerToggle = new MyActionBarDrawerToggle(this, _drawer, Resource.Drawable.ic_drawer_light, Resource.String.DrawerOpen, Resource.String.DrawerClose);


            _drawerToggle.DrawerClosed += delegate      //You can alternatively use _drawer.DrawerClosed here
            {
                ActionBar.Title = _title;
                string visibleFragmentTag = FragmentManager.FindFragmentById(Resource.Id.content_frame).Tag;
                if (visibleFragmentTag == "settingsfragment")
                {
                    ActionBar.Title = GetString(Resource.String.Preferences);
                }
                drawerOpen = false;
                InvalidateOptionsMenu();
            };

            _drawerToggle.DrawerOpened += delegate      //You can alternatively use _drawer.DrawerOpened here
            {
                ActionBar.Title = _drawerTitle;
                drawerOpen      = true;
                InvalidateOptionsMenu();
            };
            _drawer.SetDrawerListener(_drawerToggle);

            //При запуске приложения открывается нулевой элемент из switch'а для Navigation Drawer
            if (null == savedInstanceState)
            {
                SelectItem(0);
            }
        }
Esempio n. 37
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _title        = _drawerTitle = Title;
            _planetTitles = Resources.GetStringArray(Resource.Array.PlanetsArray);
            _drawer       = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            _drawerList   = FindViewById <ListView>(Resource.Id.left_drawer);

            _drawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);

            _drawerList.Adapter = new ArrayAdapter <string>(this,
                                                            Resource.Layout.DrawerListItem, _planetTitles);
            _drawerList.ItemClick += (sender, args) => SelectItem(args.Position);


            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            //DrawerToggle is the animation that happens with the indicator next to the
            //ActionBar icon. You can choose not to use this.
            _drawerToggle = new MyActionBarDrawerToggle(this, _drawer,
                                                        Resource.Drawable.ic_drawer_light,
                                                        Resource.String.DrawerOpen,
                                                        Resource.String.DrawerClose);

            //You can alternatively use _drawer.DrawerClosed here
            _drawerToggle.DrawerClosed += delegate
            {
                ActionBar.Title = _title;
                InvalidateOptionsMenu();
            };

            //You can alternatively use _drawer.DrawerOpened here
            _drawerToggle.DrawerOpened += delegate
            {
                ActionBar.Title = _drawerTitle;
                InvalidateOptionsMenu();
            };

            _drawer.SetDrawerListener(_drawerToggle);

            if (null == savedInstanceState)
            {
                SelectItem(0);
            }
        }
Esempio n. 38
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.HideKeyboard();

            SetContentView(Resource.Layout.main_activity);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.myDrawer);


            mDrawerToggle = new Android.Support.V7.App.ActionBarDrawerToggle(this, mDrawerLayout, Resource.String.open_drawer, Resource.String.close_drawer);
            mDrawerToggle.DrawerIndicatorEnabled = true;

            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            mDrawerToggle.SyncState();

            if (ChadderApp.UIHelper.Source.IsOnline == false)
            {
                ChadderApp.UIHelper.Source_OnNotAuthorized();
            }
            else
            {
                if (fragmentNavigater == null)
                {
                    fragmentNavigater = new ProfileFragment();
                    SupportFragmentManager.BeginTransaction().Replace(Resource.Id.navigation_drawer, fragmentNavigater).Commit();
                }
                if (this.Intent.GetBooleanExtra("new_user", false))
                {
                    SupportFragmentManager.BeginTransaction()
                    .Replace(Resource.Id.content_frame, new RegisterNameFragment())
                    .Commit();
                }
                else if (ChadderApp.UIHelper.Source.HasUserKey == false)
                {
                    var newFragment = new NewKeySplashScreenFragment();
                    SupportFragmentManager.BeginTransaction()
                    .Replace(Resource.Id.content_frame, newFragment)
                    .Commit();
                }
                else
                {
                    SupportFragmentManager.BeginTransaction()
                    .Replace(Resource.Id.content_frame, new ConversationListFragment())
                    .Commit();
                }
            }
        }
        //TextView _mainTextView;

        protected override void OnCreate(Bundle savedInstanceState)
        {
            //RequestWindowFeature(Android.Views.WindowFeatures.RightIcon);
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.HomeScreen);

            locationManager = (LocationManager)GetSystemService(Context.LocationService);

            //Create criteria for the location service using the coarse constant
            Criteria criteriaForLocationService = new Criteria
            {
                Accuracy         = Accuracy.Coarse,
                PowerRequirement = Power.Medium
            };

            //Set provider
            provider = locationManager.GetBestProvider(criteriaForLocationService, true);

            Location location = locationManager.GetLastKnownLocation(provider);

            if (location == null)
            {
                System.Diagnostics.Debug.WriteLine("No location");
            }

            _username = Intent.GetStringExtra("username");

            _DrawerLayout = FindViewById <DrawerLayout>(Resource.Id.myDrawer);
            _LeftDrawer   = FindViewById <ListView>(Resource.Id.leftListView);

            TextView txtGreeting = FindViewById <TextView>(Resource.Id.txtGreeting);

            txtGreeting.Text = "Welcome back, " + _username;

            _leftItems.Add("Contacts");
            _leftItems.Add("Midpoint Calculator");
            _leftItems.Add("Edit Profile");

            _DrawerToggle = new HomescreenActionBarDrawerToggle(this, _DrawerLayout, Resource.Drawable.ic_drawer, Resource.String.open_drawer, Resource.String.close_drawer);

            _leftAdapter        = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, _leftItems);
            _LeftDrawer.Adapter = _leftAdapter;

            _DrawerLayout.SetDrawerListener(_DrawerToggle);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            _LeftDrawer.ItemClick += _LeftDrawer_ItemClick;
        }
 protected void SetupDrawer()
 {
     if (drawerToggle == null)
     {
         drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
         drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);
         drawerLayout.SetDrawerListener(drawerToggle);
         drawerToggle.SyncState();
         drawerLayout.DrawerOpened += DrawerLayout_DrawerOpened;
     }
     else
     {
         drawerToggle.SyncState();
     }
 }
Esempio n. 41
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            mToolbar       = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout  = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer    = FindViewById <ListView>(Resource.Id.left_drawer);
            mfragment1     = new Fragments.Fragment1();
            mfragment2     = new Fragments.Fragment2();
            mfragment3     = new Fragments.Fragment3();
            mfragment4     = new Fragments.Fragment4();
            mStackFragment = new Stack <SupportFragment>();
            SetSupportActionBar(mToolbar);

            var trans = SupportFragmentManager.BeginTransaction();

            trans.Add(Resource.Id.fragmentContainer, mfragment4, "fragment4");
            trans.Hide(mfragment4);
            trans.Add(Resource.Id.fragmentContainer, mfragment3, "fragment3");
            trans.Hide(mfragment3);
            trans.Add(Resource.Id.fragmentContainer, mfragment2, "fragment2");
            trans.Hide(mfragment2);
            trans.Add(Resource.Id.fragmentContainer, mfragment1, "fragment1");

            trans.Commit();

            mCurrentFragment = mfragment1;

            mLeftDataSet = new List <string>();
            mLeftDataSet.Add("Item 1");
            mLeftDataSet.Add("Item 2");
            mLeftAdapter        = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet);
            mLeftDrawer.Adapter = mLeftAdapter;
            mDrawerToogle       = new MyActionBarDrawerToogle(
                this,
                mDrawerLayout,
                Resource.String.openDrawer,
                Resource.String.closeDrawer
                );

            mDrawerLayout.SetDrawerListener(mDrawerToogle);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            mDrawerToogle.SyncState();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _title = _drawerTitle = Title;
            _planetTitles = Resources.GetStringArray(Resource.Array.PlanetsArray);
            _drawer = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            _drawerList = FindViewById<ListView>(Resource.Id.left_drawer);

            _drawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);
            
            _drawerList.Adapter = new ArrayAdapter<string>(this,
                Resource.Layout.DrawerListItem, _planetTitles);
            _drawerList.ItemClick += (sender, args) => SelectItem(args.Position);


            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            //DrawerToggle is the animation that happens with the indicator next to the
            //ActionBar icon. You can choose not to use this.
            _drawerToggle = new MyActionBarDrawerToggle(this, _drawer,
                                                      Resource.Drawable.ic_drawer_light,
                                                      Resource.String.DrawerOpen,
                                                      Resource.String.DrawerClose);

            //You can alternatively use _drawer.DrawerClosed here
            _drawerToggle.DrawerClosed += delegate
            {
                ActionBar.Title = _title;
                InvalidateOptionsMenu();
            };

            //You can alternatively use _drawer.DrawerOpened here
            _drawerToggle.DrawerOpened += delegate
            {
                ActionBar.Title = _drawerTitle;
                InvalidateOptionsMenu();
            };

            _drawer.SetDrawerListener(_drawerToggle);

            if (null == savedInstanceState)
                SelectItem(0);
        }
Esempio n. 43
0
		#pragma warning restore 414

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.HomeView);

			mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer);
			mDrawerView = FindViewById (Resource.Id.items);
			mDrawerToggle = new ActionBarDrawerToggle (this, mDrawerLayout, Resource.Drawable.ic_navigation_drawer, 0, 0);
			mDrawerLayout.SetDrawerListener (mDrawerToggle);

			ActionBar.SetHomeButtonEnabled (true);
			ActionBar.SetDisplayHomeAsUpEnabled (true);

			_closeDrawerToken = Mvx.Resolve<IMvxMessenger> ().SubscribeOnMainThread<CloseDrawerMessage> (
				message => mDrawerLayout.CloseDrawer (mDrawerView));     
		}
Esempio n. 44
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.MySoal_MainPager);

			adapter = new MySoal_ViewPagerAdapter (SupportFragmentManager);

			mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.myDrawer);
			mDrawerToggle = new Android.Support.V7.App.ActionBarDrawerToggle (this, mDrawerLayout, Resource.String.open_drawer, Resource.String.close_drawer);
			mDrawerLayout.SetDrawerListener (mDrawerToggle);

			leftListView = (LinearLayout)FindViewById (Resource.Id.leftListView);
			lvMMLListed = (ListView)FindViewById (Resource.Id.lvMMLListed);

			pager = FindViewById <ViewPager> (Resource.Id.pager);
			pager.Adapter = adapter;

			tabs = FindViewById<MySoal_SlidingTabScrollView> (Resource.Id.tabs);
			tabs.ViewPager = pager;

			toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.app_bar);
			toolbar.SetBackgroundColor (Color.ParseColor ("#F44336"));

			SetSupportActionBar (toolbar);
			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
			SupportActionBar.SetHomeButtonEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled (true);

			MenuListItem = new List<LeftMenuListItems> ();

			MenuListItem.Add (new LeftMenuListItems(){ 
				LeftMenuDrawerLabel = "Dashboard",
				LeftMenuDrawerIconID = Resource.Drawable.home3 });
			MenuListItem.Add (new LeftMenuListItems(){ 
				LeftMenuDrawerLabel = "My Soal",
				LeftMenuDrawerIconID = Resource.Drawable.cup2 });
			MenuListItem.Add (new LeftMenuListItems(){ 
				LeftMenuDrawerLabel = "My Health",
				LeftMenuDrawerIconID = Resource.Drawable.heart2 });
			MenuListItem.Add (new LeftMenuListItems(){ 
				LeftMenuDrawerLabel = "My Skool",
				LeftMenuDrawerIconID = Resource.Drawable.shield2 });

			lvMMLListed.Adapter = new MainActivityAdapters (this, MenuListItem);

		}
Esempio n. 45
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            // Init toolbar
            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            // Attach item selected handler to navigation view
            var navigationView = FindViewById<NavigationView>(Resource.Id.nav_view);
            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            // Create ActionBarDrawerToggle button and add it to the toolbar
            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);
            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();
        }
Esempio n. 46
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.catalog);
            mListView = FindViewById<ListView>(Resource.Id.myListView);

            categoryId = int.Parse(Intent.GetStringExtra("CategoryId") ?? "0");

            Button btnActivate = FindViewById<Button>(Resource.Id.btnActivate);
            Button btnTrain = FindViewById<Button>(Resource.Id.btnTrain);
            Button btnRecover = FindViewById<Button>(Resource.Id.btnRecover);
            #region DrawableLayout
            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.myDrawer);
            leftListView = FindViewById<ListView>(Resource.Id.leftListView);
            leftItems = MenuRepository.GetMenuItems();
            _navigation = MenuRepository.GetMenuItemsWithUri();
            drawerToggle = new MyActionBarDrawerToggle(this, drawerLayout, Resource.Drawable.menu, Resource.String.open_drawer, Resource.String.close_drawer);

            leftAdapater = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, leftItems);
            leftListView.Adapter = leftAdapater;
            leftListView.ItemClick += (sender, args) => leftListItemClicked(args.Position);
            drawerLayout.SetDrawerListener(drawerToggle);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayShowTitleEnabled(true);
            ActionBar.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.logo));

            #endregion

            btnActivate.Click += (object sender, EventArgs args) =>
            {
                GetList(1, subCategoryId);
            };
            btnTrain.Click += (object sender, EventArgs e) =>
            {
                GetList(2, subCategoryId);
            };
            btnRecover.Click += (object sender, EventArgs e) =>
            {
                GetList(3, subCategoryId);
            };
            SetTab(categoryId);
        }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			drawer =  FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			imageView =FindViewById<ImageView>(Resource.Id.drawer_indicator);
			styleButton = FindViewById<TextView>(Resource.Id.indicator_style);
			Resources resources = Resources;

			drawerArrowDrawable = new DrawerArrowDrawable(resources);
			drawerArrowDrawable.setStrokeColor(resources.GetColor(Resource.Color.light_gray));
			imageView.SetImageDrawable (drawerArrowDrawable);

			drawer.SetDrawerListener (this);
			imageView.Click += ImageClickHandle ;
			styleButton.Click += TextviewClickHandle;
		}
Esempio n. 48
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.Main);

			drawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);
			drawerLayout.SetDrawerShadow (Resource.Drawable.drawer_shadow, (int)GravityFlags.Start);

			drawerToggle = new ActionBarDrawerToggle (this, drawerLayout, Resource.Drawable.ic_drawer, Resource.String.drawer_open, Resource.String.drawer_close);
			drawerLayout.SetDrawerListener (drawerToggle);

			drawerList = FindViewById<ListView> (Resource.Id.flyout);
			drawerList.Adapter = new ArrayAdapter<string> (this, Resource.Layout.drawer_list_item, sections);

			drawerList.ItemClick += (sender, e) => ListItemClicked (e.Position);
			ListItemClicked (0);

			// Enabling the home button as "up" will show a "go back button" by default. This will be changed by the drawer into a "hamburger" button.
			// This will also implicitly enable the home button (http://developer.android.com/reference/android/support/v7/app/ActionBar.html#setHomeButtonEnabled(boolean)).
			ActionBar.SetDisplayHomeAsUpEnabled (true);
		}
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Main);

			drawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);
			drawerLayout.SetDrawerShadow (Resource.Drawable.drawer_shadow, (int)GravityFlags.Start);
			drawerList = FindViewById<ListView> (Resource.Id.flyout);
			drawerList.Adapter = new ArrayAdapter<string> (this, Resource.Layout.drawer_list_item, sections);


			drawerToggle = new ActionBarDrawerToggle (this, drawerLayout, Resource.String.drawer_open, Resource.String.drawer_close);

			drawerLayout.SetDrawerListener (drawerToggle);

			drawerList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => ListItemClicked (e.Position);
			ListItemClicked (0);

			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
		}
Esempio n. 50
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);
            SetContentView (Resource.Layout.mainDrawer);
            drawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);

            var toolbar = FindViewById<Toolbar> (Resource.Id.appBar);
            SetSupportActionBar (toolbar);
            SupportActionBar.SetTitle (Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            SupportActionBar.SetDisplayUseLogoEnabled (true);

            navigationView = FindViewById<NavigationView> (Resource.Id.nav_view);
            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            var drawerToggle = new ActionBarDrawerToggle (this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);
            drawerLayout.SetDrawerListener (drawerToggle);
            drawerToggle.SyncState ();

            var user= Intent.GetStringExtra("user");
            var key = Intent.GetStringExtra("key");
        }
Esempio n. 51
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     // Set our view from the "main" layout resource
     SetContentView (Resource.Layout.Main);
     mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.myMenuDrawer);
     mLeftDrawer = FindViewById<RelativeLayout> (Resource.Id.left_fragment_container);
     mainContainer = FindViewById<FrameLayout> (Resource.Id.framelayout_maincontainer);
     //set icon for Drawer
     mDrawerToggle = new ActionBarDrawerToggle(this,mDrawerLayout,Resource.Drawable.Menu,Resource.String.Open_Drawer, Resource.String.Close_Drawer);
     mDrawerLayout.SetDrawerListener (mDrawerToggle);
     ActionBar.SetDisplayHomeAsUpEnabled (true);
     ActionBar.SetHomeButtonEnabled (true);
     ActionBar.SetDisplayShowHomeEnabled (true);
     //Hide the Application icon
     ActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent)));
     ActionBar.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.topbar));
     mLeftDrawer.BringToFront ();
     BindSideMenuClickEvents();
     //Call My Events initially
     CallFragment(1);
 }
Esempio n. 52
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.przegladKategori);
            // opcje oraz koszyk
            mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.myDrawer);
            mLeftDrawer = FindViewById<ListView>(Resource.Id.leftListView);
            mRightDrawer = FindViewById<ListView>(Resource.Id.rightListView);

            mLeftDrawer.Tag = 0;
            mRightDrawer.Tag = 1;

            mLeftItems.Add("Opcje");
            mLeftItems.Add("do dodania");

            mRightItems.Add("przedmiot 1");
            mRightItems.Add("przedmiot 2");
            mRightItems.Add("przycisk do przejscia do prownania");

            mDrawerToggle = new MyActionBarDrawerToggle(this, mDrawerLayout, Resource.Drawable.ic_navigation_drawer, Resource.String.open_drawer, Resource.String.close_drawer);

            mLeftAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, mLeftItems);
            mLeftDrawer.Adapter = mLeftAdapter;

            mRightAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, mRightItems);
            mRightDrawer.Adapter = mRightAdapter;

            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.SetDisplayShowTitleEnabled(true);

            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            SlidingTabsFragment fragment = new SlidingTabsFragment();
            transaction.Replace(Resource.Id.sample_content_fragment, fragment);
            transaction.Commit();
        }
Esempio n. 53
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.Dashboard);

            studentID = Intent.Extras.GetString ("studentID");

            mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.dashboardDrawer);
            mToolbar = FindViewById<SupportToolbar> (Resource.Id.toolbar);

            // Set up the fragments
            mFriends = new FriendsFragment();
            mProfile = new ProfilePageFragment ();
            mBed = new AccommodationFragment ();
            mHousemate = new FindHousemateFragment ();

            // Set up userIdHolder
            userIDHolder = new Bundle();
            userIDHolder.PutString("studentID", studentID);
            mProfile.Arguments = userIDHolder;
            mFriends.Arguments = userIDHolder;
            mBed.Arguments = userIDHolder;
            mHousemate.Arguments = userIDHolder;

            // Sets up the toggle for the dashboard drawer.
            mDashboardToggle = new DashboardToggle (this, mDrawerLayout, Resource.String.menu_title, mCurrentViewTitle);
            mDrawerLayout.SetDrawerListener (mDashboardToggle);

            // Displays the custom action bar.
            DisplayToolbar (bundle);

            mDashboardToggle.SyncState();

            // Controls the dashboard.
            InflateDashboard();
        }
		protected override void OnCreate (Bundle savedInstanceState)
		{

			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.activity_navigation_drawer);

			mDrawerTitle = this.Title;
			mPlanetTitles = this.Resources.GetStringArray (Resource.Array.planets_array);
			mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);
			mDrawerList = FindViewById<RecyclerView> (Resource.Id.left_drawer);

			// set a custom shadow that overlays the main content when the drawer opens
			mDrawerLayout.SetDrawerShadow (Resource.Drawable.drawer_shadow, GravityCompat.Start);
			// improve performance by indicating the list if fixed size.
			mDrawerList.HasFixedSize = true;
			mDrawerList.SetLayoutManager (new LinearLayoutManager (this));

			// set up the drawer's list view with items and click listener
			mDrawerList.SetAdapter (new PlanetAdapter (mPlanetTitles, this));
			// enable ActionBar app icon to behave as action to toggle nav drawer
			this.ActionBar.SetDisplayHomeAsUpEnabled (true);
			this.ActionBar.SetHomeButtonEnabled (true);

			// ActionBarDrawerToggle ties together the the proper interactions
			// between the sliding drawer and the action bar app icon

			mDrawerToggle = new MyActionBarDrawerToggle (this, mDrawerLayout,
				Resource.Drawable.ic_drawer, 
				Resource.String.drawer_open, 
				Resource.String.drawer_close);

			mDrawerLayout.SetDrawerListener (mDrawerToggle);
			if (savedInstanceState == null) //first launch
				selectItem (0);
					
		}
Esempio n. 55
0
		public override bool OnCreateOptionsMenu (IMenu menu)
		{
			MenuInflater.Inflate (Resource.Layout.action_menu, menu);

			mDrawerLayout = this.FindViewById<DrawerLayout> (Resource.Id.drawer_layout);
			mLeftDrawer = this.FindViewById<LinearLayout> (Resource.Id.left_drawer);
			lvControls = FindViewById<ListView> (Resource.Id.left_drawer_controls);
			mToggle = new MyActionBarDrawerToggle (this, mDrawerLayout, Resource.String.openDrawer, Resource.String.closeDrawer);
			lvControls.Adapter = new ListAdapter(this, GetDrawerOptions());
			lvControls.ItemClick += LvControls_ItemClick;

			mDrawerLayout.SetDrawerListener (mToggle);
			mToggle.SyncState ();

			return base.OnCreateOptionsMenu (menu);
		}
Esempio n. 56
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView(Resource.Layout.TenantSearchView3);

            mButtonDislike = FindViewById<Button>(Resource.Id.buttonDislike);
            mButtonDislike.Click += (object sender, EventArgs args) =>{
                //pull up dialog
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                FeaturePopUpController featurePopUp = new FeaturePopUpController();
                featurePopUp.Show(transaction, "do you like fragment");
                featurePopUp.mFeatureSurveyComplete += mFeaturePopUpButton_Click;
            };

            mButtonLike = FindViewById<Button>(Resource.Id.buttonLike);
            mButtonLike.Click += (object sender, EventArgs args) =>{
                //pull up dialog
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                FeaturePopUpController featurePopUp = new FeaturePopUpController();
                featurePopUp.Show(transaction, "do you like fragment");
                featurePopUp.mFeatureSurveyComplete += mFeaturePopUpButton_Click;
            };
            /************TOOLBAR******************************************************/
            _toolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
            _drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            _leftDrawer = FindViewById<ListView>(Resource.Id.left_drawer);
            _rightDrawer = FindViewById<ListView>(Resource.Id.right_drawer);

            //tag left and right drawer for case statment when clicked
            _leftDrawer.Tag = 0;
            _rightDrawer.Tag = 1;
            //Set action support toolbar with private class variable
            SetSupportActionBar(_toolbar);

            //***********LEFT DATA SET******************************/
            //Left data set, these are the buttons you see when you click on the drawers
            _leftDataSet = new List<string>();
            //my_profile has a string in the string xml file in values directory
            _leftDataSet.Add(GetString(Resource.String.main_menu));
            //log_out has a string in the string xml file in values directory
            _leftDataSet.Add(GetString(Resource.String.log_out));
            _leftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _leftDataSet);
            _leftDrawer.Adapter = _leftAdapter;
            //click event for the left drawer
            this._leftDrawer.ItemClick += LeftDrawerRowClick;

            //***********RIGHT DATA SET******************************/
            _rightDataSet = new List<string>();
            //support has a string in the string xml file in values directory
            _rightDataSet.Add(GetString (Resource.String.help_popup));
            //rentproof has a string in the string xml file in values directory
            _rightDataSet.Add(GetString(Resource.String.support));
            _rightAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _rightDataSet);
            _rightDrawer.Adapter = _rightAdapter;
            this._rightDrawer.ItemClick += RightDrawerRowClick;

            //constructor for navigation bar
            _drawerToggle = new NavigationBar(
                this,							//Host Activity
                _drawerLayout,					//DrawerLayout
                Resource.String.openDrawer,		//Opened Message
                Resource.String.closeDrawer		//Closed Message
            );
            //set drawerlistener
            _drawerLayout.SetDrawerListener(_drawerToggle);
            //set home button
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            _drawerToggle.SyncState();

            if (bundle != null){
                if (bundle.GetString("DrawerState") == "Opened"){
                    SupportActionBar.SetTitle(Resource.String.openDrawer);}
                else{
                    SupportActionBar.SetTitle(Resource.String.closeDrawer);}
            }
            else{
                //This is the first the time the activity is ran
                SupportActionBar.SetTitle(Resource.String.closeDrawer);
            }
            //*****************END OF ONCREATE TOOLBAR***********
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer = FindViewById<ListView>(Resource.Id.left_drawer);
            homeFragment = new HomeFragment();

            profileFragment = new ProfileFragment();
            mStackFragments = new Stack<SupportFragment>();

            mLeftDrawer.Tag = 0;

            SetSupportActionBar(mToolbar);

            mLeftDataSet = new List<string>();
            mLeftDataSet.Add ("Left Item 1");
            mLeftDataSet.Add ("Left Item 2");
            mLeftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet);
            mLeftDrawer.Adapter = mLeftAdapter;
            mLeftDrawer.ItemClick+= MenuListView_ItemClick;

            mDrawerToggle = new MyActionBarDrawerToggle(
                this,							//Host Activity
                mDrawerLayout,					//DrawerLayout
                Resource.String.openDrawer,		//Opened Message
                Resource.String.closeDrawer		//Closed Message
            );

            mDrawerLayout.SetDrawerListener(mDrawerToggle);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            mDrawerToggle.SyncState();

            if (bundle != null)
            {
                if (bundle.GetString("DrawerState") == "Opened")
                {
                    SupportActionBar.SetTitle(Resource.String.openDrawer);
                }

                else
                {
                    SupportActionBar.SetTitle(Resource.String.closeDrawer);
                }
            }

            else
            {
                //This is the first the time the activity is ran
                SupportActionBar.SetTitle(Resource.String.closeDrawer);
            }

            Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction();

            tx.Add(Resource.Id.main, homeFragment);
            tx.Add(Resource.Id.main, profileFragment);
            tx.Hide(profileFragment);

            mCurrentFragment = homeFragment;
            tx.Commit();
        }
Esempio n. 58
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // set our layout to be the home screen
            SetContentView(Resource.Layout.HomeScreen);

            var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            if (toolbar != null)
            {
                SetActionBar(toolbar);
            }

            menuItemsShelves = AllOurVinylManager.GetShelves().Select(x => x.Name).ToArray();

            homeLayout = FindViewById<DrawerLayout>(Resource.Id.home_layout);
            homeLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);

            drawerList = FindViewById<ListView>(Resource.Id.left_drawer);
            drawerList.Adapter = new ArrayAdapter<string>(this, Resource.Layout.DrawerListItem, menuItemsShelves);
            drawerList.ItemClick += (sender, args) => SelectItem(args.Position);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            drawerToggle = new MyActionBarDrawerToggle(this, homeLayout,
                                                      Resource.Drawable.ic_drawer_dark,
                                                      Resource.String.DrawerOpen,
                                                      Resource.String.DrawerClose);

            drawerToggle.DrawerClosed += delegate
            {
                //ActionBar.Title = _title;
                InvalidateOptionsMenu();
            };

            //You can alternatively use _drawer.DrawerOpened here
            drawerToggle.DrawerOpened += delegate
            {
                //ActionBar.Title = _drawerTitle;
                InvalidateOptionsMenu();
            };

            homeLayout.SetDrawerListener(drawerToggle);

            if (null == bundle)
                SelectItem(0);
        }
Esempio n. 59
0
        protected override void OnCreate(Bundle bundle)
        {
			this.Window.AddFlags(WindowManagerFlags.Fullscreen);
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.MainView);

			vm = this.ViewModel as MainViewModel;
			vm.PropertyChanged += Vm_PropertyChanged;
			loWallView = new WallView(this);
			currentIndexLO = 0;

			LinearLayout linearMainLayout = FindViewById<LinearLayout>(Resource.Id.left_drawer);

			/*scrollIndice = new ScrollView (this);
			scrollIndice.LayoutParameters = new ScrollView.LayoutParams (-1,400);
			linearContentIndice = new LinearLayout (this);
			linearContentIndice.LayoutParameters = new LinearLayout.LayoutParams (-1, 800);
			linearContentIndice.Orientation = Orientation.Vertical;
			linearContentIndice.SetBackgroundColor (Color.Red);

			scrollIndice.AddView (linearContentIndice); */


			var metrics = Resources.DisplayMetrics;
			widthInDp = ((int)metrics.WidthPixels);
			heightInDp = ((int)metrics.HeightPixels);
			Configuration.setWidthPixel (widthInDp);
			Configuration.setHeigthPixel (heightInDp);

			task = new TaskView (this);

			iniMenu ();

			mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
			SetSupportActionBar(mToolbar);
			mToolbar.SetNavigationIcon (Resource.Drawable.hamburger);

			mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			mLeftDrawer = FindViewById<LinearLayout>(Resource.Id.left_drawer);
			mRightDrawer = FindViewById<LinearLayout>(Resource.Id.right_drawer);

			mLeftDrawer.Tag = 0;
			mRightDrawer.Tag = 1;

			frameLayout = FindViewById<FrameLayout> (Resource.Id.content_frame);

			main_ContentView = new RelativeLayout (this);
			main_ContentView.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);


			// main_ContentView.AddView (scrollIndice);
			//main_ContentView.AddView(linearContentIndice);

			LOContainerView LOContainer = new LOContainerView (this);

			//main_ContentView.AddView (LOContainer);
			//WallView wallview = new WallView(this);

			//wallview.OpenLO.Click += Lo_ImagenLO_Click;
			//lo.OpenTasks.Click += ListTasks_ItemClick;

			//wallview.OpenChat.Click += imBtn_Chat_Click;
			//wallview.OpenUnits.Click += imBtn_Units_Click;

			loWallView.OpenChat.Click += imBtn_Chat_Click;
			loWallView.OpenUnits.Click += imBtn_Units_Click;

			main_ContentView.AddView (loWallView);


			frameLayout.AddView (main_ContentView);


			RelativeLayout RL = FindViewById<RelativeLayout> (Resource.Id.main_view_relativeLayoutCL);

			Drawable dr = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/nubeactivity.png"), 768, 1024, true));
			RL.SetBackgroundDrawable (dr);

			dr = null;

			//seting up chat view content


			title_view = FindViewById<TextView> (Resource.Id.chat_view_title);


			info1= FindViewById<TextView> (Resource.Id.chat_view_info1);
			info2 = FindViewById<TextView> (Resource.Id.chat_view_info2);
			title_list = FindViewById<TextView> (Resource.Id.chat_list_title);

			mListViewChat = FindViewById<ListView> (Resource.Id.chat_list_view);

			title_view.SetX (Configuration.getWidth(74));
			title_view.SetY (Configuration.getHeight (202));

			title_view.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			title_view.SetTypeface (null, TypefaceStyle.Bold);

			info1.SetX (Configuration.getWidth (76));
			info1.SetY (Configuration.getHeight (250));
			info1.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			info2.SetX (Configuration.getWidth (76));
			info2.SetY (Configuration.getHeight (285));
			info2.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			title_list.SetX (Configuration.getWidth (76));
			title_list.SetY (Configuration.getHeight (391));

			title_list.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			title_list.SetTypeface (null, TypefaceStyle.Bold);

			mListViewChat.SetX (0);
			mListViewChat.SetY (Configuration.getHeight (440));

			//end setting



			linearMainLayout.AddView (mainLayout);

            vm.PropertyChanged += new PropertyChangedEventHandler(logout_propertyChanged);

            RegisterWithGCM();

			mDrawerToggle = new MyActionBarDrawerToggle(
				this,							//Host Activity
				mDrawerLayout,					//DrawerLayout
				Resource.String.openDrawer,		//Opened Message
				Resource.String.closeDrawer		//Closed Message
			);

			mDrawerLayout.SetDrawerListener(mDrawerToggle);
			SupportActionBar.SetHomeButtonEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled(false);

			mDrawerToggle.SyncState();

			if (bundle != null)
			{
				if (bundle.GetString("DrawerState") == "Opened")
				{
					SupportActionBar.SetTitle(Resource.String.openDrawer);
				}

				else
				{
					SupportActionBar.SetTitle(Resource.String.closeDrawer);
				}
			}
			else
			{
				SupportActionBar.SetTitle(Resource.String.closeDrawer);
			}
				
			initListCursos ();
			iniPeoples ();
			initListTasks ();

			//main_ContentView.AddView (scrollIndice);

        }
		private void InitializationDrawer()
		{
			/*
			fDrawer = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			fDrawerListLeft = FindViewById<ListView>(Resource.Id.left_drawer);

			fDrawerListLeft.Adapter = new ArrayAdapter<string>(this, Resource.Layout.item_menu, Sections);

			fDrawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);
			*/

			fTitle = fDrawerTitle = Title;

			fDrawer = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			fDrawerListLeft = FindViewById<ListView>(Resource.Id.left_drawer);

			fDrawerListLeft.Adapter = new ArrayAdapter<string>(this, Resource.Layout.item_menu, Sections);

			fDrawerListLeft.ItemClick += (sender, args) => ListItemClickedLeft(args.Position);

			fDrawerListRight = FindViewById<ListView>(Resource.Id.right_drawer);

			fDrawerListRight.Adapter = new ArrayAdapter<string>(this, Resource.Layout.item_menu, Sections);

			fDrawerListRight.ItemClick += (sender, args) => ListItemClickedRight(args.Position);

			fDrawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Start);

			//DrawerToggle is the animation that happens with the indicator next to the actionbar
			fDrawerToggle = new MyActionBarDrawerToggle(this,
														fDrawer,
														Resource.Drawable.ic_drawer_light,
														Resource.String.drawer_open,
														Resource.String.drawer_close);

			//Display the current fragments title and update the options menu
			fDrawerToggle.DrawerClosed += (o, args) =>
			{
				ActionBar.Title = fTitle;
				InvalidateOptionsMenu();
			};

			//Display the drawer title and update the options menu
			fDrawerToggle.DrawerOpened += (o, args) =>
			{
				ActionBar.Title = fDrawerTitle;
				InvalidateOptionsMenu();
			};

			//Set the drawer lister to be the toggle.
			fDrawer.SetDrawerListener(fDrawerToggle);
		}