Exemplo n.º 1
0
 private void InitUi()
 {
     FragmentContext       = this;
     _sectionsPagerAdapter = new SectionsPagerAdapter(SupportFragmentManager);
     _mainContent          = FindViewById <ConstraintLayout>(Resource.Id.main_content);
     _viewPager            = FindViewById <FirstSetupViewPager>(Resource.Id.container);
     _viewPager.SetPagingEnabled(false);
     _viewPager.Adapter = _sectionsPagerAdapter;
     _progressBarDialog =
         new ProgressBarDialog(
             "Va rugam asteptati",
             "Se trimit datele",
             this, false);
     _progressBarDialog.Window.SetBackgroundDrawableResource(Resource.Color.colorPrimaryDark);
 }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            Android.Support.V7.Widget.Toolbar toolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            // Create the adapter that will return a fragment for each of the three
            // primary sections of the activity.
            sectionsPagerAdapter = new SectionsPagerAdapter(SupportFragmentManager);

            // Set up the ViewPager with the sections adapter.
            viewPager         = (ViewPager)FindViewById(Resource.Id.container);
            viewPager.Adapter = sectionsPagerAdapter;

            FloatingActionButton fab = (FloatingActionButton)FindViewById(Resource.Id.fab);

            fab.Click += ActionButtonClicked;
        }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            // Set up the action bar.
            ActionBar actionBar = SupportActionBar;

            actionBar.NavigationMode = (int)ActionBarNavigationMode.Tabs;

            // Create the adapter that will return a fragment for each of the three
            // primary sections of the activity.
            mSectionsPagerAdapter = new SectionsPagerAdapter(this, SupportFragmentManager);

            // Set up the ViewPager with the sections adapter.
            mViewPager         = FindViewById(Resource.Id.pager).JavaCast <ViewPager>();
            mViewPager.Adapter = mSectionsPagerAdapter;

            // When swiping between different sections, select the corresponding
            // tab. We can also use ActionBar.Tab#select() to do this if we have
            // a reference to the Tab.
            mViewPager.PageSelected += (sender, args) =>
            {
                actionBar.SetSelectedNavigationItem(args.Position);
            };

            // For each of the sections in the app, add a tab to the action bar.
            for (int i = 0; i < mSectionsPagerAdapter.Count; i++)
            {
                // Create a tab with text corresponding to the page title defined by
                // the adapter. Also specify this Activity object, which implements
                // the TabListener interface, as the callback (listener) for when
                // this tab is selected.
                var tab = actionBar
                          .NewTab()
                          .SetText(mSectionsPagerAdapter.GetPageTitle(i))
                          .SetTabListener(this);
                actionBar.AddTab(tab);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            // Set up the action bar.
            ActionBar actionBar = SupportActionBar;
            actionBar.NavigationMode = (int)ActionBarNavigationMode.Tabs;

            // Create the adapter that will return a fragment for each of the three
            // primary sections of the activity.
            mSectionsPagerAdapter = new SectionsPagerAdapter(this, SupportFragmentManager);

            // Set up the ViewPager with the sections adapter.
            mViewPager = FindViewById(Resource.Id.pager).JavaCast<ViewPager>();
            mViewPager.Adapter = mSectionsPagerAdapter;

            // When swiping between different sections, select the corresponding
            // tab. We can also use ActionBar.Tab#select() to do this if we have
            // a reference to the Tab.
            mViewPager.PageSelected += (sender, args) =>
            {
                actionBar.SetSelectedNavigationItem(args.Position);
            };

            // For each of the sections in the app, add a tab to the action bar.
            for (int i = 0; i < mSectionsPagerAdapter.Count; i++)
            {
                // Create a tab with text corresponding to the page title defined by
                // the adapter. Also specify this Activity object, which implements
                // the TabListener interface, as the callback (listener) for when
                // this tab is selected.
                var tab = actionBar
                    .NewTab()
                    .SetText(mSectionsPagerAdapter.GetPageTitle(i))
                    .SetTabListener(this);
                actionBar.AddTab(tab);
            }
        }
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_main;

			// Set up the action bar.
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.support.v7.app.ActionBar actionBar = getSupportActionBar();
			ActionBar actionBar = SupportActionBar;
			actionBar.NavigationMode = ActionBar.NAVIGATION_MODE_TABS;

			SectionsPagerAdapter pageAdapter = new SectionsPagerAdapter(this, SupportFragmentManager);
			viewPager = (ViewPager) findViewById(R.id.pager);
			viewPager.Adapter = pageAdapter;

			viewPager.OnPageChangeListener = new SimpleOnPageChangeListenerAnonymousInnerClassHelper(this, actionBar);

			for (int i = 0; i < pageAdapter.Count; i++)
			{
				SupportActionBar.addTab(SupportActionBar.newTab().setText(pageAdapter.getPageTitle(i)).setTabListener(this));
			}
		}
Exemplo n.º 6
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var pagerAdapter = new SectionsPagerAdapter(this.SupportFragmentManager);

            SetContentView(Resource.Layout.activity_score);

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

            SupportActionBar.SetDisplayUseLogoEnabled(false);
            SupportActionBar.SetLogo(new ColorDrawable(Resources.GetColor(Resource.Color.transparent)));
            SupportActionBar.SetHomeButtonEnabled(false);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetDisplayShowHomeEnabled(false);
            SupportActionBar.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Color.Transparent));

//			SupportActionBar.NavigationMode = (int) ActionBarNavigationMode.Tabs;
            SupportActionBar.SetStackedBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Color.Transparent));

            sectionsViewPager                    = FindViewById <ViewPager> (Resource.Id.sections_pager);
            sectionsViewPager.Adapter            = pagerAdapter;
            sectionsViewPager.OffscreenPageLimit = (int)TrimMemory.RunningModerate;
            sectionsViewPager.PageSelected      += (object sender, ViewPager.PageSelectedEventArgs e) => {
//				SupportActionBar.SetSelectedNavigationItem(e.Position);
            };

            // Add a tab to the action bar for each subsection
            for (int i = 0; i < pagerAdapter.Count; i++)
            {
                Android.Support.V7.App.ActionBar.Tab scheduleTab = SupportActionBar.NewTab().SetIcon(pagerAdapter.PageIcon(i));
                scheduleTab.SetTabListener(this);

                SupportActionBar.AddTab(scheduleTab);
            }
        }
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_main;

            // Set up the action bar.
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.support.v7.app.ActionBar actionBar = getSupportActionBar();
            ActionBar actionBar = SupportActionBar;

            actionBar.NavigationMode = ActionBar.NAVIGATION_MODE_TABS;

            SectionsPagerAdapter pageAdapter = new SectionsPagerAdapter(this, SupportFragmentManager);

            viewPager         = (ViewPager)findViewById(R.id.pager);
            viewPager.Adapter = pageAdapter;

            viewPager.OnPageChangeListener = new SimpleOnPageChangeListenerAnonymousInnerClassHelper(this, actionBar);

            for (int i = 0; i < pageAdapter.Count; i++)
            {
                SupportActionBar.addTab(SupportActionBar.newTab().setText(pageAdapter.getPageTitle(i)).setTabListener(this));
            }
        }