private void SetUpReceipientUI() { /** Receipient Row Set Up**/ var recipientRowTitle = ObjectCreatorHelper.createLabel(12, 22, Color.White, TextAlignment.Center, Color.Orange, "Recipient UserID", new Thickness(8, 4, 8, 0)); //setUpRecipientPicker(); recipientEntry = ObjectCreatorHelper.createEntry(14, 36, Color.White, Color.Gray, new Thickness(8, 8, 8, 0), "Input Recipient Username", Keyboard.Create(KeyboardFlags.CapitalizeSentence)); var recipientDivider = new BoxView { WidthRequest = 200, HeightRequest = 0.25, BackgroundColor = Color.LightGray, Margin = new Thickness(0, 0, 0, 0) }; var RecipientRow = ObjectCreatorHelper.createStackLayout(new Thickness(0, 8, 0, 0), Color.White, 80, true); RecipientRow.Children.Add(recipientRowTitle); RecipientRow.Children.Add(recipientEntry); RecipientRow.Children.Add(recipientDivider); ObjectCreatorHelper.addChildToParent(deviceInfoRl, RecipientRow, ingestDeviceLv, 0, ingestDeviceLv.Height + 8, 0); var receipientDivider = new BoxView { WidthRequest = 200, HeightRequest = 1, BackgroundColor = Color.LightGray }; ObjectCreatorHelper.addChildToParent(deviceInfoRl, receipientDivider, RecipientRow, 0, RecipientRow.Height + 0.25, 0); recipientEntry.Completed += Entry_Completed; void Entry_Completed(object sender, EventArgs e) { autoPopulateEntry(((Entry)sender)); } ObjectCreatorHelper.addChildToParent(deviceInfoRl, ingestDeviceRecipientLv, receipientDivider, 0, receipientDivider.Height + 0.25, 0); ObjectCreatorHelper.addChildToParent(deviceInfoRl, submitBtn, ingestDeviceRecipientLv, 0, ingestDeviceLv.Height + 8, 0); /** END - User Recipient Row Set Up**/ }
public async void PullListOfDevices(string username) { var viewDeviceLv = ObjectCreatorHelper.createListview(false, new DataTemplate(typeof(MyDeviceCell)), 40, false, Color.White); viewDeviceLv.Margin = new Thickness(0, 0, 16, 0); var responsePull = await ServiceClient.Instance.getDevices(username); if (responsePull.ResponseCode != 200) { await DisplayAlert(string.Empty, "Error connecting to server", "Ok"); //loadingOverlay.IsVisible = false; // return; } deviceList.Add(new MobileDevice { ID = "AssetId", Name = "Type", UnitCost = "CostCode", DeviceColor = Color.FromHex(Constants.LIST_HEADER_BG_COLOR), OtherLabel = "Status" }); if (responsePull.ResponseString != null && responsePull.ResponseString != "") { Debug.WriteLine(responsePull.ResponseString); var responseArray = JArray.Parse(responsePull.ResponseString); foreach (JObject o in responseArray.Children <JObject>()) { deviceList.Add(new MobileDevice { ID = (string)o["assetId"], Name = "Samsung", UnitCost = costCode, DeviceColor = Color.White, OtherLabel = (string)o["status"] }); } } viewDeviceLv.BeginRefresh(); viewDeviceLv.ItemsSource = deviceList;// viewDeviceLv.EndRefresh(); ObjectCreatorHelper.addToRootParent(viewDeviceRl, viewDeviceLv, 8, 8, 0); if (deviceList.Count == 1) { ObjectCreatorHelper.addChildToParent(viewDeviceRl, noDeviceInListLabel, viewDeviceLv, 0, noDeviceInListLabel.Height, 0); } }
public void setupUI() { incomingStack.Spacing = 0; incomingStack.Children.Add(incomingLvHistory); incomingStack.Children.Add(noActiveIncomingLbl); ObjectCreatorHelper.addChildToParent(historyRl, incomingStack, incomingLb, 0, incomingLb.Height, -16); ObjectCreatorHelper.addChildToParent(historyRl, outgoingLb, incomingStack, 0, outgoingLb.Height, 0); ObjectCreatorHelper.addChildToParent(historyRl, outGoingLvHistory, outgoingLb, 0, outgoingLb.Height, 0); ObjectCreatorHelper.addChildToParent(historyRl, noActiveOutgoingLbl, outGoingLvHistory, 0, noActiveOutgoingLbl.Height, 0); if (outgoingTransferList.Count > 1) { historyRl.Children.Remove(noActiveOutgoingLbl); } if (incomingTransferList.Count > 1) { incomingStack.Children.Remove(noActiveIncomingLbl); } }
private void SetUpAssetIdUI() { /** Asset Row Set Up**/ var AssetRowTitle = ObjectCreatorHelper.createLabel(12, 32, Color.White, TextAlignment.Center, Color.Gray, "AssetID", new Thickness(0, 0, 0, 0)); AssetRowSubtitle = ObjectCreatorHelper.createLabel(14, 32, Color.White, TextAlignment.Center, Color.LightGray, "Tap to scan assetID barcode", new Thickness(0, 0, 0, 0)); var AssetIdRow = ObjectCreatorHelper.createStackLayout(new Thickness(8, 0, 8, 0), Color.White, 80, true); AssetIdRow.Children.Add(AssetRowTitle); AssetIdRow.Children.Add(AssetRowSubtitle); AssetIdRow.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => SetUpScanner(AssetRowSubtitle, ZXing.BarcodeFormat.CODE_93, "Scan Asset Id Code")), }); ObjectCreatorHelper.addToRootParent(deviceInfoRl, AssetIdRow, 8, 8, 16); assetDivider = new BoxView { WidthRequest = 200, HeightRequest = 1, BackgroundColor = Color.LightGray }; ObjectCreatorHelper.addChildToParent(deviceInfoRl, assetDivider, AssetIdRow, 0, assetDivider.Height, 0); /** END - Asset Row Set Up**/ }
private void SetUpImeiUI() { /** IMEI Row Set Up**/ var ImeiCodeRowTitle = ObjectCreatorHelper.createLabel(12, 32, Color.White, TextAlignment.Center, Color.Gray, "IMEI Barcode", new Thickness(0, 0, 0, 0)); ImeiCodeRowSubtitle = ObjectCreatorHelper.createLabel(14, 32, Color.White, TextAlignment.Center, Color.LightGray, "Tap to scan IMEI barcode", new Thickness(0, 0, 0, 0)); var ImeiCodeRow = ObjectCreatorHelper.createStackLayout(new Thickness(8, 0, 8, 0), Color.White, 80, true); ImeiCodeRow.Children.Add(ImeiCodeRowTitle); ImeiCodeRow.Children.Add(ImeiCodeRowSubtitle); ImeiCodeRow.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => SetUpScanner(ImeiCodeRowSubtitle, ZXing.BarcodeFormat.CODE_128, "Scan Asset IMEI Code")), }); var imeiDivider = new BoxView { WidthRequest = 200, HeightRequest = 1, BackgroundColor = Color.LightGray }; ObjectCreatorHelper.addChildToParent(deviceInfoRl, ImeiCodeRow, assetDivider, 0, assetDivider.Height + 0.25, 0); ObjectCreatorHelper.addChildToParent(deviceInfoRl, imeiDivider, ImeiCodeRow, 0, ImeiCodeRow.Height, 0); ObjectCreatorHelper.addChildToParent(deviceInfoRl, ingestDeviceLv, imeiDivider, 0, ImeiCodeRow.Height + 0.25, 0); /**END - IMEI Row Set Up**/ }