public void setFocusOnUserInput() { RunOnUiThread(() => { inputUser.RequestFocus(); }); }
private void ClearForm() { var toast = Toast.MakeText(this.Activity, "Word added", ToastLength.Short); toast.Show(); WordText.Text = ""; TranslatedWordText.Text = ""; WordText.RequestFocus(); }
/** Method Declarations **/ /** Route Selection Screen **/ protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); RequestWindowFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.MapLayout); mapView = FindViewById <MapView>(Resource.Id.mapview); //Registers the device if it's not already in the database, puts it on another thread registerDeviceAsync(); //Loads the map background await loadMap(bundle); //Binds layout elements to a set of variables AutoCompleteTextView destinationBox = FindViewById <AutoCompleteTextView>(Resource.Id.destinationSearchView); AutoCompleteTextView originBox = FindViewById <AutoCompleteTextView>(Resource.Id.originSearchView); FrameLayout originFrame = FindViewById <FrameLayout>(Resource.Id.originFrame); FrameLayout destinationFrame = FindViewById <FrameLayout>(Resource.Id.destinationFrame); Button routeButton = FindViewById <Button>(Resource.Id.routeButton); Button originClear = FindViewById <Button>(Resource.Id.originClearButton); Button destinationClear = FindViewById <Button>(Resource.Id.destinationClearButton); SlidingUpPanelLayout view = FindViewById <SlidingUpPanelLayout>(Resource.Id.sliding_layout); Button startButton = FindViewById <Button>(Resource.Id.startButton); FloatingActionMenu fam = FindViewById <FloatingActionMenu>(Resource.Id.fabMenu); FloatingActionButton delayFab = FindViewById <FloatingActionButton>(Resource.Id.delayFab); FloatingActionButton closureFab = FindViewById <FloatingActionButton>(Resource.Id.closureFab); //Configures the autocomplete text views configureActv(destinationBox, originBox, destinationFrame, destinationClear, routeButton); configureActv(originBox, destinationBox, originFrame, originClear, routeButton); //Turns the originBox green if it already contains a valid value makeActvTurnGreenWhenAddressesAreValid(originBox, originFrame); //Sets up the sliding panel on the bottom var manager = initializeSlidingPanel(); initializeSlidingPanelDelegates(view, manager); //Sets up delegates for the stawrt and select buttons bindStartSelectButtonDelegates(startButton, routeButton, originBox, destinationBox); //Sets focus on the destination box so the user can immediately begin typing there destinationBox.RequestFocus(); //Binds the delegates to each floating action menu option bindFloatingActionMenuOptionDelegates(fam, delayFab, closureFab); }
private void FromButton_Click(object sender, EventArgs e) { PopupMenu menu = new PopupMenu(this, sender as View); menu.MenuItemClick += (s, a) => { if (a.Item.ItemId == 0) { UpdateAutoFrom(); } else if (a.Item.ItemId == 1) { fromTextView.RequestFocus(); fromTextView.ShowDropDown(); fromTextView.SelectAll(); fromTextView.PostDelayed(() => { InputMethodManager inputMethodManager = GetSystemService(Context.InputMethodService) as InputMethodManager; inputMethodManager.ShowSoftInput(fromTextView, ShowFlags.Forced); }, 250); } else { Stop stop = TramUrWayApplication.GetStop(a.Item.ItemId); fromTextView.Text = stop.Name; } }; // Auto: based on current location and favorites if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.AccessFineLocation) == Permission.Granted) { menu.Menu.Add(1, 0, 1, "Automatique").SetIcon(Resource.Drawable.ic_place); } // Favorite stops foreach (Stop stop in TramUrWayApplication.Config.FavoriteStops.GroupBy(s => s.Name).Select(g => g.First())) { menu.Menu.Add(1, stop.Id, 2, stop.Name); } // Other: focus the search box and trigger autocomplete menu.Menu.Add(1, 1, 3, "Autre ..."); menu.Show(); }
public void SetInstallationError() { _installation.RequestFocus(); _installation.SetError("Skal udfyldes", null); }
private async void RequestProcess() { try { Drawable icon_error = Resources.GetDrawable(Resource.Drawable.alert); icon_error.SetBounds(0, 0, 40, 30); if (txt_EmployeeName.Text != "") { if (txt_EmployeeDepartmentID.Text != "") { if (dtp_RequestStartTime.Text != "") { if (dtp_RequestEndTime.Text != "") { if (txt_Associries.Text != "") { if (txt_NoOFVendors.Text != "") { if (txt_Reasons.Text != "") { foreach (var item in ResultGetAllDepartmentEmployeeNameModel) { if (item.EmployeeName.ToString().Trim() == (txt_EmployeeName.Text.Trim())) { _ObjRequestProcess.EmployeeDepartmentID = item.EmployeeDepartmentID; _ObjRequestProcess.EmployeeId = item.EmployeeSrNo; } } progressDialog = ProgressDialog.Show(this, Android.Text.Html.FromHtml("<font color='#EC407A'> Please wait...</font>"), Android.Text.Html.FromHtml("<font color='#EC407A'> Creating New Request...</font>"), true); string Url = StatusModel.Url + "GetVendorUserInformationByVendorUserID"; WebHelpper _objHelper = new WebHelpper(); VendorUserRegistrationModel _objVendorUserRegistrationModel = new VendorUserRegistrationModel(); _objVendorUserRegistrationModel.VendorUserID = StatusModel.LoginUserName; var PostString = JsonConvert.SerializeObject(_objVendorUserRegistrationModel); var request = await _objHelper.MakePostRequest(Url, PostString, true); VendorUserRegistrationModel ResultVendorUserRegistrationModel = JsonConvert.DeserializeObject <VendorUserRegistrationModel>(request); _ObjRequestProcess.VendorSrNo = ResultVendorUserRegistrationModel.VendorSrNo; _ObjRequestProcess.VisitStartTime = Convert.ToDateTime(dtp_RequestStartTime.Text); _ObjRequestProcess.VisitEndTime = Convert.ToDateTime(dtp_RequestEndTime.Text); _ObjRequestProcess.VendorAccessories = txt_Associries.Text; _ObjRequestProcess.NoOfVendors = Convert.ToInt32(txt_NoOFVendors.Text); _ObjRequestProcess.VendorVisitResons = txt_Reasons.Text; _ObjRequestProcess.RequestProcessDate = Convert.ToDateTime(DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt")); _ObjRequestProcess.ActivityOwnerStatus = "None"; _ObjRequestProcess.AreaOwnerStatus = "None"; _ObjRequestProcess.SafetyStatus = "None"; _ObjRequestProcess.ContractorStatus = "None"; // ADD Insert Code Here WebHelpper _objHelper1 = new WebHelpper(); string Url1 = StatusModel.Url + "AddRequestProcess"; var PostString1 = JsonConvert.SerializeObject(_ObjRequestProcess); var requestTemp1 = await _objHelper1.MakePostRequest(Url1, PostString1, true); ResultModel ResultgetRequest1 = JsonConvert.DeserializeObject <ResultModel>(requestTemp1); if (ResultgetRequest1.success == 1) { progressDialog.Hide(); Toast.MakeText(this, ResultgetRequest1.msg, ToastLength.Short).Show(); } else { progressDialog.Hide(); Toast.MakeText(this, ResultgetRequest1.msg, ToastLength.Short).Show(); return; } clear(); } else { txt_Reasons.RequestFocus(); txt_Reasons.SetError("Please Enter Visit Reason First", icon_error); } } else { txt_NoOFVendors.RequestFocus(); txt_NoOFVendors.SetError("Please Select No of Vendors First", icon_error); } } else { txt_Associries.RequestFocus(); txt_Associries.SetError("Please Enter Associries First", icon_error); } } else { dtp_RequestEndTime.RequestFocus(); dtp_RequestEndTime.SetError("Please Select End Time First", icon_error); } } else { dtp_RequestEndTime.RequestFocus(); dtp_RequestEndTime.SetError("Please Select Start Time First", icon_error); } } else { txt_EmployeeDepartmentID.RequestFocus(); txt_EmployeeDepartmentID.SetError("Please Select Employee Department First", icon_error); } } else { txt_EmployeeName.RequestFocus(); txt_EmployeeName.SetError("Please Enter Full Name First", icon_error); } } catch (Exception e) { string ErrorMsg = e.ToString(); Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show(); } }
private async void DepartmentEmployeeRegistration() { try { TokenNo(); Drawable icon_error = Resources.GetDrawable(Resource.Drawable.alert); icon_error.SetBounds(0, 0, 40, 30); if (txt_EmployeeTokenNo.Text != "") { if (txt_EmployeeName.Text != "") { if (txt_EmployeeAddress.Text != "") { if (txt_EmployeeContactNo.Text != "") { if (txt_EmployeeEmailID.Text != "") { if (txt_EmployeeDepartmentID.Text != "") { if (txt_EmployeeDesignationID.Text != "") { if (txt_EmployeePassword.Text != "") { foreach (var item in ResultAllDesignationMaster) { if (item.DesignationName.ToString().Trim() == (txt_EmployeeDesignationID.Text.Trim())) { _ObjDepartmentEmployeeRegistration.EmployeeDepartmentID = item.DepartmentID; _ObjDepartmentEmployeeRegistration.EmployeeDesignationID = item.DesignationID; } } _ObjDepartmentEmployeeRegistration.DeviceTokenId = DTI.ToString(); _ObjDepartmentEmployeeRegistration.EmployeeTokenNo = txt_EmployeeTokenNo.Text; _ObjDepartmentEmployeeRegistration.EmployeeName = txt_EmployeeName.Text; _ObjDepartmentEmployeeRegistration.EmployeeAddress = txt_EmployeeAddress.Text; _ObjDepartmentEmployeeRegistration.EmployeeContactNo = txt_EmployeeContactNo.Text; _ObjDepartmentEmployeeRegistration.EmployeeEmailID = txt_EmployeeEmailID.Text; //_ObjDepartmentEmployeeRegistration.EmployeeDepartmentID = Convert.ToInt32(txt_EmployeeDepartmentID.Text); //_ObjDepartmentEmployeeRegistration.EmployeeDesignationID = Convert.ToInt32(txt_EmployeeDesignationID.Text); _ObjDepartmentEmployeeRegistration.EmployeePassword = txt_EmployeePassword.Text; _ObjDepartmentEmployeeRegistration.Date = Convert.ToDateTime(DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt")); // ADD Insert Code Here WebHelpper _objHelper = new WebHelpper(); string Url = StatusModel.Url + "AddDepartmentEmployeeRegistration"; progressDialog = ProgressDialog.Show(this, Android.Text.Html.FromHtml("<font color='#EC407A'> Please wait...</font>"), Android.Text.Html.FromHtml("<font color='#EC407A'> Data Inserting...</font>"), true); var PostString = JsonConvert.SerializeObject(_ObjDepartmentEmployeeRegistration); var requestTemp = await _objHelper.MakePostRequest(Url, PostString, true); ResultModel ResultgetRequest = JsonConvert.DeserializeObject <ResultModel>(requestTemp); if (ResultgetRequest.success == 1) { progressDialog.Hide(); Toast.MakeText(this, ResultgetRequest.msg, ToastLength.Short).Show(); } else { progressDialog.Hide(); Toast.MakeText(this, ResultgetRequest.msg, ToastLength.Short).Show(); return; } clear(); } else { txt_EmployeePassword.RequestFocus(); txt_EmployeePassword.SetError("Please Enter Password First", icon_error); } } else { txt_EmployeeDesignationID.RequestFocus(); txt_EmployeeDesignationID.SetError("Please Select Designation First", icon_error); } } else { txt_EmployeeDepartmentID.RequestFocus(); txt_EmployeeDepartmentID.SetError("Please Select Department First", icon_error); } } else { txt_EmployeeEmailID.RequestFocus(); txt_EmployeeEmailID.SetError("Please Enter Email ID First", icon_error); } } else { txt_EmployeeContactNo.RequestFocus(); txt_EmployeeContactNo.SetError("Please Enter Contact Number First", icon_error); } } else { txt_EmployeeAddress.RequestFocus(); txt_EmployeeAddress.SetError("Please Enter Address First", icon_error); } } else { txt_EmployeeName.RequestFocus(); txt_EmployeeName.SetError("Please Enter Full Name First", icon_error); } } else { txt_EmployeeTokenNo.RequestFocus(); txt_EmployeeTokenNo.SetError("Please Enter Token Number First", icon_error); } } catch (Exception e) { progressDialog.Hide(); string ErrorMsg = e.ToString(); Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show(); } }