private void BindGridData() { try { ServiceWrapper svc = new ServiceWrapper(); var MYtastings = svc.GetMyTastingsList(customerid).Result; myArr1 = MYtastings.TastingList.ToList(); ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting); wineList.Clickable = true; MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList()); wineList.Adapter = adapter; wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { string WineBarcode = myArr1[args.Position].Barcode; int storeID = myArr1[args.Position].PlantFinal; LoggingClass.LogInfo("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine from tasting details", screenid); ProgressIndicator.Show(this); var intent = new Intent(this, typeof(DetailViewActivity)); intent.PutExtra("WineBarcode", WineBarcode); intent.PutExtra("storeid", storeID); StartActivity(intent); }; ProgressIndicator.Hide(); AndHUD.Shared.Dismiss(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); } }
public override bool OnOptionsItemSelected(IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { AndHUD.Shared.Dismiss(); base.OnBackPressed(); AndHUD.Shared.Dismiss(); LoggingClass.LogInfo("Exited from Detail View", screenid); //TokenModel devInfo = new TokenModel(); //var activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService); //ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo(); //activityManager.GetMemoryInfo(memInfo); //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Avail {0} - {1} MB", memInfo.AvailMem, memInfo.AvailMem / 1024 / 1024); //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Low {0}", memInfo.LowMemory); //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Total {0} - {1} MB", memInfo.TotalMem, memInfo.TotalMem / 1024 / 1024); //devInfo.AvailableMainMemory = memInfo.AvailMem; //devInfo.IsLowMainMemory = memInfo.LowMemory; //devInfo.TotalMainMemory = memInfo.TotalMem; ProgressIndicator.Hide(); return(false); } return(base.OnOptionsItemSelected(item)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); uid = Convert.ToInt32(CurrentUser.getUserId()); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Tasting); try { ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); ItemReviewResponse uidreviews = new ItemReviewResponse(); // ItemRatingResponse irr = svc.GetItemReviewUID(uid).Result; uidreviews = svc.GetItemReviewUID(uid).Result; //if (uidreviews.Reviews.Count == 0) //{ // SetContentView(Resource.Layout.Dummy); //} List <Review> myArr1; myArr1 = uidreviews.Reviews.ToList(); var wineList = FindViewById <ListView>(Resource.Id.listView1); // myArr1 = SampleData1(); Review edit = new Review(); ReviewPopup editPopup = new ReviewPopup(this, edit); MyReviewAdapter adapter = new MyReviewAdapter(this, myArr1); //if (adapter.Count == 0) //{ // TextView infoText = FindViewById<TextView>(Resource.Id.txtInfo); // infoText.Text = "You haven't reviewed anything"; //} //adapter.Edit_Click += editPopup.EditPopup; wineList.Adapter = adapter; // wineList.ItemClick += listView_ItemClick; wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { int WineID = myArr1[args.Position].WineId; var intent = new Intent(this, typeof(detailViewActivity)); intent.PutExtra("WineID", WineID); StartActivity(intent); }; ProgressIndicator.Hide(); } catch (Exception exe) { AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } }
public override bool OnOptionsItemSelected(IMenuItem item) { Intent intent = null; switch (item.ItemId) { case Resource.Id.action_settings3: ProgressIndicator.Show(this); intent = new Intent(this, typeof(AboutActivity)); break; } if (intent != null) { StartActivity(intent); } if (item.ItemId == Android.Resource.Id.Home) { base.OnBackPressed(); intent = new Intent(this, typeof(Login)); StartActivity(intent); LoggingClass.LogInfo("Exited from Gridview Activity", screenid); ProgressIndicator.Hide(); return(true); } return(base.OnOptionsItemSelected(item)); }
protected override void OnCreate(Bundle bundle) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(bundle); customerid = Convert.ToInt32(CurrentUser.getUserId()); try { LoggingClass.LogInfo("Entered into My Tasting", screenid); this.ActionBar.SetHomeButtonEnabled(true); this.ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); var MYtastings = svc.GetMyTastingsList(customerid).Result; myArr1 = MYtastings.TastingList.ToList(); if (MYtastings.TastingList.Count == 0) { SetContentView(Resource.Layout.EmptyTaste); TextView te = FindViewById <TextView>(Resource.Id.textView123a); } else { SetContentView(Resource.Layout.MyTasting); BindGridData(); SwipeRefreshLayout mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.PullDownRefresh1); //mSwipeRefreshLayout.Refresh += MSwipeRefreshLayout_Refresh; //mSwipeRefreshLayout.SetColorScheme(Resource.Color.abc_background_cache_hint_selector_material_dark, Resource.Color.abc_background_cache_hint_selector_material_light); mSwipeRefreshLayout.Refresh += async delegate { //BindGridData(); LoggingClass.LogInfo("Refreshed My Tasting", screenid); await SomeAsync(); mSwipeRefreshLayout.Refreshing = false; }; ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); } ProgressIndicator.Hide(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } st.Stop(); LoggingClass.LogTime("Tastingactivity", st.Elapsed.TotalSeconds.ToString()); }
public override bool OnOptionsItemSelected(IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { string Back = Intent.GetStringExtra("Back"); if (Back == "Back") { var intent = new Intent(this, typeof(Login)); StartActivity(intent); } else { AndHUD.Shared.Dismiss(); base.OnBackPressed(); GC.Collect(); } AndHUD.Shared.Dismiss(); try { ProgressIndicator.Hide(); } catch (Exception ex) { } LoggingClass.LogInfo("Exited from Detail View", screenid); return(false); } return(base.OnOptionsItemSelected(item)); }
public async override void OnBackPressed() { var intent = new Intent(this, typeof(Login)); StartActivity(intent); // MoveTaskToBack(true); ProgressIndicator.Hide(); }
public async override void OnBackPressed() { //var intent = new Intent(this, typeof(PotraitActivity)); Finish(); //StartActivity(intent); //MoveTaskToBack(true); ProgressIndicator.Hide(); }
// SwipeRefreshLayout refresher1; protected override void OnCreate(Bundle bundle) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(bundle); SetContentView(Resource.Layout.Main); try { CheckInternetConnection(); if (StoreName == "") { StoreName = Intent.GetStringExtra("MyData"); } this.Title = StoreName; this.ActionBar.SetHomeButtonEnabled(true); this.ActionBar.SetDisplayShowTitleEnabled(true);// ToolbartItems.Add(new ToolbarItem { Text = "BTN 1", Icon = "myicon.png" }); BindGridData(); SwipeRefreshLayout mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.PullDownRefresh); //mSwipeRefreshLayout.Refresh += MSwipeRefreshLayout_Refresh; //mSwipeRefreshLayout.SetColorScheme(Resource.Color.abc_background_cache_hint_selector_material_dark, Resource.Color.abc_background_cache_hint_selector_material_light); mSwipeRefreshLayout.Refresh += async delegate { //BindGridData(); LoggingClass.LogInfo("Refreshed grid view", screenid); await SomeAsync(); mSwipeRefreshLayout.Refreshing = false; }; ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ProgressIndicator.Hide(); LoggingClass.LogInfo("Entered into gridview activity", screenid); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); ProgressIndicator.Hide(); AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } st.Stop(); LoggingClass.LogTime("Gridactivity", st.Elapsed.TotalSeconds.ToString()); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.WineoutletWeb); web_view = FindViewById <WebView>(Resource.Id.webView1); web_view.Settings.JavaScriptEnabled = true; web_view.SetWebViewClient(new HelloWebViewClient()); string sku = Intent.GetStringExtra("sku"); string val = Intent.GetStringExtra("Val"); string url; if (val == "1") { if (sku == null || sku == "") { ActionBar.SetIcon(Resource.Drawable.Icon); ActionBar.SetDisplayHomeAsUpEnabled(true); web_view.LoadUrl("http://www.wineoutlet.com/"); } else { ActionBar.SetIcon(Resource.Drawable.Icon); ActionBar.SetDisplayHomeAsUpEnabled(true); url = "http://www.wineoutlet.com/sku" + sku + ".html"; web_view.LoadUrl(url); } } else { web_view.LoadUrl("http://www.wineoutlet.com/"); } //if (sku == null || sku == "") //{ // web_view.LoadUrl("http://www.wineoutlet.com/"); //} //else //{ // ActionBar.SetIcon(Resource.Drawable.Icon); // ActionBar.SetDisplayHomeAsUpEnabled(true); // url = "http://www.wineoutlet.com/sku" + sku + ".html"; // web_view.LoadUrl(url); //} ProgressIndicator.Hide(); // Create your application here }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Window.RequestFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.AutoCompleteTextLayout); //var autoCompleteOptions = new String[] //{ // "Hello", // "Hey", // "Hej", // "Hi", // "Hola", // "Bonjour", // "Gday", // "Goodbye", // "Sayonara", // "Farewell", // "Adios" //}; //ArrayAdapter autoCompleteAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleDropDownItem1Line // , autoCompleteOptions); var autocompleteTextView = FindViewById <AutoCompleteTextView>(Resource.Id.AutoCompleteInput); //autocompleteTextView.Adapter = autoCompleteAdapter; #region Additional Information - use a file to populate autocomplete array // instead of the small array of greetings, use a large dictionary of words loaded from a file Stream seedDataStream = Assets.Open(@"WineList.txt"); List <string> lines = new List <string>(); using (StreamReader reader = new StreamReader(seedDataStream)) { string line; while ((line = reader.ReadLine()) != null) { lines.Add(line); } } ProgressIndicator.Hide(); string[] wordlist = lines.ToArray(); ArrayAdapter dictionaryAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleDropDownItem1Line, wordlist); autocompleteTextView.Adapter = dictionaryAdapter; //ArrayAdapter autoCompleteAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleDropDownItem1Line // , dictionaryAdapter); #endregion }
private void BindGridData() { try { ServiceWrapper svc = new ServiceWrapper(); var MYtastings = svc.GetMyTastingsList(customerid).Result; myArr1 = MYtastings.TastingList.ToList(); ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting); wineList.Clickable = true; MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList()); wineList.Adapter = adapter; wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { string WineBarcode = myArr1[args.Position].Barcode; int storeID = myArr1[args.Position].PlantFinal; LoggingClass.LogInfo("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine from tasting details", screenid); // ProgressIndicator.Show(this); AndHUD.Shared.Show(this, "Loading...", Convert.ToInt32(MaskType.Clear)); var intent = new Intent(this, typeof(DetailViewActivity)); intent.PutExtra("WineBarcode", WineBarcode); intent.PutExtra("storeid", storeID); StartActivity(intent); }; ProgressIndicator.Hide(); AndHUD.Shared.Dismiss(); //TokenModel devInfo = new TokenModel(); //var activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService); //ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo(); //activityManager.GetMemoryInfo(memInfo); //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Avail {0} - {1} MB", memInfo.AvailMem, memInfo.AvailMem / 1024 / 1024); //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Low {0}", memInfo.LowMemory); //System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Total {0} - {1} MB", memInfo.TotalMem, memInfo.TotalMem / 1024 / 1024); //devInfo.AvailableMainMemory = memInfo.AvailMem; //devInfo.IsLowMainMemory = memInfo.LowMemory; //devInfo.TotalMainMemory = memInfo.TotalMem; } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.DeleteReviewPop, container, false); LoggingClass.LogInfo("Entered into Delete review popup with" + WineBarcode, screenid); ServiceWrapper sw = new ServiceWrapper(); Review review = new Review(); Button Delete = view.FindViewById <Button>(Resource.Id.button1); Button Cancel = view.FindViewById <Button>(Resource.Id.button2); try { Delete.Click += async delegate { AndHUD.Shared.Show(Parent, "Deleting Review...", Convert.ToInt32(MaskType.Clear)); review.Barcode = WineBarcode; // ProgressIndicator.Show(Parent); review.ReviewUserId = Convert.ToInt32(CurrentUser.getUserId()); await sw.DeleteReview(review); ((IPopupParent)Parent).RefreshParent(); ProgressIndicator.Hide(); myDialog.Dismiss(); AndHUD.Shared.Dismiss(); AndHUD.Shared.ShowSuccess(Parent, "Sucessfully Deleted", MaskType.Clear, TimeSpan.FromSeconds(2)); LoggingClass.LogInfoEx("User deleted winereview" + WineBarcode + "from " + review.PlantFinal + "st Store", screenid); }; } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); } Cancel.Click += delegate { LoggingClass.LogInfo("clicked on cancel" + WineBarcode + review.PlantFinal, screenid); myDialog.Dismiss(); }; st.Stop(); LoggingClass.LogTime("Deletereview time", st.Elapsed.TotalSeconds.ToString()); return(view); }
public override bool OnOptionsItemSelected(IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { ProgressIndicator.Hide(); base.OnBackPressed(); // MoveTaskToBack(true); //var intent = new Intent(this, typeof(Login)); //StartActivity(intent); try { ProgressIndicator.Hide(); } catch (Exception ex) { } return(true); } return(base.OnOptionsItemSelected(item)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); customerid = Convert.ToInt32(CurrentUser.getUserId()); SetContentView(Resource.Layout.MyTasting); try { ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); var MYtastings = svc.GetMyTastingsList(customerid).Result; List <Tastings> myArr; // myArr1 = SampleData1(); ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting); // myArr1 = SampleData1(); MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList()); wineList.Adapter = adapter; ProgressIndicator.Hide(); } catch (Exception exe) { AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } }
protected override void OnCreate(Bundle bundle) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(bundle); customerid = Convert.ToInt32(CurrentUser.getUserId()); try { LoggingClass.LogInfo("Entered into My Tasting", screenid); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); var MYtastings = svc.GetMyTastingsList(customerid).Result; myArr1 = MYtastings.TastingList.ToList(); if (MYtastings.TastingList.Count == 0) { SetContentView(Resource.Layout.EmptyTaste); TextView te = FindViewById <TextView>(Resource.Id.textView123a); //AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); ////aler.SetTitle("No Reviews Avalilable"); //aler.SetMessage("Sorry you haven't Tasted our wines"); //LoggingClass.LogInfo("Sorry you haven't Tasted our wines alert", screenid); //aler.SetNegativeButton("Ok", delegate { Finish(); }); //LoggingClass.LogInfo("Clicked on Secaucus", screenid); //Dialog dialog = aler.Create(); //dialog.Show(); } else { SetContentView(Resource.Layout.MyTasting); ListView wineList = FindViewById <ListView>(Resource.Id.MyTasting); MyTastingAdapter adapter = new MyTastingAdapter(this, MYtastings.TastingList.ToList()); wineList.Adapter = adapter; wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { string WineBarcode = myArr1[args.Position].Barcode; int storeID = myArr1[args.Position].PlantFinal; LoggingClass.LogInfo("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine from tasting details", screenid); ProgressIndicator.Show(this); var intent = new Intent(this, typeof(DetailViewActivity)); intent.PutExtra("WineBarcode", WineBarcode); intent.PutExtra("storeid", storeID); StartActivity(intent); }; } ProgressIndicator.Hide(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } st.Stop(); LoggingClass.LogTime("Tastingactivity", st.Elapsed.TotalSeconds.ToString()); }
protected override void OnCreate(Bundle savedInstanceState) { CheckInternetConnection(); Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.detailedView); WineBarcode = Intent.GetStringExtra("WineBarcode"); storeid = Intent.GetIntExtra("storeid", 1); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); ItemDetailsResponse myData = new ItemDetailsResponse(); ItemReviewResponse SkuRating = new ItemReviewResponse(); this.Title = "Wine Details"; commentsview = FindViewById <ListView>(Resource.Id.listView2); TextView WineName = FindViewById <TextView>(Resource.Id.txtWineName); //Assigning values to respected Textfields WineName.Focusable = false; TextView WineProducer = FindViewById <TextView>(Resource.Id.txtProducer); WineProducer.Focusable = false; TextView Vintage = FindViewById <TextView>(Resource.Id.txtVintage); Vintage.Focusable = false; TextView WineDescription = FindViewById <TextView>(Resource.Id.txtWineDescription); WineDescription.Focusable = false; RatingBar AvgRating = FindViewById <RatingBar>(Resource.Id.avgrating); AvgRating.Focusable = false; TextView ErrorDescription = FindViewById <TextView>(Resource.Id.Error); ErrorDescription.Focusable = false; ErrorDescription.Visibility = ViewStates.Invisible; TableRow tr5 = FindViewById <TableRow>(Resource.Id.tableRow5); try { DownloadAsync(this, System.EventArgs.Empty, WineBarcode); myData = svc.GetItemDetails(WineBarcode, storeid).Result; SkuRating = svc.GetItemReviewsByWineBarcode(WineBarcode).Result; ReviewArray = SkuRating.Reviews.ToList(); comments = new reviewAdapter(this, ReviewArray); if (comments.Count == 0) { ErrorDescription.Text = SkuRating.ErrorDescription; ErrorDescription.Visibility = ViewStates.Visible; //AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); //aler.SetTitle("No Reviews"); //aler.SetMessage("Be the first one to Review"); //aler.SetNegativeButton("Ok", delegate { }); //Dialog dialog = aler.Create(); //dialog.Show(); } else { commentsview.Adapter = comments; } setListViewHeightBasedOnChildren1(commentsview); WineName.Text = myData.ItemDetails.Name; WineName.InputType = Android.Text.InputTypes.TextFlagNoSuggestions; Vintage.Text = myData.ItemDetails.Vintage.ToString(); if (myData.ItemDetails.Producer == null || myData.ItemDetails.Producer == "") { WineProducer.Text = "Not Available"; } else { WineProducer.Text = myData.ItemDetails.Producer; } if (myData.ItemDetails.Description == null || myData.ItemDetails.Description == "") { WineDescription.Text = "Not Available"; } else { WineDescription.Text = myData.ItemDetails.Description; } AvgRating.Rating = (float)myData.ItemDetails.AverageRating; Review edit = new Review() { Barcode = WineBarcode, RatingText = "", PlantFinal = storeid.ToString() }; var tempReview = ReviewArray.Find(x => x.ReviewUserId == Convert.ToInt32(CurrentUser.getUserId())); if (tempReview != null) { edit.RatingText = tempReview.RatingText; } ReviewPopup editPopup = new ReviewPopup(this, edit); RatingBar RatingInput = FindViewById <RatingBar>(Resource.Id.ratingInput); //Taking rating stars input RatingInput.RatingBarChange += editPopup.CreatePopup; var metrics = Resources.DisplayMetrics; var widthInDp = ConvertPixelsToDp(metrics.WidthPixels); var heightInDp = ConvertPixelsToDp(metrics.HeightPixels); HighImageWine = FindViewById <ImageView>(Resource.Id.WineImage); BitmapFactory.Options options = new BitmapFactory.Options { InJustDecodeBounds = false, OutHeight = 75, OutWidth = 75 }; ProgressIndicator.Hide(); LoggingClass.LogInfo("Entered into detail view" + WineBarcode, screenid); Bitmap result = BitmapFactory.DecodeResource(Resources, Resource.Drawable.placeholder_re, options); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Sorry"); alert.SetMessage("We're under maintainence"); alert.SetNegativeButton("Ok", delegate { }); Dialog dialog = alert.Create(); dialog.Show(); } //downloadButton = FindViewById<Button>(Resource.Id.Download); //try //{ // //downloadButton.Enabled = true; // downloadButton.Click += downloadAsync; // //downloadButton.Enabled = false; //} //catch (Exception e) { } st.Stop(); LoggingClass.LogTime("Detail activity", st.Elapsed.TotalSeconds.ToString()); TokenModel devInfo = new TokenModel(); var activityManager = (ActivityManager)this.GetSystemService(Context.ActivityService); ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo(); activityManager.GetMemoryInfo(memInfo); System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Avail {0} - {1} MB", memInfo.AvailMem, memInfo.AvailMem / 1024 / 1024); System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Low {0}", memInfo.LowMemory); System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Total {0} - {1} MB", memInfo.TotalMem, memInfo.TotalMem / 1024 / 1024); devInfo.AvailableMainMemory = memInfo.AvailMem; devInfo.IsLowMainMemory = memInfo.LowMemory; devInfo.TotalMainMemory = memInfo.TotalMem; }
public async override void OnBackPressed() { ProgressIndicator.Hide(); }
protected override void OnCreate(Bundle bundle) { CheckInternetConnection(); base.OnCreate(bundle); SetContentView(Resource.Layout.Profile); //st.Start(); try { ///LoggingClass.UploadErrorLogs(LoggingClass.CreateDirectoryForLogs()); LoggingClass.LogInfo("Entered into Profile Activity", screenid); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); int userId = Convert.ToInt32(CurrentUser.getUserId()); ServiceWrapper sw = new ServiceWrapper(); var output = sw.GetCustomerDetails(userId).Result; propicimage = FindViewById <ImageView>(Resource.Id.propic); DownloadAsync(this, System.EventArgs.Empty); //ProfilePicturePickDialog pppd = new ProfilePicturePickDialog(); //string path = pppd.CreateDirectoryForPictures(); //string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); //var filePath = System.IO.Path.Combine(path + "/" + userId + ".jpg"); //if (System.IO.File.Exists(filePath)) //{ // Bitmap imageBitmap = BitmapFactory.DecodeFile(filePath); // if (imageBitmap == null) // { // propicimage.SetImageResource(Resource.Drawable.user1); // propicimage.Dispose(); // } // else // { // propicimage.SetImageBitmap(imageBitmap); // propicimage.Dispose(); // } //} //else //{ // Bitmap imageBitmap = BlobWrapper.ProfileImages(userId); // if (imageBitmap == null) // { // propicimage.SetImageResource(Resource.Drawable.user1); // } // else // { // propicimage.SetImageBitmap(imageBitmap); // } //} InputMethodManager inputManager = (InputMethodManager)this.GetSystemService(Context.InputMethodService); ImageButton changepropic = FindViewById <ImageButton>(Resource.Id.btnChangePropic); changepropic.Click += delegate { LoggingClass.LogInfo("Clicked on change propic", screenid); Intent intent = new Intent(this, typeof(ProfilePicturePickDialog)); StartActivity(intent); }; changepropic.Dispose(); EditText Firstname = FindViewById <EditText>(Resource.Id.txtFirstName); Firstname.Text = output.customer.FirstName; EditText Lastname = FindViewById <EditText>(Resource.Id.txtLastName); Lastname.Text = output.customer.LastName; EditText Mobilenumber = FindViewById <EditText>(Resource.Id.txtMobileNumber); string phno1 = output.customer.PhoneNumber; string phno2 = output.customer.Phone2; if (phno1 != null) { Mobilenumber.Text = phno1; } else { Mobilenumber.Text = phno2; } EditText Email = FindViewById <EditText>(Resource.Id.txtEmail); Email.Text = output.customer.Email; EditText Address = FindViewById <EditText>(Resource.Id.txtAddress); string Addres2 = output.customer.Address2; string Addres1 = output.customer.Address1; Address.Text = string.Concat(Addres1, Addres2); //EditText City = FindViewById<EditText>(Resource.Id.txtCity); //City.Text = output.customer.CardNumber; //if (CurrentUser.getUserId() != null) //{ // City.Enabled = false; //} //else { City.Enabled = true; } EditText PinCode = FindViewById <EditText>(Resource.Id.txtZip); PinCode.Text = output.customer.Zip; Button updatebtn = FindViewById <Button>(Resource.Id.UpdateButton); Spinner spn = FindViewById <Spinner>(Resource.Id.spinner); Spinner Prefered = FindViewById <Spinner>(Resource.Id.spinner1); //spn.SetSelection(4); string state = output.customer.State; int Preferedstore = output.customer.PreferredStore; List <string> storelist = new List <string>(); storelist.Add("--select--"); storelist.Add("Wall"); storelist.Add("PointPleasent"); storelist.Add("Both"); gifImageView = FindViewById <ImageView>(Resource.Id.gifImageView1); //gifImageView.StartAnimation(); List <string> StateList = new List <string>(); StateList.Add("AL"); StateList.Add("AK"); StateList.Add("AZ"); StateList.Add("AR"); StateList.Add("CA"); StateList.Add("CO"); StateList.Add("CT"); StateList.Add("DE"); StateList.Add("FL"); StateList.Add("GA"); StateList.Add("HI"); StateList.Add("ID"); StateList.Add("IL"); StateList.Add("IN"); StateList.Add("IA"); StateList.Add("KS"); StateList.Add("KY"); StateList.Add("LA"); StateList.Add("ME"); StateList.Add("MD"); StateList.Add("MA"); StateList.Add("MI"); StateList.Add("MN"); StateList.Add("MS"); StateList.Add("MO"); StateList.Add("MT"); StateList.Add("NE"); StateList.Add("NV"); StateList.Add("NH"); StateList.Add("NJ"); StateList.Add("NM"); StateList.Add("NY"); StateList.Add("NC"); StateList.Add("ND"); StateList.Add("OH"); StateList.Add("OK"); StateList.Add("OR"); StateList.Add("PA"); StateList.Add("RI"); StateList.Add("SC"); StateList.Add("SD"); StateList.Add("TN"); StateList.Add("TX"); StateList.Add("UT"); StateList.Add("VT"); StateList.Add("VA"); StateList.Add("WA"); StateList.Add("WV"); StateList.Add("WI"); StateList.Add("WY"); int i = StateList.IndexOf(state.ToString()); spn.SetSelection(i); //int p = storelist.IndexOf(Prefered.SelectedItem.ToString()); Prefered.SetSelection(Preferedstore); inputManager.HideSoftInputFromWindow(Firstname.WindowToken, 0); inputManager.HideSoftInputFromWindow(Lastname.WindowToken, 0); inputManager.HideSoftInputFromWindow(Address.WindowToken, 0); inputManager.HideSoftInputFromWindow(PinCode.WindowToken, 0); inputManager.HideSoftInputFromWindow(Email.WindowToken, 0); if (CurrentUser.getUserId() == null) { AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); aler.SetTitle("Sorry"); aler.SetMessage("This feature is available only for VIP Users"); aler.SetNegativeButton("Ok", delegate { var intent = new Intent(this, typeof(TabActivity)); StartActivity(intent); }); Dialog dialog1 = aler.Create(); dialog1.Show(); } else { updatebtn.Click += async delegate { if ((Email.Text.Contains("@")) == false || (Email.Text.Contains(".")) == false) { AndHUD.Shared.ShowErrorWithStatus(this, "Email is invalid", MaskType.Clear, TimeSpan.FromSeconds(2)); } else if ((PinCode.Text.Length != 5)) { AndHUD.Shared.ShowErrorWithStatus(this, "Zipcode is invalid", MaskType.Clear, TimeSpan.FromSeconds(2)); } else { AndHUD.Shared.Show(this, "Please Wait", Convert.ToInt32(MaskType.Clear)); //int p = storelist.IndexOf(Prefered.SelectedItem.ToString()); //Prefered.SetSelection(p); Customer customer = new Customer() { FirstName = Firstname.Text, LastName = Lastname.Text, PhoneNumber = Mobilenumber.Text, Address1 = Address.Text, Email = Email.Text, CustomerID = userId, //State = State.Text, State = spn.SelectedItem.ToString(), //City = City.Text //CardNumber = City.Text, Zip = PinCode.Text, PreferredStore = Convert.ToInt32(Prefered.SelectedItemId) }; CurrentUser.SavePrefered(Convert.ToInt32(Prefered.SelectedItemId)); LoggingClass.LogInfo("Clicked on update info", screenid); var x = await sw.UpdateCustomer(customer); if (x == 1) { Toast.MakeText(this, "Thank you your profile is Updated", ToastLength.Short).Show(); } AndHUD.Shared.Dismiss(); AndHUD.Shared.ShowSuccess(this, "Profile Updated", MaskType.Clear, TimeSpan.FromSeconds(2)); // var intent = new Intent(this, typeof(TabActivity)); //StartActivity(intent); } }; } } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } //st.Stop(); //LoggingClass.LogTime("Profile activity", st.Elapsed.TotalSeconds.ToString()); ProgressIndicator.Hide(); }
protected override void OnCreate(Bundle savedInstanceState) { //AndHUD.Shared.Dismiss(); CheckInternetConnection(); Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.detailedView); // WineBarcode = Intent.GetStringExtra("WineBarcode"); //storeid = Intent.GetIntExtra("storeid", 1); //ActionBar.SetHomeButtonEnabled(true); //ActionBar.SetDisplayHomeAsUpEnabled(true); //ServiceWrapper svc = new ServiceWrapper(); // myData = new ItemDetailsResponse(); //ItemReviewResponse SkuRating = new ItemReviewResponse(); //this.Title = "Wine Details"; commentsview = FindViewById <ListView>(Resource.Id.listView2); WineName = FindViewById <TextView>(Resource.Id.txtWineName); //Assigning values to respected Textfields WineName.Focusable = false; WineProducer = FindViewById <TextView>(Resource.Id.txtProducer); WineProducer.Focusable = false; Vintage = FindViewById <TextView>(Resource.Id.txtVintage); Vintage.Focusable = false; WineDescription = FindViewById <TextView>(Resource.Id.txtWineDescription); WineDescription.Focusable = false; AvgRating = FindViewById <RatingBar>(Resource.Id.avgrating); AvgRating.Focusable = false; ErrorDescription = FindViewById <TextView>(Resource.Id.Error); ErrorDescription.Focusable = false; ErrorDescription.Visibility = ViewStates.Gone; TableRow tr5 = FindViewById <TableRow>(Resource.Id.tableRow5); WineBarcode = Intent.GetStringExtra("WineBarcode"); storeid = 1;// Intent.GetIntExtra("storeid", 1); Review edit = new Review() { Barcode = WineBarcode, RatingText = "", PlantFinal = storeid.ToString() }; ItemReviewResponse SkuRating = new ItemReviewResponse(); ServiceWrapper svc = new ServiceWrapper(); SkuRating = svc.GetItemReviewsByWineBarcode(WineBarcode).Result; var tempReview = SkuRating.Reviews.ToList().Find(x => x.ReviewUserId == Convert.ToInt32(CurrentUser.getUserId())); if (tempReview != null) { edit.RatingText = tempReview.RatingText; } editPopup = new ReviewPopup(this, edit); RatingInput = FindViewById <RatingBar>(Resource.Id.ratingInput);//Taking rating stars input RatingInput.RatingBarChange += editPopup.CreatePopup; flag = 1; Internal_ViewDidLoad(); st.Stop(); //AndHUD.Shared.Dismiss(); try { ProgressIndicator.Hide(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); } LoggingClass.LogTime("Detail activity", st.Elapsed.TotalSeconds.ToString()); }
protected override void OnCreate(Bundle bundle) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(bundle); uid = Convert.ToInt32(CurrentUser.getUserId()); try { ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); ItemReviewResponse uidreviews = new ItemReviewResponse(); uidreviews = svc.GetItemReviewUID(uid).Result; List <Review> myArr1; myArr1 = uidreviews.Reviews.ToList(); int c = uidreviews.Reviews.Count; if (c == 0) { var data = svc.GetMyTastingsList(uid).Result; SetContentView(Resource.Layout.ReviewEmpty); txtName = FindViewById <TextView>(Resource.Id.textView1); if (data.TastingList.Count != 0) { txtName.Text = "You have tasted " + data.TastingList.Count + " wines.\n We would love to hear your feedback."; } else { txtName.Text = "Please taste and then review."; } Imag = FindViewById <ImageView>(Resource.Id.imageView1); var TaskA = new System.Threading.Tasks.Task(() => { Imag.SetImageResource(Resource.Drawable.ReviewIns); }); TaskA.Start(); } else { SetContentView(Resource.Layout.MyReviews); var wineList = FindViewById <ListView>(Resource.Id.listView1); Review edit = new Review(); ReviewPopup editPopup = new ReviewPopup(this, edit); MyReviewAdapter adapter = new MyReviewAdapter(this, myArr1); wineList.Adapter = adapter; wineList.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { string WineBarcode = myArr1[args.Position].Barcode; int storeID = Convert.ToInt32(myArr1[args.Position].PlantFinal); LoggingClass.LogInfoEx("Clicked on " + myArr1[args.Position].Barcode + " to enter into wine details From ReviewAct", screenid); ProgressIndicator.Show(this); //AndHUD.Shared.Show(this, "Loading...", Convert.ToInt32(MaskType.Clear)); var intent = new Intent(this, typeof(DetailViewActivity)); intent.PutExtra("WineBarcode", WineBarcode); intent.PutExtra("storeid", storeID); StartActivity(intent); }; LoggingClass.LogInfo("Entered into My Review", screenid); } ProgressIndicator.Hide(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AndHUD.Shared.Dismiss(); ProgressIndicator.Hide(); AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } st.Stop(); LoggingClass.LogTime("Reviewactivity", st.Elapsed.TotalSeconds.ToString()); }
public void CreatePopup(object sender, RatingBar.RatingBarChangeEventArgs e) { if (CurrentUser.getUserId() == null || CurrentUser.getUserId() == "0") { AlertDialog.Builder aler = new AlertDialog.Builder(Parent, Resource.Style.MyDialogTheme); aler.SetTitle("Sorry"); aler.SetMessage("This Feature is available for VIP Users only"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog1 = aler.Create(); dialog1.Show(); } else { try { Dialog editDialog = new Dialog(Parent); var rat = e.Rating; editDialog.SetContentView(Resource.Layout.EditReviewPopup); ServiceWrapper sw = new ServiceWrapper(); Review review = new Review(); ImageButton close = editDialog.FindViewById <ImageButton>(Resource.Id.close); Button btnSubmitReview = editDialog.FindViewById <Button>(Resource.Id.btnSubmitReview); TextView Comments = editDialog.FindViewById <TextView>(Resource.Id.txtReviewComments); RatingBar custRating = editDialog.FindViewById <RatingBar>(Resource.Id.rating); custRating.Rating = rat; Comments.Text = _editObj.RatingText; int screenid = 9; close.SetScaleType(ImageView.ScaleType.CenterCrop); editDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent)); editDialog.Show(); editDialog.SetCanceledOnTouchOutside(false); LoggingClass.LogInfo("Entered into CreatePopup", screenid); close.Click += delegate { LoggingClass.LogInfo("Closed PoPup", screenid); editDialog.Dismiss(); }; btnSubmitReview.Click += async delegate { AndHUD.Shared.Show(Parent, "Saving Review...", Convert.ToInt32(MaskType.Clear)); // ProgressIndicator.Show(Parent); review.ReviewDate = DateTime.Now; review.ReviewUserId = Convert.ToInt32(CurrentUser.getUserId()); review.Username = CurrentUser.getUserName(); review.RatingText = Comments.Text; review.RatingStars = Convert.ToInt32(custRating.Rating); review.IsActive = true; review.Barcode = WineBarcode; review.PlantFinal = storeid; LoggingClass.LogInfo("Submitted review---->" + review.RatingStars + " ---->" + review.RatingText + "---->" + review.PlantFinal + "---->" + review.Barcode, screenid); await sw.InsertUpdateReview(review); ((IPopupParent)Parent).RefreshParent(); ProgressIndicator.Hide(); editDialog.Dismiss(); AndHUD.Shared.Dismiss(); AndHUD.Shared.ShowSuccess(Parent, "Sucessfully Saved", MaskType.Clear, TimeSpan.FromSeconds(2)); }; } catch (Exception exe) { LoggingClass.LogError(exe.Message, ParentScreenId, exe.StackTrace.ToString()); } } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.ProfileCell); int userId = Convert.ToInt32(CurrentUser.getUserId()); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper sw = new ServiceWrapper(); var output = sw.GetCustomerDetails(userId).Result; RefreshParent(); if (CurrentUser.getUserId() == "0" || CurrentUser.getUserId() == null) { AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); aler.SetTitle("Sorry"); aler.SetMessage("This feature is available only for VIP Users"); aler.SetPositiveButton("Log in", delegate { string str = null; CurrentUser.SaveGuestId(str); var intent = new Intent(this, typeof(LoginActivity)); StartActivity(intent); }); aler.SetNegativeButton("KnowMore", delegate { var uri = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html"); var intent = new Intent(Intent.ActionView, uri); StartActivity(intent); }); aler.SetNeutralButton("Cancel", delegate { var intent = new Intent(this, typeof(Login)); StartActivity(intent); }); Dialog dialog1 = aler.Create(); dialog1.Show(); } try { propicimage = FindViewById <ImageView>(Resource.Id.user_profile_photo); TextView Name = FindViewById <TextView>(Resource.Id.user_profile_name); TextView Email = FindViewById <TextView>(Resource.Id.user_profile_short_bio); TextView Mobile = FindViewById <TextView>(Resource.Id.user_mobile); TextView Address = FindViewById <TextView>(Resource.Id.user_Address); TextView PinCode = FindViewById <TextView>(Resource.Id.user_Zip); TextView Preferrd = FindViewById <TextView>(Resource.Id.user_Preferred); TextView State = FindViewById <TextView>(Resource.Id.user_State); TextView Card = FindViewById <TextView>(Resource.Id.user_Card); TextView Expiry = FindViewById <TextView>(Resource.Id.User_expiry); Button Drop = FindViewById <Button>(Resource.Id.drop_down_option_menu); ImageView ChangePRo = FindViewById <ImageView>(Resource.Id.add_friend); ChangePRo.Click += delegate { AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); aler.SetTitle("Please choose an option to upload profile picture"); aler.SetPositiveButton("Gallery", delegate { Intent = new Intent(); Intent.SetType("image/*"); Intent.SetAction(Intent.ActionGetContent); StartActivityForResult(Intent.CreateChooser(Intent, "Select Picture"), PickImageId); }); aler.SetNegativeButton("Camera", delegate { if (IsThereAnAppToTakePictures()) { CreateDirectoryForPictures(); TakeAPicture(); } }); aler.SetNeutralButton("Cancel", delegate { }); Dialog dialog1 = aler.Create(); dialog1.Show(); }; // Boolean indirect = true; if (indirect == true) { System.Threading.Timer timer = null; timer = new System.Threading.Timer((obj) => { DownloadAsync(this, System.EventArgs.Empty); timer.Dispose(); }, null, 2000, System.Threading.Timeout.Infinite); } else { DownloadAsync(this, System.EventArgs.Empty); } Drop.Click += (s, arg) => { Intent intent = new Intent(this, typeof(ProfileActivity)); ProgressIndicator.Show(this); StartActivity(intent); //PopupMenu menu = new PopupMenu(this, Drop); //menu.Inflate(Resource.Drawable.options_menu_1); //menu.Show(); }; string First = output.customer.FirstName; string Last = output.customer.LastName; Name.Text = string.Concat(First, Last); Card.Text = output.customer.CardNumber.ToString(); Email.Text = output.customer.Email; PinCode.Text = output.customer.Zip.ToString(); Preferrd.Text = output.customer.PreferredStore.ToString(); if (Preferrd.Text == "0") { Preferrd.Text = "-Select your preferred store-"; } else if (Preferrd.Text == "1") { Preferrd.Text = AppConstants.WallStore; } else if (Preferrd.Text == "2") { Preferrd.Text = AppConstants.PointPleasantStore; } else { Preferrd.Text = AppConstants.SecaucusStore; } State.Text = output.customer.State; Expiry.Text = output.customer.ExpireDate.ToString(); string Addres2 = output.customer.Address2; string Addres1 = output.customer.Address1; Address.Text = string.Concat(Addres1, Addres2); string phno1 = output.customer.PhoneNumber; string phno2 = output.customer.Phone2; if (phno1 != null) { Mobile.Text = phno1; } else { Mobile.Text = phno2; } } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); } ProgressIndicator.Hide(); }
public void Internal_ViewDidLoad() { try { WineBarcode = Intent.GetStringExtra("WineBarcode"); storeid = Intent.GetIntExtra("storeid", 1); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); myData = new ItemDetailsResponse(); ItemReviewResponse SkuRating = new ItemReviewResponse(); this.Title = "Wine Details"; try { DownloadAsync(this, System.EventArgs.Empty, WineBarcode); myData = svc.GetItemDetails(WineBarcode, storeid).Result; SkuRating = svc.GetItemReviewsByWineBarcode(WineBarcode).Result; ReviewArray = SkuRating.Reviews.ToList(); var tempReview = SkuRating.Reviews.ToList().Find(x => x.ReviewUserId == Convert.ToInt32(CurrentUser.getUserId())); if (tempReview != null) { editPopup._editObj.RatingText = tempReview.RatingText; } comments = new reviewAdapter(this, ReviewArray); if (comments.Count == 0) { ErrorDescription.Visibility = ViewStates.Visible; ErrorDescription.Text = SkuRating.ErrorDescription; ErrorDescription.SetTextColor(Android.Graphics.Color.Black); } else { commentsview.Adapter = comments; } setListViewHeightBasedOnChildren1(commentsview); WineName.Text = myData.ItemDetails.Name; WineName.InputType = Android.Text.InputTypes.TextFlagNoSuggestions; Vintage.Text = myData.ItemDetails.Vintage.ToString(); if (Vintage.Text == null || Vintage.Text == "0") { Vintage.Text = ""; } else { Vintage.Text = myData.ItemDetails.Vintage.ToString(); } if (myData.ItemDetails.Producer == null || myData.ItemDetails.Producer == "") { WineProducer.Text = "Not Available"; } else { WineProducer.Text = myData.ItemDetails.Producer; } if (myData.ItemDetails.Description == null || myData.ItemDetails.Description == "") { WineDescription.Text = "Not Available"; } else { WineDescription.Text = myData.ItemDetails.Description; } AvgRating.Rating = (float)myData.ItemDetails.AverageRating; //ReviewPopup editPopup = new ReviewPopup(this, edit); //RatingBar RatingInput = FindViewById<RatingBar>(Resource.Id.ratingInput);//Taking rating stars input //RatingInput.RatingBarChange += editPopup.CreatePopup; var metrics = Resources.DisplayMetrics; var widthInDp = ConvertPixelsToDp(metrics.WidthPixels); var heightInDp = ConvertPixelsToDp(metrics.HeightPixels); HighImageWine = FindViewById <ImageView>(Resource.Id.WineImage); BitmapFactory.Options options = new BitmapFactory.Options { InJustDecodeBounds = false, OutHeight = 75, OutWidth = 75 }; ProgressIndicator.Hide(); LoggingClass.LogInfo("Entered into detail view" + WineBarcode, screenid); Bitmap result = BitmapFactory.DecodeResource(Resources, Resource.Drawable.placeholder_re, options); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); AlertDialog.Builder alert = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); alert.SetTitle("Sorry"); alert.SetMessage("We're under maintainence"); alert.SetNegativeButton("Ok", delegate { }); Dialog dialog = alert.Create(); dialog.Show(); } } catch { } }
public async override void OnBackPressed() { MoveTaskToBack(true); ProgressIndicator.Hide(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); try { SetContentView(Resource.Layout.MyFavoriteGridView); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); if (StoreName == "") { StoreName = Intent.GetStringExtra("MyData"); } this.Title = StoreName; int StoreId = 0; if (StoreName == "My Favorites") { StoreId = 1; } else if (StoreName == "Point Pleasent Store") { StoreId = 2; } else if (StoreName == "Wall Store") { StoreId = 3; } int userId = Convert.ToInt32(CurrentUser.getUserId()); ServiceWrapper sw = new ServiceWrapper(); ItemListResponse output = new ItemListResponse(); output = sw.GetItemFavsUID(userId).Result; List <Item> myArr; myArr = output.ItemList.ToList(); var gridview = FindViewById <GridView>(Resource.Id.gridviewfav); MyFavoriteAdapter adapter = new MyFavoriteAdapter(this, myArr); gridview.SetNumColumns(2); gridview.Adapter = adapter; gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { int WineID = myArr[args.Position].WineId; var intent = new Intent(this, typeof(detailViewActivity)); intent.PutExtra("WineID", WineID); StartActivity(intent); }; ProgressIndicator.Hide(); } catch (Exception exe) { AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.detailedView); wineid = Intent.GetIntExtra("WineID", 123); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ServiceWrapper svc = new ServiceWrapper(); ItemDetailsResponse myData = new ItemDetailsResponse(); ItemReviewResponse SkuRating = new ItemReviewResponse(); this.Title = "Wine Details"; var commentsView = FindViewById <ListView>(Resource.Id.listView2); TextView WineName = FindViewById <TextView>(Resource.Id.txtWineName); //Assigning values to respected Textfields WineName.Focusable = false; TextView WineProducer = FindViewById <TextView>(Resource.Id.txtProducer); WineProducer.Focusable = false; TextView Vintage = FindViewById <TextView>(Resource.Id.txtVintage); Vintage.Focusable = false; TextView WineDescription = FindViewById <TextView>(Resource.Id.txtWineDescription); WineDescription.Focusable = false; RatingBar AvgRating = FindViewById <RatingBar>(Resource.Id.avgrating); AvgRating.Focusable = false; TableRow tr5 = FindViewById <TableRow>(Resource.Id.tableRow5); try { downloadAsync(this, System.EventArgs.Empty, wineid); myData = svc.GetItemDetails(wineid).Result; SkuRating = svc.GetItemReviewsByWineID(wineid).Result; reviewAdapter comments = new reviewAdapter(this, SkuRating.Reviews.ToList()); commentsView.Adapter = comments; setListViewHeightBasedOnChildren1(commentsView); WineName.Text = myData.ItemDetails.Name; WineName.InputType = Android.Text.InputTypes.TextFlagNoSuggestions; Vintage.Text = myData.ItemDetails.Vintage.ToString(); WineProducer.Text = myData.ItemDetails.Producer; WineDescription.Text = myData.ItemDetails.Description; AvgRating.Rating = (float)myData.ItemDetails.AverageRating; Review edit = new Review(); edit.WineId = wineid; ReviewPopup editPopup = new ReviewPopup(this, edit); RatingBar RatingInput = FindViewById <RatingBar>(Resource.Id.ratingInput);//Taking rating stars input RatingInput.RatingBarChange += editPopup.CreatePopup; var metrics = Resources.DisplayMetrics; var widthInDp = ConvertPixelsToDp(metrics.WidthPixels); var heightInDp = ConvertPixelsToDp(metrics.HeightPixels); //imgWine = FindViewById<ImageView>(Resource.Id.imgWine12); HighImageWine = FindViewById <ImageView>(Resource.Id.WineImage); //ProfilePicturePickDialog pppd = new ProfilePicturePickDialog(); //string path = pppd.CreateDirectoryForPictures(); //var filePath = System.IO.Path.Combine(path + "/" + wineid + ".jpg"); //if (System.IO.File.Exists(filePath)) //{ // Bitmap imageBitmap = BitmapFactory.DecodeFile(filePath); // imgWine.SetImageBitmap(imageBitmap); //} //else //{ // Bitmap imageBitmap = BlobWrapper.Bottleimages(wineid); // imgWine.SetImageBitmap(imageBitmap); //} //imgWine.LayoutParameters = new RelativeLayout.LayoutParams(1100, 1100); BitmapFactory.Options options = new BitmapFactory.Options { InJustDecodeBounds = false, OutHeight = 75, OutWidth = 75 }; ProgressIndicator.Hide(); Bitmap result = BitmapFactory.DecodeResource(Resources, Resource.Drawable.placeholder_re, options); } catch (Exception ex) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Sorry"); alert.SetMessage("We're under maintainence"); alert.SetNegativeButton("Ok", delegate { }); Dialog dialog = alert.Create(); dialog.Show(); } //downloadButton = FindViewById<Button>(Resource.Id.Download); //try //{ // //downloadButton.Enabled = true; // downloadButton.Click += downloadAsync; // //downloadButton.Enabled = false; //} //catch (Exception e) { } }
/// <summary> /// /// </summary> /// <param name="bundle"></param> protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); try { if (StoreName == "") { StoreName = Intent.GetStringExtra("MyData"); } this.Title = StoreName; this.ActionBar.SetHomeButtonEnabled(true); this.ActionBar.SetDisplayShowTitleEnabled(true);// ToolbartItems.Add(new ToolbarItem { Text = "BTN 1", Icon = "myicon.png" }); int StoreId = 0; if (StoreName == "Wall Store") { StoreId = 1; } else if (StoreName == "Point Pleasant Store") { StoreId = 2; } else { StoreId = 3; } int userId = Convert.ToInt32(CurrentUser.getUserId()); ServiceWrapper sw = new ServiceWrapper(); ItemListResponse output = new ItemListResponse(); output = sw.GetItemList(StoreId, userId).Result; SetContentView(Resource.Layout.Main); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); //var listview = FindViewById<ListView>(Resource.Id.gridview); List <Item> myArr; //myArr = SampleData(); myArr = output.ItemList.ToList(); var gridview = FindViewById <GridView>(Resource.Id.gridview); //myArr = SampleData(); GridViewAdapter adapter = new GridViewAdapter(this, myArr); gridview.SetNumColumns(2); gridview.Adapter = adapter; gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { WineID = myArr[args.Position].WineId; //detailViewActivity dva = new detailViewActivity(); //dva.downloadAsync(sender, args, WineID); ProgressIndicator.Show(this); var intent = new Intent(this, typeof(detailViewActivity)); intent.PutExtra("WineID", WineID); StartActivity(intent); // ProgressDialog progressdialog = ProgressDialog.Show(this, "Please Wait", "We are loading it"); // new Thread(new ThreadStart(delegate //{ // RunOnUiThread(() => progressdialog.Show()); // Thread.Sleep(10000); // RunOnUiThread(() => progressdialog.Dismiss()); // //RunOnUiThread(() => progressDialog.Wait(1000)); // //RunOnUiThread(() => progressDialog.Hide()); // })).Start(); }; ProgressIndicator.Hide(); } catch (Exception ex) { AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Profile); try { ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); int userId = Convert.ToInt32(CurrentUser.getUserId()); ServiceWrapper sw = new ServiceWrapper(); var output = sw.GetCustomerDetails(userId).Result; ImageView propicimage = FindViewById <ImageView>(Resource.Id.propicview); ProfilePicturePickDialog pppd = new ProfilePicturePickDialog(); string path = pppd.CreateDirectoryForPictures(); //string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); var filePath = System.IO.Path.Combine(path + "/" + userId + ".jpg"); if (System.IO.File.Exists(filePath)) { Bitmap imageBitmap = BitmapFactory.DecodeFile(filePath); if (imageBitmap == null) { propicimage.SetImageResource(Resource.Drawable.user1); //propicimage.SetImageBitmap(imageBitmap); } else { propicimage.SetImageBitmap(imageBitmap); } } else { Bitmap imageBitmap = BlobWrapper.ProfileImages(userId); if (imageBitmap == null) { propicimage.SetImageResource(Resource.Drawable.user1); } else { propicimage.SetImageBitmap(imageBitmap); } } ImageButton changepropic = FindViewById <ImageButton>(Resource.Id.btnChangePropic); //changepropic.SetImageResource(Resource.Drawable.dpreplacer); //changepropic.SetScaleType(ImageView.ScaleType.CenterCrop); changepropic.Click += delegate { Intent intent = new Intent(this, typeof(ProfilePicturePickDialog)); StartActivity(intent); }; //Button Btnlogout = FindViewById<Button>(Resource.Id.button1); //Btnlogout.Click += delegate //{ // Intent intent = new Intent(this, typeof(LoginActivity)); // StartActivity(intent); //}; EditText Firstname = FindViewById <EditText>(Resource.Id.txtFirstName); Firstname.Text = output.customer.FirstName; EditText Lastname = FindViewById <EditText>(Resource.Id.txtLastName); Lastname.Text = output.customer.LastName; EditText Mobilenumber = FindViewById <EditText>(Resource.Id.txtMobileNumber); string phno1 = output.customer.PhoneNumber; string phno2 = output.customer.Phone2; if (phno1 != null) { Mobilenumber.Text = phno1; } else { Mobilenumber.Text = phno2; } EditText Email = FindViewById <EditText>(Resource.Id.txtEmail); Email.Text = output.customer.Email; EditText Address = FindViewById <EditText>(Resource.Id.txtAddress); string Addres2 = output.customer.Address2; string Addres1 = output.customer.Address1; Address.Text = string.Concat(Addres1, Addres2); EditText City = FindViewById <EditText>(Resource.Id.txtCity); City.Text = output.customer.City; EditText State = FindViewById <EditText>(Resource.Id.txtState); State.Text = output.customer.State; Button updatebtn = FindViewById <Button>(Resource.Id.UpdateButton); //updatebtn.SetScaleType(ImageView.ScaleType.CenterCrop); updatebtn.Click += async delegate { Customer customer = new Customer(); customer.FirstName = Firstname.Text; customer.LastName = Lastname.Text; customer.PhoneNumber = Mobilenumber.Text; customer.Address1 = Address.Text; customer.Email = Email.Text; customer.CustomerID = userId; customer.State = State.Text; customer.City = City.Text; var x = await sw.UpdateCustomer(customer); if (x == 1) { Toast.MakeText(this, "Thank you your profile is Updated", ToastLength.Short).Show(); } }; } catch (Exception exe) { AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } ProgressIndicator.Hide(); }
protected override void OnCreate(Bundle bundle) { Stopwatch st = new Stopwatch(); st.Start(); base.OnCreate(bundle); try { //SetContentView(Resource.Layout.MyFavoriteGridView); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); if (StoreName == "") { StoreName = Intent.GetStringExtra("MyData"); } this.Title = StoreName; int userId = Convert.ToInt32(CurrentUser.getUserId()); ServiceWrapper sw = new ServiceWrapper(); ItemListResponse output = new ItemListResponse(); output = sw.GetItemFavsUID(userId).Result; List <Item> myArr; myArr = output.ItemList.ToList(); if (output.ItemList.Count == 0) { SetContentView(Resource.Layout.FavEmp); TextView txtName = FindViewById <TextView>(Resource.Id.textView1); ImageView Imag = FindViewById <ImageView>(Resource.Id.imageView1); //AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme); ////aler.SetTitle("No Reviews Avalilable"); //aler.SetMessage("Sorry you didn't tell us your Favourite wines"); //LoggingClass.LogInfo("Sorry you didn't tell us your Favourite wines", screenid); //aler.SetNegativeButton("Ok", delegate { Finish(); }); //LoggingClass.LogInfo("Clicked on Secaucus", screenid); //Dialog dialog = aler.Create(); //dialog.Show(); } else { SetContentView(Resource.Layout.MyFavoriteGridView); var gridview = FindViewById <GridView>(Resource.Id.gridviewfav); MyFavoriteAdapter adapter = new MyFavoriteAdapter(this, myArr); LoggingClass.LogInfo("Entered into Favourite Adapter", screenid); gridview.SetNumColumns(2); gridview.Adapter = adapter; gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { try { string WineBarcode = myArr[args.Position].Barcode; int storeid = 1;// myArr[args.Position].PlantFinal; //ProgressIndicator.Show(this); AndHUD.Shared.Show(this, "Loading...", Convert.ToInt32(MaskType.Clear)); var intent = new Intent(this, typeof(DetailViewActivity)); LoggingClass.LogInfo("Clicked on " + myArr[args.Position].Barcode + " to enter into wine details", screenid); intent.PutExtra("WineBarcode", WineBarcode); intent.PutExtra("storeid", storeid); StartActivity(intent); } catch (Exception) { string WineBarcode = myArr[args.Position].Barcode; int storeid = myArr[args.Position].PlantFinal; ProgressIndicator.Show(this); AndHUD.Shared.Dismiss(); var intent = new Intent(this, typeof(DetailViewActivity)); LoggingClass.LogInfo("Clicked on " + myArr[args.Position].Barcode + " to enter into wine details", screenid); intent.PutExtra("WineBarcode", WineBarcode); intent.PutExtra("storeid", storeid); StartActivity(intent); } }; LoggingClass.LogInfo("Entered into My Favorites Activity", screenid); } st.Stop(); LoggingClass.LogTime("Favouriteactivity", st.Elapsed.TotalSeconds.ToString()); ProgressIndicator.Hide(); } catch (Exception exe) { LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString()); ProgressIndicator.Hide(); AlertDialog.Builder aler = new AlertDialog.Builder(this); aler.SetTitle("Sorry"); aler.SetMessage("We're under maintainence"); aler.SetNegativeButton("Ok", delegate { }); Dialog dialog = aler.Create(); dialog.Show(); } }