示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.session = Resolver.Instance.Get <ISalesAppSession>();

            this.SetContentView(Resource.Layout.layout_stats_main);

            // set the toolbar as actionbar
            this._toolbar = this.FindViewById <Toolbar>(Resource.Id.main_toolbar);
            this.SetSupportActionBar(this._toolbar);

            string title = string.Format(
                this.GetString(Resource.String.stats_screen_title), this.session.FirstName, this.session.LastName);

            this.SetScreenTitle(title);

            // load pager
            this._pager         = this.FindViewById <SwipeControlledViewPager>(Resource.Id.pager);
            this._pager.Adapter = new StatsFragmentAdapter(this.GetFragmentManager(), this);

            // Give the TabLayout the ViewPager
            this._tabLayout = this.FindViewById <ClickControlledTabLayout>(Resource.Id.sliding_tabs);
            this._tabLayout.SetupWithViewPager(this._pager);

            this._swipeRefreshLayout = this.FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout);
            this._swipeRefreshLayout.SetColorSchemeResources(Resource.Color.blue, Resource.Color.white, Resource.Color.gray1, Resource.Color.green);
            this._swipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh;
            this._pager.PageSelected         += this.PagerOnPageSelected;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.SetContentView(Resource.Layout.layout_phone);
            this.AddToolbar(Resource.String.customer_details, true);

            Bundle extras = this.Intent.Extras;

            if (extras != null)
            {
                string bundledCustomerString = extras.GetString(BundledCustomer);
                this._customerSearchResult = JsonConvert.DeserializeObject <CustomerSearchResult>(bundledCustomerString);
                this.SetScreenTitle(this._customerSearchResult.FullName);
            }

            if (savedInstanceState != null)
            {
                string json = savedInstanceState.GetString(BundledCustomer);
                this._customerSearchResult = JsonConvert.DeserializeObject <CustomerSearchResult>(json);
                this.SetScreenTitle(this._customerSearchResult.FullName);
            }

            // load the pager
            this._pager = this.FindViewById <SwipeControlledViewPager>(Resource.Id.pager);
            var pagerAdapter = new CustomerDetailsPagerAdapter(this.GetFragmentManager(), this._customerSearchResult);

            this._pager.Adapter       = pagerAdapter;
            this._pager.PageSelected += this.PageSelectedEventHandler;

            // Give the TabLayout the ViewPager
            this._tabLayout = this.FindViewById <ClickControlledTabLayout>(Resource.Id.sliding_tabs);
            this._tabLayout.SetupWithViewPager(this._pager);
        }
示例#3
0
        /// <summary>
        /// Called by the android framework when this activity is being created for the first time
        /// </summary>
        /// <param name="savedInstanceState">Saved state if any</param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.SetContentView(Resource.Layout.layout_ticket_list);

            this.AddToolbar(Resource.String.ticket_list_screen_title, true);

            // load pager
            this.pager               = this.FindViewById <SwipeControlledViewPager>(Resource.Id.pager);
            this.pager.Adapter       = new TicketListPagerAdapter(this.GetFragmentManager(), this);
            this.pager.PageSelected += this.PageSelectedEventHandler;

            // Give the TabLayout the ViewPager
            this.tabLayout = this.FindViewById <ClickControlledTabLayout>(Resource.Id.sliding_tabs);
            this.tabLayout.SetupWithViewPager(this.pager);

            this.swipeRefreshLayout          = this.FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh_layout);
            this.swipeRefreshLayout.Refresh += this.SwipeRefreshHandler;
            this.swipeRefreshLayout.SetColorSchemeResources(Resource.Color.blue, Resource.Color.white, Resource.Color.gray1, Resource.Color.green);
        }
示例#4
0
        /// <summary>
        /// Initialize the screen
        /// </summary>
        public override void InitializeScreen()
        {
            this.SetContentView(Resource.Layout.layout_swap_components);

            // set the toolbar as actionbar
            // this.toolbar = this.FindViewById<Toolbar>(Resource.Id.toolbar);
            // this.SetSupportActionBar(this.toolbar);
            this.SetScreenTitle(this.GetString(Resource.String.component_swap));
            this.ActionBar.SetDisplayHomeAsUpEnabled(true);

            var phoneTabFragment       = new CustomerIdentificationFragment();
            var phoneTabFragmentBundle = new Bundle();

            phoneTabFragmentBundle.PutInt(CustomerIdentificationFragment.TabBundleKey, phoneTab);
            if (!string.IsNullOrEmpty(_identifier))
            {
                phoneTabFragmentBundle.PutString("identifier", _identifier);
            }
            phoneTabFragment.Arguments = phoneTabFragmentBundle;

            var idTabFragment       = new CustomerIdentificationFragment();
            var idTabFragmentBundle = new Bundle();

            idTabFragmentBundle.PutInt(CustomerIdentificationFragment.TabBundleKey, idTab);
            if (!string.IsNullOrEmpty(_identifier))
            {
                idTabFragmentBundle.PutString("identifier", _identifier);
            }
            idTabFragment.Arguments = idTabFragmentBundle;

            var serialTabFragment       = new CustomerIdentificationFragment();
            var serialTabFragmentBundle = new Bundle();

            serialTabFragmentBundle.PutInt(CustomerIdentificationFragment.TabBundleKey, serialTab);
            if (!string.IsNullOrEmpty(_identifier))
            {
                serialTabFragmentBundle.PutString("identifier", _identifier);
            }
            serialTabFragment.Arguments = serialTabFragmentBundle;

            this.fragments = new[]
            {
                new SwapFragmentHolder
                {
                    TabId    = phoneTab,
                    Fragment = phoneTabFragment,
                    Label    = this.GetString(Resource.String.phone_number)
                               // Label = "Phone",
                },
                new SwapFragmentHolder
                {
                    TabId    = idTab,
                    Fragment = idTabFragment,
                    Label    = this.GetString(Resource.String.id_number)
                               // Label = "ID",
                },
                new SwapFragmentHolder
                {
                    TabId    = serialTab,
                    Fragment = serialTabFragment,
                    Label    = this.GetString(Resource.String.device)
                               // Label = "Device",
                }
            };

            // load pager
            this.pager = this.FindViewById <SwipeControlledViewPager>(Resource.Id.pager);
            this.pager.OffscreenPageLimit = this.fragments.Length - 1;
            this.pager.Adapter            = new SwapFragmentsAdapter(this.GetFragmentManager(), this.fragments);
            this.pager.OffscreenPageLimit = this.fragments.Length - 1;

            // Give the TabLayout the ViewPager
            this.tabLayout = this.FindViewById <ClickControlledTabLayout>(Resource.Id.sliding_tabs);
            this.tabLayout.SetupWithViewPager(this.pager);
        }