示例#1
0
        public void Initialize()
        {
            //Init DataBase
            db = new DataBase();
            db.createDataBase();
            string folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

            //Init item for menu
            parse = GetString(Resource.String.parseFr);
            home  = GetString(Resource.String.homeFr);
            exit  = GetString(Resource.String.exit);
            about = GetString(Resource.String.aboutMe);

            //init Drawer
            mDrawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer     = FindViewById <ListView>(Resource.Id.left_drawer);
            mLeftDrawer.Tag = 0;

            mLeftDataSet = new List <string>();
            mLeftDataSet.Add(home);
            mLeftDataSet.Add(parse);
            mLeftDataSet.Add(about);
            mLeftDataSet.Add(exit);

            mLeftAdapter           = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet);
            mLeftDrawer.Adapter    = mLeftAdapter;
            mLeftDrawer.ItemClick += MenuListView_ItemClick;

            //Init Fragment
            homeFragment    = new HomeFragment();
            parseFragment   = new ParseFragment();
            aboutMeFragment = new AboutMeFragment();

            //Init ActionBar
            SupportActionBar.SetTitle(Resource.String.app_name);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            //Init DrawerToggle
            ActionDrawerToggle = new MyActionBarDrawerToggle(
                this,
                mDrawerLayout,
                Resource.String.openDrawer,
                Resource.String.closeDrawer
                );

            mDrawerLayout.AddDrawerListener(ActionDrawerToggle);
            ActionDrawerToggle.SyncState();
        }
示例#2
0
        public static Android.Support.V4.App.Fragment newInstance(Context context)
        {
            ParseFragment busrouteFragment = new ParseFragment();

            return(busrouteFragment);
        }