public void OnRefresh()
        {
            try
            {
                LatestSongsAdapter.SoundsList.Clear();
                LatestSongsAdapter.NotifyDataSetChanged();

                TopSongsAdapter.SoundsList.Clear();
                TopSongsAdapter.NotifyDataSetChanged();

                AlbumsAdapter.AlbumsList.Clear();
                AlbumsAdapter.NotifyDataSetChanged();

                StoreAdapter.SoundsList.Clear();
                StoreAdapter.NotifyDataSetChanged();

                ActivitiesAdapter.ActivityList.Clear();
                ActivitiesAdapter.NotifyDataSetChanged();

                EmptyStateLayout.Visibility = ViewStates.Gone;

                new Handler(Looper.MainLooper).Post(new Runnable(Run));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void ParseStoreJSON(JsonValue json)
        {
            // Extract the array of name/value results for the field name "weatherObservation".
            JsonValue     storeResults = json;
            List <string> itemList     = new List <string>();
            // Extract the "stationName" (location string) and write it to the location TextBox:
            bool isSuccess = storeResults["IsSuccess"];

            if (isSuccess)
            {
                JsonArray      recieptArray = (JsonArray)storeResults["userDetails"];
                List <UserDTO> output       = new List <UserDTO>();
                foreach (JsonValue item in recieptArray)
                {
                    UserDTO d = new UserDTO();
                    d.StoreName   = item["StoreName"];
                    d.Username    = item["Username"];
                    d.StoreUserID = item["StoreUserID"];
                    output.Add(d);
                }
                ulist = output;
                var listView = FindViewById <ListView>(Resource.Id.listStores);
                storeAdapter        = new StoreAdapter(this, ulist);
                listView.ItemClick += ListView_ItemClick;
                listView.Adapter    = storeAdapter;
                Toast.MakeText(this, "Store recieved successfully.", ToastLength.Short).Show();
            }
            else
            {
                string errorMessage = storeResults["Message"];
                Toast.MakeText(this, errorMessage, ToastLength.Short).Show();
            }
        }
Exemple #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.QuotedStore);
            string json = Intent.GetStringExtra("UserData");

            ulist = JsonConvert.DeserializeObject <List <UserDTO> >(json);
            var listView = FindViewById <ListView>(Resource.Id.listQuotedStores);

            storeAdapter     = new StoreAdapter(this, ulist);
            listView.Adapter = storeAdapter;
            Toast.MakeText(this, "Store recieved successfully.", ToastLength.Short).Show();
        }
Exemple #4
0
        private async void BtnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                ReturnGenericGet returnGenericGet = new ReturnGenericGet();
                string           CS  = PathLink.StoreURI;
                JObject          obj = await returnGenericGet.GetReturnGeneric(CS);

                vMStore vMStore = obj.ToObject <vMStore>();
                storeAdapter = new StoreAdapter(vMStore.Detail);
                if (vMStore.Status == 1)
                {
                    mRecycleView.SetAdapter(storeAdapter);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }