修改Crime Holder的void bind函数,可以按“月份 日期,年份“的格式显示
public void bind(Crime crime){
mCrime = crime;
mTitleTextView.setText(mCrime.getTitle());
DateFormat dateFormat = getLongDateFormat(getActivity());
mDateTextView.setText(dateFormat.format(mCrime.getDate()));
mSolvedImageView.setVisibility(crime.isSolved() ? View.VISIBLE : View.GONE);
}
第二个任务还是只需修改bind函数
public void bind(Crime crime){
mCrime = crime;
mTitleTextView.setText(mCrime.getTitle());
mDateTextView.setText((String)DateFormat.format("EEEE, MMMM dd, yyyy", mCrime.getDate()));
mSolvedImageView.setVisibility(crime.isSolved() ? View.VISIBLE : View.GONE);
}