@Override
  public void bindView(View view, Context context, Cursor cursor) {
    if (view instanceof MessageListItem) {
      String type = cursor.getString(mColumnsMap.mColumnMsgType);
      long msgId = cursor.getLong(mColumnsMap.mColumnMsgId);

      MessageItem msgItem = getCachedMessageItem(type, msgId, cursor);
      if (msgItem != null) {
        MessageListItem mli = (MessageListItem) view;
        int position = cursor.getPosition();
        mli.bind(msgItem, mIsGroupConversation, position);
        mli.setMsgListItemHandler(mMsgListItemHandler);
      }
    }
  }
Exemplo n.º 2
0
 public void onItemLoaded(ImageLoaded imageLoaded, Throwable exception) {
   if (DEBUG_DONT_LOAD_IMAGES) {
     return;
   }
   // Make sure we're still pointing to the same message. The list item could have
   // been recycled.
   MessageItem msgItem = mListItem.mMessageItem;
   if (msgItem != null && msgItem.getMessageId() == mMessageId) {
     if (imageLoaded.mIsVideo) {
       mListItem.setVideoThumbnail(null, imageLoaded.mBitmap);
     } else {
       mListItem.setImage(null, imageLoaded.mBitmap);
     }
   }
 }
  @Override
  public boolean onKeyShortcut(int keyCode, KeyEvent event) {
    switch (keyCode) {
      case KeyEvent.KEYCODE_C:
        MessageListItem view = (MessageListItem) getSelectedView();
        if (view == null) {
          break;
        }
        MessageItem item = view.getMessageItem();
        if (item != null && item.isSms()) {
          ClipboardManager clip =
              (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
          clip.setText(item.mBody);
          return true;
        }
        break;
    }

    return super.onKeyShortcut(keyCode, event);
  }
Exemplo n.º 4
0
 public void reset(MessageListItem listItem) {
   mMessageId = listItem.getMessageItem().getMessageId();
 }
Exemplo n.º 5
0
 public ImageLoadedCallback(MessageListItem listItem) {
   mListItem = listItem;
   mMessageId = listItem.getMessageItem().getMessageId();
 }