コード例 #1
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PartyDetailView);

            var authLink = await FirebaseAuthLinkWrapper.GetAuthLink(FirebaseAuthType.Facebook, AccessToken.CurrentAccessToken.Token);

            _partyRepository = new PersistantPartyRepository(authLink);

            var selectedPartyID = Intent.Extras.GetString("selectedPartyID");

            _selectedParty = await _partyRepository.GetById(selectedPartyID);

            CreateFragments(authLink, _selectedParty);

            var viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);

            viewPager.Adapter = new ViewPagerFragmentsAdapter(SupportFragmentManager,
                                                              new List <Android.Support.V4.App.Fragment>
            {
                _partyInfoFragment,
                _partyItemsFragment,
                _partyMembersFragment,
                _partyPendingFragment
            });
        }
コード例 #2
0
        public async Task <Party> GetById(string id)
        {
            //
            //var connected = await CheckConnection();


            using (var db = new LiteDatabase(_dbPath))
            {
                var partiesTable = db.GetCollection <Party>();

                if (CheckConnection())
                {
                    var party = await _partyRepository.GetById(id);

                    if (party != null)
                    {
                        partiesTable.Upsert(party);
                    }
                    return(party);
                }
                else
                {
                    var party = partiesTable.FindById(id);
                    return(party);
                }
            }
        }
コード例 #3
0
        public async Task Refresh()
        {
            _selectedParty = await _partyRepository.GetById(_selectedParty.Id);

            _partyInfoFragment.Refresh(_selectedParty);
            _partyItemsFragment.Refresh(_selectedParty);
            _partyMembersFragment.Refresh(_selectedParty);
            _partyPendingFragment.Refresh(_selectedParty);
        }
コード例 #4
0
        public async Task GetPartyByIdAsync()
        {
            var id = "-LDXoHHc18uqBQd1pi_Z";

            var party = await repository.GetById(id);
        }