本文整理匯總了Java中android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE屬性的典型用法代碼示例。如果您正苦於以下問題:Java DateUtils.FORMAT_ABBREV_RELATIVE屬性的具體用法?Java DateUtils.FORMAT_ABBREV_RELATIVE怎麽用?Java DateUtils.FORMAT_ABBREV_RELATIVE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.text.format.DateUtils
的用法示例。
在下文中一共展示了DateUtils.FORMAT_ABBREV_RELATIVE屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindView
@Override
public void bindView(View view, Context context, Cursor cursor) {
super.bindView(view, context, cursor);
final ConversationListItemViews tagView = (ConversationListItemViews) view.getTag();
String nbr = cursor.getString(cursor.getColumnIndex(SipMessage.FIELD_FROM));
String fromFull = cursor.getString(cursor.getColumnIndex(SipMessage.FIELD_FROM_FULL));
String to_number = cursor.getString(cursor.getColumnIndex(SipMessage.FIELD_TO));
//int read = cursor.getInt(cursor.getColumnIndex(SipMessage.FIELD_READ));
long date = cursor.getLong(cursor.getColumnIndex(SipMessage.FIELD_DATE));
tagView.fromFull = fromFull;
tagView.to = to_number;
tagView.from = nbr;
tagView.position = cursor.getPosition();
/*
Drawable background = (read == 0)?
context.getResources().getDrawable(R.drawable.conversation_item_background_unread) :
context.getResources().getDrawable(R.drawable.conversation_item_background_read);
view.setBackgroundDrawable(background);
*/
String number = cursor.getString(cursor.getColumnIndex(SipMessage.FIELD_FROM_FULL));
CallerInfo info = CallerInfo.getCallerInfoFromSipUri(mContext, number);
/*
final Uri lookupUri = info.contactContentUri;
final String name = info.name;
final int ntype = info.numberType;
final String label = info.phoneLabel;
CharSequence formattedNumber = SipUri.getCanonicalSipContact(number, false);
*/
// Photo
tagView.quickContactView.assignContactUri(info.contactContentUri);
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(mContext,
tagView.quickContactView.getImageView(),
info,
R.drawable.ic_contact_picture_holo_dark);
// From
tagView.fromView.setText(formatMessage(cursor));
//Date
// Set the date/time field by mixing relative and absolute times.
int flags = DateUtils.FORMAT_ABBREV_RELATIVE;
tagView.dateView.setText(DateUtils.getRelativeTimeSpanString(date, System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS, flags));
}