Esempio n. 1
0
  @Override
  protected void onStart() {
    super.onStart();

    mChatAdapter.notifyDataSetChanged();
    mKaaChatManager.addChatListener(this);
  }
Esempio n. 2
0
 @Override
 public void onBindViewHolder(ChatViewHolder holder, int position) {
   final String chatName = mKaaChatManager.getChats().get(position);
   ((TextView) holder.itemView).setText(chatName);
   holder.itemView.setOnLongClickListener(
       new View.OnLongClickListener() {
         @Override
         public boolean onLongClick(View v) {
           mKaaChatManager.deleteChatRoom(chatName);
           notifyDataSetChanged();
           return true;
         }
       });
 }
Esempio n. 3
0
 @Override
 public int getItemCount() {
   return mKaaChatManager.getChats().size();
 }
Esempio n. 4
0
 @Override
 protected void onStop() {
   super.onStop();
   mKaaChatManager.removeChatListener(this);
 }