Exemplo n.º 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();
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 3
0
        private async void loadElectionInfo()
        {
            JsonValue jsonResponse = await VoterHttpRequest.FetchElectionInfoAsync(address, index, this);

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