Exemplo n.º 1
0
 public static void Input(EmojiconEditText editText, Emojicon emojicon)
 {
     AddRecentEmoji (emojicon);
     if (editText == null || emojicon == null)
     {
         return;
     }
     int start = Math.Max(editText.SelectionStart,0);
     int end =Math.Max(editText.SelectionEnd,0);
     if (start < 0)
     {
         editText.Text += emojicon.Emoji;
         editText.SetSelection (editText.Text.Length);
     }
     else
     {
         editText.Text = editText.Text.Substring (0, Math.Min (start, end)) + emojicon.Emoji + editText.Text.Substring (Math.Max (start, end));
         editText.SetSelection (start+emojicon.Emoji.Length);
     }
 }
Exemplo n.º 2
0
        public static void Input(EmojiconEditText editText, Emojicon emojicon)
        {
            AddRecentEmoji(emojicon);
            if (editText == null || emojicon == null)
            {
                return;
            }
            int start = Math.Max(editText.SelectionStart, 0);
            int end   = Math.Max(editText.SelectionEnd, 0);

            if (start < 0)
            {
                editText.Text += emojicon.Emoji;
                editText.SetSelection(editText.Text.Length);
            }
            else
            {
                editText.Text = editText.Text.Substring(0, Math.Min(start, end)) + emojicon.Emoji + editText.Text.Substring(Math.Max(start, end));
                editText.SetSelection(start + emojicon.Emoji.Length);
            }
        }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);
            m_EditEmojicon = FindViewById<EmojiconEditText> (Resource.Id.editEmojicon);
            m_TextEmojicon = FindViewById<EmojiconTextView> (Resource.Id.txtEmojicon);
            btncopy = FindViewById<Button>(Resource.Id.button1);
            Android.Support.V4.App.FragmentManager mgr = SupportFragmentManager;
            EmojiconsFragment.EmojiClicked += (e) => {
                EmojiconsFragment.Input(m_EditEmojicon,e);
            };
            EmojiconsFragment.EmojiconBackspaceClicked += (v) => {
                EmojiconsFragment.Backspace(m_EditEmojicon);
            };
            m_EditEmojicon.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                m_TextEmojicon.Text = e.Text.ToString();
            };

            btncopy.Click += btncopy_Click;
        }