private void ShowSearchList() { mCurrentAdapter = mSearchAdapter; mListView.Adapter = mCurrentAdapter; mSyncContext.Post(delegate { mCurrentAdapter.NotifyDataSetChanged(); }, null); }
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; } }; }
private void ShowSearchList() { mCurrentAdapter = mSearchAdapter; mListView.Adapter = mCurrentAdapter; mCurrentAdapter.NotifyDataSetChanged(); }
private void ShowChannelList() { mCurrentAdapter = mAdapter; mListView.Adapter = mCurrentAdapter; mCurrentAdapter.NotifyDataSetChanged(); }