コード例 #1
0
        protected override void OnCreate(Bundle savedInstance)
        {
            base.OnCreate(savedInstance);
            SetContentView(R.Layouts.TopPilotsActivity_Layout);

            this.ActionBar.NavigationMode = ActionBar.NAVIGATION_MODE_TABS;
            this.ActionBar.SetDisplayHomeAsUpEnabled(true);

            confluxKillsAdapter = CreateTab("Conflux Kills");
            pilotKillsAdapter   = CreateTab("Pilot Kills");
            deathsAdapter       = CreateTab("Deaths");
            creditsAdapter      = CreateTab("Credits");
            missionsAdapter     = CreateTab("Missions Completed");
            dutyHoursAdapter    = CreateTab("Duty Hours");
            experienceAdapter   = CreateTab("Experience");

            var pilotStats = LastNonConfigurationInstance as PilotStats;

            if (pilotStats != null)
            {
                PopulatePilotStats(pilotStats);
                _savedInstance = pilotStats;
            }
            else
            {
                RefreshPilotStats();
            }
        }
コード例 #2
0
        void PopulatePilotStats(PilotStats pilotStats)
        {
            confluxKillsAdapter.Update(pilotStats.FluxKills);
            pilotKillsAdapter.Update(pilotStats.PilotKills);
            deathsAdapter.Update(pilotStats.Deaths);
            creditsAdapter.Update(pilotStats.Credits);
            missionsAdapter.Update(pilotStats.MissionsCompleted);
            dutyHoursAdapter.Update(pilotStats.DutyHours);
            experienceAdapter.Update(pilotStats.Experience);

            if (pd != null)
            {
                pd.Dismiss();
            }
        }
コード例 #3
0
        void ParsePilotStats(string httpRes)
        {
            var xml = XDocument.Parse(httpRes);

            {
                XElement   root  = xml.Root;
                PilotStats stats = new PilotStats();
                stats.FluxKills         = ParseStatList(root.Element("conflux_leaderboard"));
                stats.PilotKills        = ParseStatList(root.Element("pilotskilled_leaderboard"));
                stats.Deaths            = ParseStatList(root.Element("deaths_leaderboard"));
                stats.Credits           = ParseStatList(root.Element("credits_leaderboard"));
                stats.MissionsCompleted = ParseStatList(root.Element("missionscompleted_leaderboard"));
                stats.DutyHours         = ParseStatList(root.Element("dutyhours_leaderboard"));
                stats.Experience        = ParseStatList(root.Element("experience_leaderboard"));

                _savedInstance = stats;
            }

            RunOnUiThread(() =>
            {
                PopulatePilotStats(_savedInstance);
            });
        }
コード例 #4
0
        protected override void OnCreate(Bundle savedInstance)
        {
            base.OnCreate(savedInstance);
            SetContentView(R.Layouts.TopPilotsActivity_Layout);

            this.ActionBar.NavigationMode = ActionBar.NAVIGATION_MODE_TABS;
            this.ActionBar.SetDisplayHomeAsUpEnabled(true);

            confluxKillsAdapter = CreateTab("Conflux Kills");
            pilotKillsAdapter = CreateTab("Pilot Kills");
            deathsAdapter = CreateTab("Deaths");
            creditsAdapter = CreateTab("Credits");
            missionsAdapter = CreateTab("Missions Completed");
            dutyHoursAdapter = CreateTab("Duty Hours");
            experienceAdapter = CreateTab("Experience");

            var pilotStats = LastNonConfigurationInstance as PilotStats;
            if (pilotStats != null)
            {
                PopulatePilotStats(pilotStats);
                _savedInstance = pilotStats;
            }
            else
            {
                RefreshPilotStats();
            }
        }
コード例 #5
0
        void PopulatePilotStats(PilotStats pilotStats)
        {
            confluxKillsAdapter.Update(pilotStats.FluxKills);
            pilotKillsAdapter.Update(pilotStats.PilotKills);
            deathsAdapter.Update(pilotStats.Deaths);
            creditsAdapter.Update(pilotStats.Credits);
            missionsAdapter.Update(pilotStats.MissionsCompleted);
            dutyHoursAdapter.Update(pilotStats.DutyHours);
            experienceAdapter.Update(pilotStats.Experience);

            if (pd != null)
            {
                pd.Dismiss();
            }
        }
コード例 #6
0
        void ParsePilotStats(string httpRes)
        {
            var xml = XDocument.Parse(httpRes);
            {
                XElement root = xml.Root;
                PilotStats stats = new PilotStats();
                stats.FluxKills = ParseStatList(root.Element("conflux_leaderboard"));
                stats.PilotKills = ParseStatList(root.Element("pilotskilled_leaderboard"));
                stats.Deaths = ParseStatList(root.Element("deaths_leaderboard"));
                stats.Credits = ParseStatList(root.Element("credits_leaderboard"));
                stats.MissionsCompleted = ParseStatList(root.Element("missionscompleted_leaderboard"));
                stats.DutyHours = ParseStatList(root.Element("dutyhours_leaderboard"));
                stats.Experience = ParseStatList(root.Element("experience_leaderboard"));

                _savedInstance = stats;
            }

            RunOnUiThread(() =>
            {
                PopulatePilotStats(_savedInstance);
            });
        }