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 pullHistoryTransfers(string incomingType, string outgoingType, string username) { incomingLvHistory = ObjectCreatorHelper.createListview(false, new DataTemplate(typeof(CustomTableCell)), 40, false, Color.White); incomingLvHistory.Margin = new Thickness(0, 0, 16, 0); outGoingLvHistory = ObjectCreatorHelper.createListview(false, new DataTemplate(typeof(CustomTableCell)), 40, false, Color.White); outGoingLvHistory.Margin = new Thickness(0, 0, 16, 0); incomingTransferList.Add(new MobileDevice { ID = "AssetId", Name = "Sender UserID", UnitCost = "CostCode", DeviceColor = Color.FromHex(Constants.LIST_HEADER_BG_COLOR), OtherLabel = "TimeStamp" }); //Console.WriteLine("Value of i: {0}", i); outgoingTransferList.Add(new MobileDevice { ID = "AssetId", Name = "Recipient UserID", UnitCost = "CostCode", DeviceColor = Color.FromHex(Constants.LIST_HEADER_BG_COLOR), OtherLabel = "TimeStamp" }); //Console.WriteLine("Value of i: {0}", i); //PullIncoming History var responseIncomingPull = await ServiceClient.Instance.PastTransfers(incomingType, username, "false"); createList(responseIncomingPull, incomingLvHistory, incomingTransferList); //End Pull incoming history transfers //Pull outgoing History var responseOutgoingPull = await ServiceClient.Instance.PastTransfers(outgoingType, username, "false"); createList(responseOutgoingPull, outGoingLvHistory, outgoingTransferList); //End Pull outgoing history transfers setupUI(); }
protected void init() { costCode = Application.Current.Properties[Constants.USER_COSTCODE] as string; location = Application.Current.Properties[Constants.USER_LOCATION] as string; List <DevicesIngestData> pmDeviceInfoList = new List <DevicesIngestData>(); pmDeviceInfoList.Add(new DevicesIngestData { Title = "Location", SubTitle = location, TopPadding = new Thickness(0, 0, 0, 0), DeviceColor = Color.Gray, enableEntry = false }); pmDeviceInfoList.Add(new DevicesIngestData { Title = "CostCode", SubTitle = costCode, TopPadding = new Thickness(0, 0, 0, 0), DeviceColor = Color.Gray, enableEntry = false }); pmDeviceInfoList.Add(new DevicesIngestData { Title = "Status", SubTitle = "Active", TopPadding = new Thickness(0, 0, 0, 0), DeviceColor = Color.Gray, enableEntry = true }); ingestDeviceLv = ObjectCreatorHelper.createListview(false, new DataTemplate(typeof(IngestDeviceCell)), 80, true, Color.White); ingestDeviceLv.ItemsSource = pmDeviceInfoList; ingestDeviceRecipientLv = ObjectCreatorHelper.createListview(false, new DataTemplate(typeof(IngestDeviceCell)), 80, true, Color.White); ingestDeviceRecipientLv.ItemsSource = DeviceIngest.DeviceListRecipient; submitBtn = ObjectCreatorHelper.createbutton("Submit", 12, true, 55, Color.FromHex(Constants.ACCENT_COLOR), Color.White, FontAttributes.Bold, new Thickness(-5, -5, -5, 0)); submitBtn.Clicked += OnSubmitButtonClicked; SetUpAssetIdUI(); SetUpImeiUI(); pullListOfAccounts(); SetUpReceipientUI(); }
public static AnimationClip GenerateAndSaveAnimationToCurrentDirectory(List <Sprite> sprites, int frameRate, bool isLooping, string name) { var animationClip = GenerateAnimation(sprites, frameRate, isLooping, name); ObjectCreatorHelper.CreateAsset(animationClip, string.Format("{0}.anim", name)); return(animationClip); }
protected override void OnAppearing() { base.OnAppearing(); PullListOfDevices(usernameKey); noDeviceInListLabel = ObjectCreatorHelper.createLabel(13, 40, Color.White, TextAlignment.Center, Color.Gray, "No Active Devices", new Thickness(0, 0, 0, 0)); noDeviceInListLabel.VerticalTextAlignment = TextAlignment.Center; noDeviceInListLabel.HorizontalTextAlignment = TextAlignment.Center; }
public static T CreateStyle <T>() where T : BaseStyle { if (!Loaded) { Load(); } var style = ObjectCreatorHelper.CreateAsset <T>(); _stylesRepository.AddStyle(style); EditorUtility.SetDirty(_stylesRepository); return(style); }
public static void CreateFont() { var window = Dialog.ShowDialog <CreateFontDialogWindow>("Create font", DialogType.YesNo); window.Yes += sender => { var font = CoreUIStyleCreator.CreateStyle <CoreUIFont>(sender.Name); var material = new Material(Shader.Find("CoreUI/CoreUITextMeshShader")); material.SetTexture("_MainTex", sender.Texture); font.Material = material; ObjectCreatorHelper.CreateAsset(material, string.Format("{0}.mat", sender.Name)); font.Texture = sender.Texture; }; }
protected override void OnAppearing() { base.OnAppearing(); incomingLb = ObjectCreatorHelper.createLabel(10, 12, Color.Transparent, TextAlignment.Start, Color.Black, "INCOMING", new Thickness(0, 0, 0, 0)); outgoingLb = ObjectCreatorHelper.createLabel(10, 12, Color.Transparent, TextAlignment.Start, Color.Black, "OUTGOING", new Thickness(0, 16, 0, 0)); noActiveOutgoingLbl = ObjectCreatorHelper.createLabel(13, 40, Color.White, TextAlignment.Center, Color.Black, "No active transfers.", new Thickness(0, 0, 0, 0)); noActiveOutgoingLbl.VerticalTextAlignment = TextAlignment.Center; noActiveOutgoingLbl.HorizontalTextAlignment = TextAlignment.Center; noActiveIncomingLbl = ObjectCreatorHelper.createLabel(13, 40, Color.White, TextAlignment.Center, Color.Black, "No active transfers.", new Thickness(0, 0, 0, 0)); noActiveIncomingLbl.VerticalTextAlignment = TextAlignment.Center; noActiveIncomingLbl.HorizontalTextAlignment = TextAlignment.Center; // new Label ObjectCreatorHelper.addToRootParent(historyRl, incomingLb, 8, 8, -16); }
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**/ }
public static void CreateSettingsContainer() { ObjectCreatorHelper.CreateAsset <PresentationSettings>(); }
public static void CreateStylesRepository() { ObjectCreatorHelper.CreateAsset <StylesRepository>(); }
public HomePage() { InitializeComponent(); Title = "Home"; string acctType = (string)LogInResponseData.GetApplicationCurrentProperty(Constants.ACCOUNT_TYPE); uniqueDeviceAddress = Application.Current.Properties[Constants.DEVICE_ADDRESS] as string; usernameKey = Application.Current.Properties[Constants.USERNAME_KEY] as string; passKey = Application.Current.Properties[Constants.PASS_KEY] as string; deviceModel = Application.Current.Properties[Constants.DEVICE_MODEL] as string; ListView homeMenuLv = ObjectCreatorHelper.createListview(false, new DataTemplate(typeof(HomeMenuCell)), 80, true, Color.White); homeMenuLv.Margin = new Thickness(8, 8, 8, 8); homeMenuLv.SeparatorColor = Color.FromHex(Constants.LIST_SEPERATOR_COLOR); homeMenuLv.VerticalOptions = LayoutOptions.Fill; if (deviceModel != null) { assetModel.Text = deviceModel; } if (uniqueDeviceAddress != null) { currentAssetIdLbl.Text = uniqueDeviceAddress; } else { currentAssetIdLbl.Text = "UNKNOWN"; } switch (acctType) { case "1": // eus homeMenuLv.ItemsSource = MenuData.menuListSupport; AccountTypeTitle.Text = "End User Support"; break; case "0": //pm isDisposalAccept = true; homeMenuLv.ItemsSource = MenuData.menuListManager; AccountTypeTitle.Text = "Property Management"; break; default: homeMenuLv.ItemsSource = MenuData.menuListEmployee; AccountTypeTitle.Text = "Employee"; break; } homeOptions.Children.Add(homeMenuLv); homeMenuLv.ItemSelected += async(sender, e) => { loadingOverlayHome.IsVisible = true; if (e.SelectedItem == null) { // don't do anything if we just de-selected the row return; } else { switch ((e.SelectedItem as MenuObject).menuTitle) { case "Ingest a New Device": //TODO: open up camera layout to add new device before directing user to IngestDevicePage() await Navigation.PushAsync(new IngestDevicePage()); break; case "Collect Device": openBarCodeScaner(0); //Removed break; case "Initiate Inventory Check": var result = await DisplayAlert(Constants.INVENTORY_CHECK_TITLE, Constants.INVENTORY_CHECK_CONTENT, Constants.BUTTON_CONFIRM, Constants.BUTTON_CAN); loadingOverlayHome.IsVisible = false; break; case "Accept a Transfer": // PM / EUS user is accepting transfer into their possesion openBarCodeScaner(1); break; case "Disposal": // PM Only openBarCodeScaner(3); break; case "Submit Disposal Request": //EUS Only openBarCodeScaner(2); break; case "View Transfers": await Navigation.PushAsync(new InitiateTransferPage()); break; case "View My Devices": await Navigation.PushAsync(new ViewDevicesPage()); break; default: await DisplayAlert("Tapped", "Error in code" + " row was selected", Constants.BUTTON_POS); loadingOverlayHome.IsVisible = false; break; } ((ListView)sender).SelectedItem = null; loadingOverlayHome.IsVisible = false; } }; }