예제 #1
0
        public override Fragment GetItem(int position)
        {
            switch ((MainTabTypes)position)
            {
            case MainTabTypes.MyLibrary:
                return(MyLibraryFragment.Instantiate());

            case MainTabTypes.Network:
                return(NetworkFragment.Instantiate());

            case MainTabTypes.Settings:
                return(SettingsFragment.Instantiate());
            }

            throw new ArgumentOutOfRangeException("Could not handle position " + position);
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            RequestedOrientation = ScreenOrientation.Portrait;
            SetContentView(Resource.Layout.activity_settings);

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

            SetSupportActionBar(toolbar);

            SupportActionBar.Title = "Settings";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(false);

            FragmentManager.BeginTransaction()
            .AddToBackStack(null)
            .Add(Resource.Id.frame_layout, SettingsFragment.Instantiate())
            .Commit();
        }