Ejemplo n.º 1
0
        public PersonTurnsAdapter(TurnsRepository turnsRepository, int activityId)
        {
            this.turnsRepository = turnsRepository;
            this.activityId      = activityId;

            ReloadPersonTurns();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Main);

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

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

            var menuDrawable = GetDrawable(Resource.Drawable.ic_menu_white_24dp);

            Helper.TintDrawable(Resources, menuDrawable);
            SupportActionBar.SetHomeAsUpIndicator(menuDrawable);

            var titles  = new[] { "Activities", "Groups" };
            var adapter = new TabsFragmentPagerAdapter(SupportFragmentManager, titles);

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

            viewPager.OffscreenPageLimit = titles.Length;
            viewPager.CurrentItem        = 0;

            tabs = FindViewById <PagerSlidingTabStrip>(Resource.Id.Tabs);
            tabs.SetViewPager(viewPager);

            tabs.OnPageChangeListener = this;

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

            fab.Click += (sender, e) =>
            {
                Snackbar
                .Make(fab, "Here's a snackbar!", Snackbar.LengthLong)
                .SetAction("Action", v => Console.WriteLine("Action handler"))
                .Show();
            };

            TurnsRepository = new TurnsRepository();
            TurnsRepository.InitializeMockData();
        }
Ejemplo n.º 3
0
 public GroupsAdapter(TurnsRepository turnsRepository)
 {
     this.turnsRepository = turnsRepository;
     ReloadGroups();
 }
Ejemplo n.º 4
0
 public ActivityAdapter(TurnsRepository turnsRepository)
 {
     this.turnsRepository = turnsRepository;
     ReloadActivities();
 }