Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_statisticoverview);
            // Create your application here
            ViewModel = new StatisticOverViewViewModel(DbManager.Instance);

            myTabHost             = FindViewById <FragmentTabHost>(Resource.Id.tabHost);
            myTabHost.TabChanged += MyTabHost_TabChanged;
            myTabHost.Setup(this, SupportFragmentManager, Resource.Id.tabContainer);

            foreach (var tab in ViewModel.StatisticViewModels)
            {
                var type = tab.GetType();
                if (type == typeof(ZoneStatisticViewModel))
                {
                    myTabHost.AddTab(myTabHost.NewTabSpec("zone").SetIndicator("Vak"),
                                     Java.Lang.Class.FromType(typeof(ZoneStatisticFragment)), null);
                }
                if (type == typeof(TeamStatisticViewModel))
                {
                    myTabHost.AddTab(myTabHost.NewTabSpec("team").SetIndicator("Team"),
                                     Java.Lang.Class.FromType(typeof(AllStatisticFragment)), null);
                }
                if (type == typeof(PlayerStatisticViewModel))
                {
                    myTabHost.AddTab(myTabHost.NewTabSpec("player").SetIndicator("Speler"),
                                     Java.Lang.Class.FromType(typeof(PlayerStatisticFragment)), null);
                }
            }

            //Tab 1
            //Tab 2
        }
Example #2
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.CoffeeList);

            mTabHost = FindViewById <FragmentTabHost>(Android.Resource.Id.TabHost);
            mTabHost.Setup(this, this.SupportFragmentManager, Android.Resource.Id.TabContent);

            var icon    = Resources.GetDrawable(Android.Resource.Drawable.IcMenuMore);
            var iconFav = Resources.GetDrawable(Android.Resource.Drawable.IcMenuMyPlaces);

            var bundleList = new Bundle();

            bundleList.PutBoolean("isList", true);

            mTabHost.AddTab(mTabHost.NewTabSpec("coffeeList")
                            .SetIndicator("All", icon),
                            Java.Lang.Class.FromType(typeof(CoffeeListFragment)),
                            bundleList);

            var bundleFav = new Bundle();

            bundleFav.PutBoolean("isList", false);

            mTabHost.AddTab(mTabHost.NewTabSpec("coffeeFavorite")
                            .SetIndicator("Favorites", iconFav),
                            Java.Lang.Class.FromType(typeof(CoffeeListFragment)),
                            bundleFav);

            var viewModel = App.ServiceLocator.CoffeeListViewModel;
            await viewModel.Initialize();
        }
Example #3
0
        private void InitTabs()
        {
            mTabHost = this.View.FindViewById <FragmentTabHost>(Android.Resource.Id.TabHost);
            mTabHost.Setup(this.Activity, this.Activity.SupportFragmentManager, Resource.Id.realtabcontent);

            TabHost.TabSpec tabSpec1 = this.SetIndicator(mTabHost.NewTabSpec("Scanner"), "ɨһɨ");
            mTabHost.AddTab(tabSpec1, Class.FromType(typeof(ScannerFragment)), null);
            TabHost.TabSpec tabSpec2 = this.SetIndicator(mTabHost.NewTabSpec("Main"), "µ¯´°²âÊÔ");
            mTabHost.AddTab(tabSpec2, Class.FromType(typeof(MainFragment)), null);
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.umeng_example_analytics_fragment_tabs);
            _tabHost = FindViewById <FragmentTabHost>(Android.Resource.Id.TabHost);
            _tabHost.Setup(this, SupportFragmentManager, Resource.Id.realtabcontent);

            _tabHost.AddTab(_tabHost.NewTabSpec("simple").SetIndicator("Simple"), FragmentSimple.NewInstance(1).Class, null);
            _tabHost.AddTab(_tabHost.NewTabSpec("contacts").SetIndicator("Contacts"), FragmentContacts.NewInstance(1).Class, null);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.myaccount_page, container, false);

            mUser    = JsonConvert.DeserializeObject <User>(this.Activity.Intent.GetStringExtra("user"));
            mTabHost = view.FindViewById <FragmentTabHost>(Resource.Id.tabhost);

            mTabHost.Setup(this.Activity, ChildFragmentManager, Resource.Id.realtabcontent);

            mTabHost.AddTab(mTabHost.NewTabSpec("myaccount").SetIndicator("My Account"), Java.Lang.Class.FromType(typeof(MyAccountInfoFragment)), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("submissions").SetIndicator("Submissions"), Java.Lang.Class.FromType(typeof(MyAccountSubmissionsFragment)), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("badges").SetIndicator("Badges"), Java.Lang.Class.FromType(typeof(AchievementFragment)), null);

            return(view);
        }
Example #6
0
        private void InitializeTabs()
        {
            FragmentTabHost tabhost = FindViewById <FragmentTabHost> (Resource.Id.tabhost);

            tabhost.Setup(this, SupportFragmentManager, Resource.Id.tabcontent);


            tabhost.AddTab(
                tabhost.NewTabSpec("all-coffee").SetIndicator("All coffee", null),
                Java.Lang.Class.FromType(typeof(AllCoffeesFragment)), new Bundle());

            tabhost.AddTab(
                tabhost.NewTabSpec("favorites").SetIndicator("Favorites", null),
                Java.Lang.Class.FromType(typeof(FavoritesFragment)), new Bundle());
        }
        public override View OnCreateView(LayoutInflater Inflater, ViewGroup container,
                Bundle savedInstanceState) {
            mTabHost = new FragmentTabHost(GetActivity());
            mTabHost.Setup(GetActivity(), GetChildFragmentManager(), R.Id.fragment1);

            mTabHost.AddTab(mTabHost.NewTabSpec("simple").SetIndicator("Simple"),
                    typeof(FragmentStackSupport.CountingFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"),
                    typeof(LoaderCursorSupport.CursorLoaderListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("custom").SetIndicator("Custom"),
                    typeof(LoaderCustomSupport.AppListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("throttle").SetIndicator("Throttle"),
                    typeof(LoaderThrottleSupport.ThrottledLoaderListFragment), null);

            return mTabHost;
        }
Example #8
0
        protected override void OnCreate(Bundle savedInstanceState) {
            base.OnCreate(savedInstanceState);

            SetContentView(R.Layout.fragment_tabs);
            mTabHost = (FragmentTabHost)FindViewById(global::Android.R.Id.Tabhost);
            mTabHost.Setup(this, GetSupportFragmentManager(), R.Id.realtabcontent);

            mTabHost.AddTab(mTabHost.NewTabSpec("simple").SetIndicator("Simple"),
                    typeof(FragmentStackSupport.CountingFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"),
                    typeof(LoaderCursorSupport.CursorLoaderListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("custom").SetIndicator("Custom"),
                    typeof(LoaderCustomSupport.AppListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("throttle").SetIndicator("Throttle"),
                    typeof(LoaderThrottleSupport.ThrottledLoaderListFragment), null);
        }
        protected override void OnCreate(Bundle savedInstanceState) {
            base.OnCreate(savedInstanceState);

            mTabHost = new FragmentTabHost(this);
            SetContentView(mTabHost);
            mTabHost.Setup(this, GetSupportFragmentManager(), R.Ids.fragment1);

            mTabHost.AddTab(mTabHost.NewTabSpec("menus").SetIndicator("Menus"),
                    typeof(FragmentMenuFragmentSupport), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"),
                    typeof(LoaderCursorSupport.CursorLoaderListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("stack").SetIndicator("Stack"),
                    typeof(FragmentStackFragmentSupport), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("tabs").SetIndicator("Tabs"),
                    typeof(FragmentTabsFragmentSupport), null);
        }
        public override View OnCreateView(LayoutInflater Inflater, ViewGroup container,
                                          Bundle savedInstanceState)
        {
            mTabHost = new FragmentTabHost(GetActivity());
            mTabHost.Setup(GetActivity(), GetChildFragmentManager(), R.Ids.fragment1);

            mTabHost.AddTab(mTabHost.NewTabSpec("simple").SetIndicator("Simple"),
                            typeof(FragmentStackSupport.CountingFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"),
                            typeof(LoaderCursorSupport.CursorLoaderListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("custom").SetIndicator("Custom"),
                            typeof(LoaderCustomSupport.AppListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("throttle").SetIndicator("Throttle"),
                            typeof(LoaderThrottleSupport.ThrottledLoaderListFragment), null);

            return(mTabHost);
        }
Example #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            mTabHost = new FragmentTabHost(this);
            SetContentView(mTabHost);
            mTabHost.Setup(this, GetSupportFragmentManager(), R.Ids.fragment1);

            mTabHost.AddTab(mTabHost.NewTabSpec("menus").SetIndicator("Menus"),
                            typeof(FragmentMenuFragmentSupport), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"),
                            typeof(LoaderCursorSupport.CursorLoaderListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("stack").SetIndicator("Stack"),
                            typeof(FragmentStackFragmentSupport), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("tabs").SetIndicator("Tabs"),
                            typeof(FragmentTabsFragmentSupport), null);
        }
Example #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(R.Layout.fragment_tabs);
            mTabHost = (FragmentTabHost)FindViewById(global::Android.R.Id.Tabhost);
            mTabHost.Setup(this, GetSupportFragmentManager(), R.Id.realtabcontent);

            mTabHost.AddTab(mTabHost.NewTabSpec("simple").SetIndicator("Simple"),
                            typeof(FragmentStackSupport.CountingFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"),
                            typeof(LoaderCursorSupport.CursorLoaderListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("custom").SetIndicator("Custom"),
                            typeof(LoaderCustomSupport.AppListFragment), null);
            mTabHost.AddTab(mTabHost.NewTabSpec("throttle").SetIndicator("Throttle"),
                            typeof(LoaderThrottleSupport.ThrottledLoaderListFragment), null);
        }
Example #13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Main);

            // Access the tab host from the layout. It contains a "TabWidget"; this is meant to be used inside a TabHost and will be used automatically to display tabs (http://developer.android.com/reference/android/widget/TabWidget.html)
            this.tabHost = this.FindViewById<FragmentTabHost> (Resource.Id.tabhost);

            // TabHost must be initialized with the ID of a placeholder where it's going to show the active Fragment in.
            this.tabHost.Setup (this, this.FragmentManager, Resource.Id.realtabcontent);

            // Create three tabs.
            var args = new Bundle();
            args.PutString("Color", "Red");
            this.tabHost.AddTab(this.tabHost.NewTabSpec("Tab1").SetIndicator("First Tab"), Java.Lang.Class.FromType(typeof(DemoFragment)), args);

            args = new Bundle();
            args.PutString("Color", "Green");
            this.tabHost.AddTab(this.tabHost.NewTabSpec("Tab2").SetIndicator("Second Tab"), Java.Lang.Class.FromType(typeof(DemoFragment)), args);

            args = new Bundle();
            args.PutString("Color", "Blue");
            this.tabHost.AddTab(this.tabHost.NewTabSpec("Tab3").SetIndicator("Third Tab"), Java.Lang.Class.FromType(typeof(DemoFragment)), args);
        }
 public override void OnDestroyView()
 {
     base.OnDestroyView();
     mTabHost = null;
 }
 public override void OnDestroyView() {
     base.OnDestroyView();
     mTabHost = null;
 }