Java 类android.provider.Telephony.TextBasedSmsColumns 实例源码

项目:qksms    文件:MessageListAdapter.java   
@Override
public int getItemViewType(int position) {
    // This method shouldn't be called if our cursor is null, since the framework should know
    // that there aren't any items to look at in that case
    MessageItem item = getItem(position);
    int boxId = item.getBoxId();

    if (item.isSms()) {
        if (boxId == TextBasedSmsColumns.MESSAGE_TYPE_INBOX || boxId == TextBasedSmsColumns.MESSAGE_TYPE_ALL) {
            return INCOMING_ITEM;
        } else {
            return OUTGOING_ITEM;
        }
    } else {
        if (boxId == Telephony.Mms.MESSAGE_BOX_ALL || boxId == Telephony.Mms.MESSAGE_BOX_INBOX) {
            return INCOMING_ITEM;
        } else {
            return OUTGOING_ITEM;
        }
    }
}
项目:sms_DualCard    文件:MessageListAdapter.java   
private int getItemViewType(Cursor cursor) {
    String type = cursor.getString(mColumnsMap.mColumnMsgType);
    int boxId;
    if ("sms".equals(type)) {
        boxId = cursor.getInt(mColumnsMap.mColumnSmsType);
        // Note that messages from the SIM card all have a boxId of zero.
        return (boxId == TextBasedSmsColumns.MESSAGE_TYPE_INBOX ||
                boxId == TextBasedSmsColumns.MESSAGE_TYPE_ALL) ?
                INCOMING_ITEM_TYPE_SMS : OUTGOING_ITEM_TYPE_SMS;
    } else {
        boxId = cursor.getInt(mColumnsMap.mColumnMmsMessageBox);
        // Note that messages from the SIM card all have a boxId of zero: Mms.MESSAGE_BOX_ALL
        return (boxId == Mms.MESSAGE_BOX_INBOX || boxId == Mms.MESSAGE_BOX_ALL) ?
                INCOMING_ITEM_TYPE_MMS : OUTGOING_ITEM_TYPE_MMS;
    }
}
项目:sms_DualCard    文件:SimMessageListAdapter.java   
private int getItemViewType(Cursor cursor) {
    String type = cursor.getString(mColumnsMap.mColumnMsgType);
    int boxId;
    if ("sms".equals(type)) {
        boxId = cursor.getInt(mColumnsMap.mColumnSmsType);
        // Note that messages from the SIM card all have a boxId of zero.
        return (boxId == TextBasedSmsColumns.MESSAGE_TYPE_INBOX || boxId == TextBasedSmsColumns.MESSAGE_TYPE_ALL) ? INCOMING_ITEM_TYPE_SMS
                : OUTGOING_ITEM_TYPE_SMS;
    } else {
        boxId = cursor.getInt(mColumnsMap.mColumnMmsMessageBox);
        // Note that messages from the SIM card all have a boxId of zero:
        // Mms.MESSAGE_BOX_ALL
        return (boxId == Mms.MESSAGE_BOX_INBOX || boxId == Mms.MESSAGE_BOX_ALL) ? INCOMING_ITEM_TYPE_MMS
                : OUTGOING_ITEM_TYPE_MMS;
    }
}
项目:android-aosp-mms    文件:MessageListAdapter.java   
private int getItemViewType(Cursor cursor) {
    String type = cursor.getString(mColumnsMap.mColumnMsgType);
    int boxId;
    if ("sms".equals(type)) {
        boxId = cursor.getInt(mColumnsMap.mColumnSmsType);
        // Note that messages from the SIM card all have a boxId of zero.
        return (boxId == TextBasedSmsColumns.MESSAGE_TYPE_INBOX ||
                boxId == TextBasedSmsColumns.MESSAGE_TYPE_ALL) ?
                INCOMING_ITEM_TYPE_SMS : OUTGOING_ITEM_TYPE_SMS;
    } else {
        boxId = cursor.getInt(mColumnsMap.mColumnMmsMessageBox);
        // Note that messages from the SIM card all have a boxId of zero: Mms.MESSAGE_BOX_ALL
        return (boxId == Mms.MESSAGE_BOX_INBOX || boxId == Mms.MESSAGE_BOX_ALL) ?
                INCOMING_ITEM_TYPE_MMS : OUTGOING_ITEM_TYPE_MMS;
    }
}