コード例 #1
0
        public void Load(string text)
        {
            try
            {
                AutoLinkTextView.AddAutoLinkMode(AutoLinkMode.ModePhone, AutoLinkMode.ModeEmail, AutoLinkMode.ModeHashtag, AutoLinkMode.ModeUrl, AutoLinkMode.ModeMention, AutoLinkMode.ModeCustom);
                AutoLinkTextView.SetPhoneModeColor(ContextCompat.GetColor(Activity, Resource.Color.left_ModePhone_color));
                AutoLinkTextView.SetEmailModeColor(ContextCompat.GetColor(Activity, Resource.Color.left_ModeEmail_color));
                AutoLinkTextView.SetHashtagModeColor(ContextCompat.GetColor(Activity, Resource.Color.left_ModeHashtag_color));
                AutoLinkTextView.SetUrlModeColor(ContextCompat.GetColor(Activity, Resource.Color.left_ModeUrl_color));
                AutoLinkTextView.SetMentionModeColor(Color.ParseColor(AppSettings.MainColor));
                var textSplit = text.Split('/');
                if (textSplit.Count() > 1)
                {
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.left_ModeUrl_color));
                    AutoLinkTextView.SetCustomRegex(@"\b(" + textSplit.LastOrDefault() + @")\b");
                }

                string lastString = text.Replace(" /", " ");
                if (!string.IsNullOrEmpty(lastString))
                {
                    AutoLinkTextView.SetAutoLinkText(lastString);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #2
0
        public void Load(string text)
        {
            try
            {
                AutoLinkTextView.AddAutoLinkMode(AutoLinkMode.ModePhone, AutoLinkMode.ModeEmail, AutoLinkMode.ModeHashtag, AutoLinkMode.ModeUrl, AutoLinkMode.ModeMention, AutoLinkMode.ModeCustom);
                AutoLinkTextView.SetPhoneModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModePhone_color));
                AutoLinkTextView.SetEmailModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeEmail_color));
                AutoLinkTextView.SetHashtagModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeHashtag_color));
                AutoLinkTextView.SetUrlModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeUrl_color));
                AutoLinkTextView.SetMentionModeColor(Color.ParseColor(AppSettings.MainColor));
                var textSplit = text.Split('/');
                switch (textSplit.Count())
                {
                case > 1:
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeUrl_color));
                    AutoLinkTextView.SetCustomRegex(@"\b(" + textSplit.LastOrDefault() + @")\b");
                    break;
                }

                string lastString = text.Replace(" /", " ");
                switch (string.IsNullOrEmpty(lastString))
                {
                case false:
                    AutoLinkTextView.SetAutoLinkText(lastString);
                    break;
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
コード例 #3
0
        public void Load(string text, string position = "Left")
        {
            try
            {
                AutoLinkTextView.AddAutoLinkMode(AutoLinkMode.ModePhone, AutoLinkMode.ModeEmail, AutoLinkMode.ModeHashtag, AutoLinkMode.ModeUrl, AutoLinkMode.ModeMention, AutoLinkMode.ModeCustom);
                if (position == "Right" || position == "right")
                {
                    AutoLinkTextView.SetPhoneModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModePhone_color));
                    AutoLinkTextView.SetEmailModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeEmail_color));
                    AutoLinkTextView.SetHashtagModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeHashtag_color));
                    AutoLinkTextView.SetUrlModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeUrl_color));
                    AutoLinkTextView.SetMentionModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeMention_color));
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeUrl_color));
                    AutoLinkTextView.SetSelectedStateColor(ContextCompat.GetColor(Activity, Resource.Color.accent));
                }
                else
                {
                    AutoLinkTextView.SetPhoneModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModePhone_color));
                    AutoLinkTextView.SetEmailModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModeEmail_color));
                    AutoLinkTextView.SetHashtagModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModeHashtag_color));
                    AutoLinkTextView.SetUrlModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModeUrl_color));
                    AutoLinkTextView.SetMentionModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModeMention_color));
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModeUrl_color));
                    AutoLinkTextView.SetSelectedStateColor(ContextCompat.GetColor(Activity, Resource.Color.accent));
                }
                var textt = text.Split('/');
                if (textt.Count() > 1)
                {
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.Left_ModeUrl_color));
                    AutoLinkTextView.SetCustomRegex(@"\b(" + textt.LastOrDefault() + @")\b");
                }

                string laststring = text.Replace(" /", " ");
                if (!string.IsNullOrEmpty(laststring))
                {
                    AutoLinkTextView.SetAutoLinkText(laststring);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
コード例 #4
0
        public void Load(string autoLinkText, string position = "Left")
        {
            try
            {
                AutoLinkTextView.AddAutoLinkMode(AutoLinkMode.ModePhone, AutoLinkMode.ModeEmail, AutoLinkMode.ModeHashtag, AutoLinkMode.ModeUrl, AutoLinkMode.ModeMention, AutoLinkMode.ModeCustom);

                if (position == "Sent" || position == "sent")
                {
                    AutoLinkTextView.SetPhoneModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModePhone_color));
                    AutoLinkTextView.SetEmailModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeEmail_color));
                    AutoLinkTextView.SetHashtagModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeHashtag_color));
                    AutoLinkTextView.SetUrlModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeUrl_color));
                    AutoLinkTextView.SetMentionModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeMention_color));
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.right_ModeUrl_color));
                }
                else
                {
                    AutoLinkTextView.SetPhoneModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModePhone_color));
                    AutoLinkTextView.SetEmailModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeEmail_color));
                    AutoLinkTextView.SetHashtagModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeHashtag_color));
                    AutoLinkTextView.SetUrlModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeUrl_color));
                    AutoLinkTextView.SetMentionModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeMention_color));
                    AutoLinkTextView.SetCustomModeColor(ContextCompat.GetColor(Activity, Resource.Color.AutoLinkText_ModeUrl_color));
                }
                var text = autoLinkText.Split('/');
                if (text.Count() > 1)
                {
                    AutoLinkTextView.SetCustomRegex(@"\b(" + text.LastOrDefault() + @")\b");
                }

                string lastString = autoLinkText.Replace(" /", " ");
                if (!string.IsNullOrEmpty(lastString))
                {
                    AutoLinkTextView.SetAutoLinkText(Methods.FunString.DecodeString(lastString));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }