Example #1
0
 private void ShowSearchList()
 {
     mCurrentAdapter   = mSearchAdapter;
     mListView.Adapter = mCurrentAdapter;
     mSyncContext.Post(delegate {
         mCurrentAdapter.NotifyDataSetChanged();
     }, null);
 }
Example #2
0
            private void InitUIComponents(View rootView)
            {
                mListView            = rootView.FindViewById(Resource.Id.list) as ListView;
                mAdapter             = new SendBirdChannelAdapter(this.Activity);
                mSearchAdapter       = new SendBirdChannelAdapter(this.Activity);
                mListView.ItemClick += (sender, e) => {
                    Channel channel = mCurrentAdapter[e.Position];
                    if (OnChannelSelected != null)
                    {
                        OnChannelSelected(this, new ChannelEventArgs(channel));
                    }
                };

                mEtxtSearch = rootView.FindViewById(Resource.Id.etxt_search) as EditText;
                mEtxtSearch.AfterTextChanged += (sender, e) => {
                    if (e.Editable.Length() <= 0)
                    {
                        ShowChannelList();
                    }
                    else
                    {
                        ShowSearchList();
                    }
                };
                mEtxtSearch.KeyPress += (sender, e) => {
                    if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
                    {
                        Search(mEtxtSearch.Text);

                        e.Handled = true;
                    }
                    else
                    {
                        e.Handled = false;
                    }
                };
            }
Example #3
0
 private void ShowSearchList()
 {
     mCurrentAdapter   = mSearchAdapter;
     mListView.Adapter = mCurrentAdapter;
     mCurrentAdapter.NotifyDataSetChanged();
 }
Example #4
0
 private void ShowChannelList()
 {
     mCurrentAdapter   = mAdapter;
     mListView.Adapter = mCurrentAdapter;
     mCurrentAdapter.NotifyDataSetChanged();
 }