public void AutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs autoLinkOnClickEventArgs) { try { AutoLinkMode matchedText = autoLinkOnClickEventArgs.P0; var typetext = Methods.FunString.Check_Regex(autoLinkOnClickEventArgs.P1); if (typetext == "Email" || matchedText == AutoLinkMode.ModeEmail) { Methods.App.SendEmail(Activity, autoLinkOnClickEventArgs.P1); } else if (typetext == "Website" || matchedText == AutoLinkMode.ModeUrl) { string url = autoLinkOnClickEventArgs.P1; if (!autoLinkOnClickEventArgs.P1.Contains("http")) { url = "http://" + autoLinkOnClickEventArgs.P1; } var intent = new Intent(Activity, typeof(LocalWebViewActivity)); intent.PutExtra("URL", url); intent.PutExtra("Type", url); Activity.StartActivity(intent); } else if (typetext == "Hashtag" || matchedText == AutoLinkMode.ModeHashtag) { Bundle bundle = new Bundle(); bundle.PutString("Key", autoLinkOnClickEventArgs.P1.Replace("#", "")); VideosByKeyFragment videoViewerFragment = new VideosByKeyFragment() { Arguments = bundle }; Context?.FragmentBottomNavigator?.DisplayFragment(videoViewerFragment); } else if (typetext == "Mention" || matchedText == AutoLinkMode.ModeMention) { Bundle bundle = new Bundle(); bundle.PutString("Key", autoLinkOnClickEventArgs.P1.Replace("@", "")); VideosByKeyFragment videoViewerFragment = new VideosByKeyFragment() { Arguments = bundle }; Context?.FragmentBottomNavigator?.DisplayFragment(videoViewerFragment); } else if (typetext == "Number" || matchedText == AutoLinkMode.ModePhone) { Methods.App.SaveContacts(Activity, autoLinkOnClickEventArgs.P1, "", "2"); } } catch (Exception exception) { Console.WriteLine(exception); } }
public void AutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs autoLinkOnClickEventArgs) { try { var typetext = IMethods.Fun_String.Check_Regex(autoLinkOnClickEventArgs.P1); if (typetext == "Email") { IMethods.IApp.SendEmail(Application.Context, autoLinkOnClickEventArgs.P1); return; } else if (typetext == "Website") { String url = autoLinkOnClickEventArgs.P1; if (!autoLinkOnClickEventArgs.P1.Contains("http")) { url = "http://" + autoLinkOnClickEventArgs.P1; } var intent = new Intent(Application.Context, typeof(LocalWebView_Activity)); intent.PutExtra("URL", url); intent.PutExtra("Type", url); _activity.StartActivity(intent); return; } else if (typetext == "Hashtag") { return; } else if (typetext == "Mention") { return; } else if (typetext == "Number") { IMethods.IApp.SaveContacts(_activity, autoLinkOnClickEventArgs.P1, "", "2"); return; } else { return; } } catch (Exception exception) { Crashes.TrackError(exception); } }
public void AutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs autoLinkOnClickEventArgs) { try { AutoLinkMode matchedText = autoLinkOnClickEventArgs.P0; var typetext = Methods.FunString.Check_Regex(autoLinkOnClickEventArgs.P1); if (typetext == "Email" || matchedText == AutoLinkMode.ModeEmail) { Methods.App.SendEmail(Application.Context, autoLinkOnClickEventArgs.P1); } else if (typetext == "Website" || matchedText == AutoLinkMode.ModeUrl) { String url = autoLinkOnClickEventArgs.P1; if (!autoLinkOnClickEventArgs.P1.Contains("http")) { url = "http://" + autoLinkOnClickEventArgs.P1; } var intent = new Intent(Application.Context, typeof(LocalWebViewActivity)); intent.PutExtra("URL", url); intent.PutExtra("Type", url); Activity.StartActivity(intent); } else if (typetext == "Hashtag" || matchedText == AutoLinkMode.ModeHashtag) { } else if (typetext == "Mention" || matchedText == AutoLinkMode.ModeMention) { } else if (typetext == "Number" || matchedText == AutoLinkMode.ModePhone) { Methods.App.SaveContacts(Activity, autoLinkOnClickEventArgs.P1, "", "2"); } else { return; } } catch (Exception exception) { Console.WriteLine(exception); } }
public void AutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs autoLinkOnClickEventArgs) { try { var typetext = Methods.FunString.Check_Regex(autoLinkOnClickEventArgs.P1); if (typetext == "Email") { Methods.App.SendEmail(Activity, autoLinkOnClickEventArgs.P1); return; } else if (typetext == "Website") { String url = autoLinkOnClickEventArgs.P1; if (!autoLinkOnClickEventArgs.P1.Contains("http")) { url = "http://" + autoLinkOnClickEventArgs.P1; } var intent = new Intent(Application.Context, typeof(LocalWebViewActivity)); intent.PutExtra("URL", url); intent.PutExtra("Type", url); Activity.StartActivity(intent); return; } else if (typetext == "Hashtag") { // Show All Post By Hash Bundle bundle = new Bundle(); bundle.PutString("HashId", ""); bundle.PutString("HashName", Methods.FunString.DecodeString(autoLinkOnClickEventArgs.P1)); HashTagPostFragment profileFragment = new HashTagPostFragment { Arguments = bundle }; ((HomeActivity)Activity).OpenFragment(profileFragment); return; } else if (typetext == "Mention") { Bundle bundle = new Bundle(); bundle.PutString("Key", Methods.FunString.DecodeString(autoLinkOnClickEventArgs.P1)); SearchFragment searchFragment = new SearchFragment() { Arguments = bundle }; ((HomeActivity)Activity).OpenFragment(searchFragment); return; } else if (typetext == "Number") { // IMethods.App.SaveContacts(_activity, autoLinkOnClickEventArgs.P1, "", "2"); return; } else { return; } } catch (Exception exception) { Console.WriteLine(exception); } }
private void AutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs autoLinkOnClickEventArgs) { try { var typetext = Methods.FunString.Check_Regex(autoLinkOnClickEventArgs.P1.Replace(" ", "")); if (typetext == "Email") { Methods.App.SendEmail(Activity, autoLinkOnClickEventArgs.P1.Replace(" ", "")); } else if (typetext == "Website") { string url = autoLinkOnClickEventArgs.P1.Replace(" ", ""); if (!autoLinkOnClickEventArgs.P1.Contains("http")) { url = "http://" + autoLinkOnClickEventArgs.P1.Replace(" ", ""); } //var intent = new Intent(Activity, typeof(LocalWebViewActivity)); //intent.PutExtra("URL", url); //intent.PutExtra("Type", url); //Activity.StartActivity(intent); new IntentController(Activity).OpenBrowserFromApp(url); } else if (typetext == "Hashtag") { } else if (typetext == "Mention") { var dataUSer = ListUtils.MyProfileList.FirstOrDefault(); string name = autoLinkOnClickEventArgs.P1.Replace("@", "").Replace(" ", ""); var sqlEntity = new SqLiteDatabase(); var user = sqlEntity.Get_DataOneUser(name); sqlEntity.Dispose(); if (user != null) { WoWonderTools.OpenProfile(Activity, user.UserId, user); } else { if (name == dataUSer?.Name || name == dataUSer?.Username) { var intent = new Intent(Activity, typeof(MyProfileActivity)); Activity.StartActivity(intent); } else { var intent = new Intent(Activity, typeof(SearchActivity)); intent.PutExtra("Key", autoLinkOnClickEventArgs.P1.Replace("@", "").Replace(" ", "")); Activity.StartActivity(intent); } } } else if (typetext == "Number") { Methods.App.SaveContacts(Activity, autoLinkOnClickEventArgs.P1.Replace(" ", ""), "", "2"); } } catch (Exception exception) { Console.WriteLine(exception); } }
private void AddPostAutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs e) { try { if (e.P0 == AutoLinkMode.ModeEmail) { Methods.App.SendEmail(Activity, e.P1.Replace(" ", "")); } else if (e.P0 == AutoLinkMode.ModeUrl) { string url = e.P1.Replace(" ", ""); if (!e.P1.Contains("http")) { url = "http://" + e.P1.Replace(" ", ""); } //var intent = new Intent(Activity, typeof(LocalWebViewActivity)); //intent.PutExtra("URL", url); //intent.PutExtra("Type", url); //Activity.StartActivity(intent); new IntentController(Activity).OpenBrowserFromApp(url); } else if (e.P0 == AutoLinkMode.ModeHashtag) { var intent = new Intent(Activity, typeof(HashTagPostsActivity)); intent.PutExtra("Id", e.P1.Replace(" ", "")); intent.PutExtra("Tag", e.P1.Replace(" ", "")); Activity.StartActivity(intent); } else if (e.P0 == AutoLinkMode.ModeMention) { var dataUSer = ListUtils.MyProfileList.FirstOrDefault(); string name = e.P1.Replace("@", "").Replace(" ", ""); var sqlEntity = new SqLiteDatabase(); var user = sqlEntity.Get_DataOneUser(name); sqlEntity.Dispose(); if (user != null) { WoWonderTools.OpenProfile(Activity, user.UserId, user); } else { if (name == dataUSer?.Name || name == dataUSer?.Username) { if (PostClickListener.OpenMyProfile) { return; } var intent = new Intent(Activity, typeof(MyProfileActivity)); Activity.StartActivity(intent); } else { var intent = new Intent(Activity, typeof(UserProfileActivity)); //intent.PutExtra("UserObject", JsonConvert.SerializeObject(item)); intent.PutExtra("name", name); Activity.StartActivity(intent); } } } else if (e.P0 == AutoLinkMode.ModePhone) { Methods.App.SaveContacts(Activity, e.P1.Replace(" ", ""), "", "2"); } else if (e.P0 == AutoLinkMode.ModeCustom) { var dialog = new MaterialDialog.Builder(Activity); dialog.Title(Activity.GetText(Resource.String.Lbl_Location)); dialog.PositiveText(Activity.GetText(Resource.String.Lbl_RemoveLocation)).OnPositive(this); dialog.NeutralText(Activity.GetText(Resource.String.Lbl_ChangeLocation)).OnNeutral(this); dialog.NegativeText(Activity.GetText(Resource.String.Lbl_Cancel)).OnNegative(this); //dialog.AlwaysCallSingleChoiceCallback(); dialog.Build().Show(); } } catch (Exception exception) { Console.WriteLine(exception); } }
private void AutoLinkTextViewOnAutoLinkOnClick(object sender, AutoLinkOnClickEventArgs autoLinkOnClickEventArgs) { try { var typetext = Methods.FunString.Check_Regex(autoLinkOnClickEventArgs.P1.Replace(" ", "")); if (typetext == "Email" || autoLinkOnClickEventArgs.P0 == AutoLinkMode.ModeEmail) { Methods.App.SendEmail(Activity, autoLinkOnClickEventArgs.P1.Replace(" ", "")); } else if (typetext == "Website" || autoLinkOnClickEventArgs.P0 == AutoLinkMode.ModeUrl) { string url = autoLinkOnClickEventArgs.P1.Contains("http") switch { false => "http://" + autoLinkOnClickEventArgs.P1.Replace(" ", ""), _ => autoLinkOnClickEventArgs.P1.Replace(" ", "") }; //var intent = new Intent(Activity, typeof(LocalWebViewActivity)); //intent.PutExtra("URL", url); //intent.PutExtra("Type", url); //Activity.StartActivity(intent); new IntentController(Activity).OpenBrowserFromApp(url); } else if (typetext == "Hashtag" || autoLinkOnClickEventArgs.P0 == AutoLinkMode.ModeHashtag) { var intent = new Intent(Activity, typeof(HashTagPostsActivity)); intent.PutExtra("Id", autoLinkOnClickEventArgs.P1.Replace(" ", "")); intent.PutExtra("Tag", autoLinkOnClickEventArgs.P1.Replace(" ", "")); Activity.StartActivity(intent); } else if (typetext == "Mention" || autoLinkOnClickEventArgs.P0 == AutoLinkMode.ModeMention) { var dataUSer = ListUtils.MyProfileList?.FirstOrDefault(); string name = autoLinkOnClickEventArgs.P1.Replace("@", "").Replace(" ", ""); var sqlEntity = new SqLiteDatabase(); var user = sqlEntity.Get_DataOneUser(name); if (user != null) { WoWonderTools.OpenProfile(Activity, user.UserId, user); } else { if (name == dataUSer?.Name || name == dataUSer?.Username) { switch (PostClickListener.OpenMyProfile) { case true: return; default: { var intent = new Intent(Activity, typeof(MyProfileActivity)); Activity.StartActivity(intent); break; } } } else { var intent = new Intent(Activity, typeof(UserProfileActivity)); //intent.PutExtra("UserObject", JsonConvert.SerializeObject(item)); intent.PutExtra("name", name); Activity.StartActivity(intent); } } } else if (typetext == "Number" || autoLinkOnClickEventArgs.P0 == AutoLinkMode.ModePhone) { Methods.App.SaveContacts(Activity, autoLinkOnClickEventArgs.P1.Replace(" ", ""), "", "2"); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); } }