private async void OnSendClicked(object sender, EventArgs e) { /* * var act = MainApplication.CurrentActivity; * ActivityManager activityManager = (ActivityManager)GetSystemService(Context.ActivityService); * var runningProcesses = activityManager?.RunningAppProcesses; * var appTasks = activityManager.AppTasks; * var num = appTasks.Count; * var runningTasks = activityManager?.GetRunningTasks(100); */ //send the contents of the edit text var msg = _messageInput.Text; // if text is empty do nothing if (string.IsNullOrWhiteSpace(msg)) { return; } // Dismiss the keyboard KeyboardStatusService.DismissKeyboard(this, _messageInput); // send message var success = await ViewModel.SendMessage(msg); // if not sent reinstate text field contents if (success) { Finish(); } else { Toast.MakeText(this, Resource.String.send_error, ToastLength.Short); _messageInput.Text = msg; } }
public override void OnAttachedToWindow() { base.OnAttachedToWindow(); Window.AddFlags(WindowManagerFlags.ShowWhenLocked); if (_messageInput != null) { _messageInput.RequestFocus(); KeyboardStatusService.ShowKeyboard(ApplicationContext, _messageInput, true); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.SetLayout(DisplayDetails.DisplayWidthPx, -2); Window.SetGravity(GravityFlags.Top | GravityFlags.Left); var wlp = Window.Attributes; wlp.X = 0; wlp.Y = 0; wlp.Width = DisplayDetails.DisplayWidthPx; wlp.HorizontalMargin = 0; wlp.VerticalMargin = 0; Window.Attributes = wlp; SetContentView(Resource.Layout.remote_notification_reply); SetFinishOnTouchOutside(false); BindViews(); BindEvents(); _messageInput.RequestFocus(); KeyboardStatusService.ShowKeyboard(this, _messageInput); }
private async void OnSendClicked(object sender, EventArgs e) { //send the contents of the edit text var msg = _chatMessageInput.Text; // if text is empty do nothing if (string.IsNullOrWhiteSpace(msg)) { return; } // clear text field _chatMessageInput.Text = ""; KeyboardStatusService.DismissKeyboard(Activity, _chatMessageInput); // send message var success = await ViewModel.SendMessage(msg); // if not sent reinstate text field contents if (!success) { _chatMessageInput.Text = msg; } }
private async void OnCancelClicked(object sender, EventArgs e) { // Dismiss the keyboard KeyboardStatusService.DismissKeyboard(this, _messageInput); Finish(); }