private void InitialSetup() { string mySkoolToken = setupMySkoolData (); string mySkoolRawData = getMySkoolJSONData(mySkoolToken.ToString(), 1); var mySkoolJSONed = JsonConvert.DeserializeObject<WebServices.MySkoolPetiMasukData> (mySkoolRawData); int totalPage = 0; foreach (var mySkoolPaging in mySkoolJSONed.paging) { Console.WriteLine ("[MySoal - Peti Masuk] Paging: {0}",mySkoolPaging.count); totalPage = mySkoolPaging.count; } if (totalPage != 0) { Activity.RunOnUiThread (() => { llMSkT1ErrorStatus.Visibility = ViewStates.Gone; recyclerView.Visibility = ViewStates.Visible; }); foreach (var msjsoned in mySkoolJSONed.data) { mySkoolListData.Add (new MyShop_ListData { mTitle = msjsoned.title, mContent = msjsoned.text.ToString ()//.Substring (0, 50) + "..." }); mySkoolTitleList.Add (msjsoned.title); mySkoolContentList.Add (msjsoned.content); } } else { Activity.RunOnUiThread (() => { llMSkT1ErrorStatus.Visibility = ViewStates.Visible; recyclerView.Visibility = ViewStates.Gone; tvMSkT1ErrorStatus.Text = "Tiada maklumat tersedia buat masa ini."; progressDialog.Hide(); }); } Activity.RunOnUiThread (() => { listData = new MyShop_ListDataHolderList (mySkoolListData); mLayoutManager = new LinearLayoutManager (Activity); recyclerView.SetLayoutManager (mLayoutManager); recyclerAdapter = new MyShop_RecyclerViewAdapter (Activity, listData); recyclerView.SetAdapter (recyclerAdapter); recyclerAdapter.ItemClick += ItemClicked; progressDialog.Hide(); }); }
//public MySkool_RecyclerViewAdapter (Activity context, MySkool_ListDataHolder data) public MyShop_RecyclerViewAdapter (Activity context, MyShop_ListDataHolderList data) { this.context = context; mData = data; }