@Override public void onCoversationUpdate() { refresh(); }
@Override protected void initView() { inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); //会话列表控件 conversationListView = (EaseConversationList) getView().findViewById(R.id.list); // 搜索框 query = (EditText) getView().findViewById(R.id.query); // 搜索框中清除button clearSearch = (ImageButton) getView().findViewById(R.id.search_clear); errorItemContainer = (FrameLayout) getView().findViewById(R.id.fl_error_item); }
@Override public boolean onTouch(View v, MotionEvent event) { hideSoftKeyboard(); return false; } });
public void handleMessage(android.os.Message msg) { switch (msg.what) { case 0: onConnectionDisconnected(); break; case 1: onConnectionConnected(); break; case MSG_REFRESH: { conversationList.clear(); conversationList.addAll(loadConversationList()); conversationListView.refresh(); break; } default: break; } } };
protected void hideSoftKeyboard() { if (getActivity().getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getActivity().getCurrentFocus() != null) inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }
sortConversationByLastChatTime(sortList); } catch (Exception e) { e.printStackTrace();
@Override protected void setUpView() { conversationList.addAll(loadConversationList()); conversationListView.init(conversationList);
public void handleMessage(android.os.Message msg) { switch (msg.what) { case 0: onConnectionDisconnected(); break; case 1: onConnectionConnected(); break; case MSG_REFRESH: { conversationList.clear(); conversationList.addAll(loadConversationList()); conversationListView.refresh(); break; } default: break; } } };
protected void hideSoftKeyboard() { if (getActivity().getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getActivity().getCurrentFocus() != null) inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }
sortConversationByLastChatTime(sortList); } catch (Exception e) { e.printStackTrace();
@Override protected void setUpView() { conversationList.addAll(loadConversationList()); conversationListView.init(conversationList);
public void handleMessage(android.os.Message msg) { switch (msg.what) { case 0: onConnectionDisconnected(); break; case 1: onConnectionConnected(); break; case MSG_REFRESH: { conversationList.clear(); conversationList.addAll(loadConversationList()); conversationListView.refresh(); break; } default: break; } } };
@Override public void onCoversationUpdate() { refresh(); }
@Override protected void initView() { inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); conversationListView = (EaseConversationList) getView().findViewById(R.id.list); query = (EditText) getView().findViewById(R.id.query); // button to clear content in search bar clearSearch = (ImageButton) getView().findViewById(R.id.search_clear); errorItemContainer = (FrameLayout) getView().findViewById(R.id.fl_error_item); }
@Override public boolean onTouch(View v, MotionEvent event) { hideSoftKeyboard(); return false; } });
protected void hideSoftKeyboard() { if (getActivity().getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getActivity().getCurrentFocus() != null) inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }
sortConversationByLastChatTime(sortList); } catch (Exception e) { e.printStackTrace();
@Override protected void setUpView() { conversationList.addAll(loadConversationList()); conversationListView.init(conversationList);
public void handleMessage(android.os.Message msg) { switch (msg.what) { case 0: onConnectionDisconnected(); break; case 1: onConnectionConnected(); break; case MSG_REFRESH: { conversationList.clear(); conversationList.addAll(loadConversationList()); conversationListView.refresh(); break; } default: break; } } };
public void run() { // refresh unread count // refresh conversation list if (easeConversationListFragment != null) { easeConversationListFragment.refresh(); } } });