private void MAdapterOnItemLongClick(object sender, LastChatsAdapterClickEventArgs e) { try { var position = e.Position; if (position >= 0) { var item = MAdapter.GetItem(position); if (item != null) { switch (item.Type) { case Classes.ItemType.LastChatOldV: { OptionsLastMessagesBottomSheet bottomSheet = new OptionsLastMessagesBottomSheet(); Bundle bundle = new Bundle(); bundle.PutString("Type", "user"); bundle.PutString("Page", "Archived"); bundle.PutString("ItemObject", JsonConvert.SerializeObject(item.LastMessagesUser)); bottomSheet.Arguments = bundle; bottomSheet.Show(SupportFragmentManager, bottomSheet.Tag); break; } case Classes.ItemType.LastChatNewV: { OptionsLastMessagesBottomSheet bottomSheet = new OptionsLastMessagesBottomSheet(); Bundle bundle = new Bundle(); bundle.PutString("Page", "Archived"); switch (item.LastChat.ChatType) { case "user": bundle.PutString("Type", "user"); bundle.PutString("ItemObject", JsonConvert.SerializeObject(item.LastChat)); break; case "page": bundle.PutString("Type", "page"); bundle.PutString("ItemObject", JsonConvert.SerializeObject(item.LastChat)); break; case "group": bundle.PutString("Type", "group"); bundle.PutString("ItemObject", JsonConvert.SerializeObject(item.LastChat)); break; } bottomSheet.Arguments = bundle; bottomSheet.Show(SupportFragmentManager, bottomSheet.Tag); break; } } } } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }
private void MAdapterOnItemLongClick(object sender, LastChatsAdapterClickEventArgs e) { try { var position = e.Position; if (position >= 0) { var item = MAdapter.GetItem(position); if (item != null) { OptionsLastMessagesBottomSheet bottomSheet = new OptionsLastMessagesBottomSheet(); Bundle bundle = new Bundle(); bundle.PutString("Type", "page"); bundle.PutString("ItemObject", JsonConvert.SerializeObject(item.LastChatPage)); bottomSheet.Arguments = bundle; bottomSheet.Show(ChildFragmentManager, bottomSheet.Tag); } } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }