//Used to get the initial point protected override void OnLongPressing(MR.Gestures.LongPressEventArgs e) { base.OnLongPressing(e); initXCord = (int)(e.Touches[0].X * 3 / e.ViewPosition.Width); //On APA app it would probably be * 5 cause there is about 5 rows I believe inityCord = (int)(e.Touches[0].Y * 3 / e.ViewPosition.Height); }
private async void OnListViewItemLongPressing(object sender, MR.Gestures.LongPressEventArgs e) { var item = (ConversationForList)((ViewCell)sender).BindingContext; if (!(item is ConversationForList selectedConversation)) { return; } var blocker = await _viewModel.CheckBlockUserAsync(selectedConversation.UserId); var toDisplay = blocker ? AppResources.Unblock : AppResources.Block; var action = await DisplayActionSheet(null, AppResources.Cancel, toDisplay, AppResources.Report, AppResources.GoToTravel, AppResources.GoToProfile, AppResources.Delete); if (action == AppResources.GoToTravel) { var tripId = selectedConversation.TripId; await Navigation.PushAsync(new TripPage(tripId)); } if (action == AppResources.GoToProfile) { var userId = selectedConversation.UserId; await Navigation.PushAsync(new ModalUserProfilePage(userId)); } if (action == AppResources.Report) { var targetUserId = selectedConversation.UserId; await Navigation.PushAsync(new ModalObjectionableReasonsPage(targetUserId, null)); } if (action == AppResources.Block) { var targetUserName = item.UserName; var resultBlock = await DisplayAlert($"{AppResources.Block} {targetUserName}?", $"{targetUserName} {AppResources.BlockUser}", AppResources.Block, AppResources.Cancel); if (resultBlock) { await BlockUser(selectedConversation.UserId); } } if (action == AppResources.Unblock) { await UnblockUser(selectedConversation.UserId); } if (action == AppResources.Delete) { var result = await DisplayAlert(AppResources.ConfirmAction, AppResources.QuestionDoYouWantToDeleteTheConversation, AppResources.ConfirmActionYes, AppResources.ConfirmActionNo); if (result) { await RemoveConversationData(selectedConversation.Id); } } if (action == AppResources.Cancel) { return; } }
////This is used to let the user know when he can move the block void longPressing(object sender, MR.Gestures.LongPressEventArgs e) { var label = e.Sender as MR.Gestures.Label; if (label == null) { return; } shakeLabel(sender, label); }
async void LongPressing(object sender, MR.Gestures.LongPressEventArgs e) { Label lblMessage = (Label)sender; var page = new ModalChatMessageActionPage(lblMessage.Text.Trim(), lblMessage.FontFamily); await Navigation.PushPopupAsync(page); }
private void LongPressingGesture(object sender, MR.Gestures.LongPressEventArgs e) { ArticleViewModel articleViewModel = (ArticleViewModel)BindingContext; CellGestures.LongPressingGesture(_stateController, articleViewModel); }
private async void MrButton_LongPressed(object sender, MR.Gestures.LongPressEventArgs e) { await DisplayAlert("Coordinates", $"{e.ViewPosition.X:F}/{e.ViewPosition.Y:F}/{e.ViewPosition.Width:F}/{e.ViewPosition.Height:F}", "OK"); }
void Cell_LongPressed(object sender, MR.Gestures.LongPressEventArgs e) { ((TextOnlyViewModel)BindingContext).AddText("Cell_LongPressed method called"); }
private void Box_LongPressing(object sender, MR.Gestures.LongPressEventArgs e) { DisplayAlert("Example", e.Duration.ToString(), "OK"); // in LongPressing Duration is always 0, it only has a value in LongPressed }
private void HideInfoPopup(object sender, MR.Gestures.LongPressEventArgs e) { InfoPopup.Hide(); }
private void ShowInfoPopup(object sender, MR.Gestures.LongPressEventArgs e) { InfoPopup.Show(); }