Пример #1
0
        private async void loadRepData()
        {
            JsonValue jsonResponse = await VoterHttpRequest.FetchRepresentativesAsync(address, this);

            if (jsonResponse != null)
            {
                Representatives = parser.ParseRepresentativeJson(jsonResponse);
            }
            else
            {
                Toast.MakeText(this, "no result retrieved", ToastLength.Long).Show();
            }
            adapterReps.setDataSet(Representatives);
            showRepData();
        }
Пример #2
0
        private async void loadElectionData()
        {
            JsonValue jsonResponse = await VoterHttpRequest.FetchVoterInfoAsync(address, this);

            if (jsonResponse != null)
            {
                Elections                = parser.ParseElectionJson(jsonResponse);
                adapterElecs             = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Elections);
                listViewElecs.Adapter    = adapterElecs;
                listViewElecs.Visibility = ViewStates.Gone;
            }
            else
            {
                Elections = new List <Election> {
                    new Election {
                        name = "no election data found", date = "election info may not be available more than 2-4 weeks prior"
                    }
                };
                adapterElecs             = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, Elections);
                listViewElecs.Adapter    = adapterElecs;
                listViewElecs.Visibility = ViewStates.Gone;
            }
        }
Пример #3
0
        private async void loadElectionInfo()
        {
            JsonValue jsonResponse = await VoterHttpRequest.FetchElectionInfoAsync(address, index, this);

            header.Text = parser.ParseElectionInfoJson(jsonResponse);
        }