protected override void OnCreate(Bundle savedInstanceState) { _lang = app.GetString("Language", "en"); UserID = app.GetString("USERID", string.Empty); ChangeLanguage(_lang); base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.activity_wishlist); mToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); mBottomNav = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation_view); mBottomCardView = FindViewById <CardView>(Resource.Id.bottom_cardview); LoadingSkeleton = FindViewById <ShimmerRecyclerView>(Resource.Id.shimmer_recycler_view); progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); LoadingSkeleton.SetLayoutManager(new LinearLayoutManager(this)); LoadingSkeleton.ShowShimmerAdapter(); mBottomNav.SetOnNavigationItemSelectedListener(this); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); SupportActionBar.Title = "Wishlist"; mPageOffset = 0; mCurrentLayoutManagerType = MyEnum.ListView; InitDecoration(); SetUpRecyclerView(recyclerView); p.GetProduct += P_GetProduct; _products = new List <Products>(); progressBar.Visibility = ViewStates.Invisible; UserWishList(); }
public void OnResponse(Java.Lang.Object response) { progressDialog.Show(); try { JSONArray jsonArray = new JSONArray(response.ToString()); if (jsonArray.Length() > 0) { topSellList.Clear(); for (int i = 0; i < jsonArray.Length(); i++) { JSONObject jsonObject1 = jsonArray.GetJSONObject(i); string product_id = jsonObject1.GetString("itemmastid"); string varient_id = jsonObject1.GetString("itemmastid"); string product_name = jsonObject1.GetString("itemid"); string description = jsonObject1.GetString("itemdesc"); string pprice = jsonObject1.GetString("selrate"); string quantity = "50"; string product_image = jsonObject1.GetString("ItemImage"); string mmrp = jsonObject1.GetString("MRP"); string unit = jsonObject1.GetString("priunitvalue"); string count = "0"; string totalOff = string.Empty; if ((decimal.Parse(mmrp)) > 0) { var savePrice = (decimal.Parse(mmrp) - decimal.Parse(pprice)); var per = (savePrice / (decimal.Parse(mmrp)) * 100); totalOff = System.Math.Round(per, 0).ToString(); } int warehouseid = jsonObject1.GetString("WareHouseToId") == "" ? 0 : Convert.ToInt32(jsonObject1.GetString("WareHouseToId")); int rowstate = 0; CartModel recentData = new CartModel(product_id, product_name, description, pprice, "Unit : " + " " + unit, product_image, "%" + totalOff + " " + "Off", mmrp, count, unit, warehouseid, rowstate); recentData.setVarient_id(varient_id); topSellList.Add(recentData); } topSellingAdapter = new CartAdapter(Activity, topSellList); rv_top_selling.SetLayoutManager(new LinearLayoutManager(this.Activity)); rv_top_selling.SetAdapter(topSellingAdapter); topSellingAdapter.NotifyDataSetChanged(); } else { string msg = "No Record found"; Toast.MakeText(Context, msg, ToastLength.Short).Show(); } progressDialog.Dismiss(); } catch (JSONException e) { e.PrintStackTrace(); } progressDialog.Dismiss(); }
protected override void OnCreate(Bundle savedInstanceState) { UserID = app.GetString("USERID", string.Empty); _lang = app.GetString("Language", "en"); ChangeLanguage(_lang); filters = -1; SubCategory = Intent.GetStringExtra("SubCategory"); CountWatched(); base.OnCreate(savedInstanceState); CategoryTitle = Intent.GetStringExtra("Title"); // Create your application here SetContentView(Resource.Layout.shopping_main); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); mBottomNav = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation_view); mBottomCardView = FindViewById <CardView>(Resource.Id.bottom_cardview); mLoaderEffect = FindViewById <ShimmerRecyclerView>(Resource.Id.shimmer_recycler_view); mToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); mLoaderEffect.SetLayoutManager(new LinearLayoutManager(this)); mLoaderEffect.ShowShimmerAdapter(); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); mBottomNav.SetOnNavigationItemSelectedListener(this); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); InitDecoration(); mPageOffset = 0; mCurrentLayoutManagerType = MyEnum.ListView; InitDecoration(); SetUpRecyclerView(recyclerView); products = new List <Products>(); Category = Intent.GetStringExtra("CategoryID"); CategoryTitle = Intent.GetStringExtra("Category"); SupportActionBar.Title = CategoryTitle; GetProducts(); CurrentMode = APIMode.Direct; }