date visible after being invisible

This commit is contained in:
ligi 2014-11-15 16:10:12 +01:00
parent 6c530ded6a
commit 6387e7520c

View file

@ -96,6 +96,7 @@ public class PassViewHolder extends RecyclerView.ViewHolder {
activity.startActivity(intent); activity.startActivity(intent);
} }
}); });
addCalendar.setVisibility(View.VISIBLE);
} else { } else {
addCalendar.setVisibility(View.GONE); addCalendar.setVisibility(View.GONE);
} }
@ -124,7 +125,9 @@ public class PassViewHolder extends RecyclerView.ViewHolder {
if (pass.getRelevantDate().isPresent()) { if (pass.getRelevantDate().isPresent()) {
final CharSequence relativeDateTimeString = DateUtils.getRelativeDateTimeString(root.getContext(), pass.getRelevantDate().get().getMillis(), DateUtils.MINUTE_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0); final CharSequence relativeDateTimeString = DateUtils.getRelativeDateTimeString(root.getContext(), pass.getRelevantDate().get().getMillis(), DateUtils.MINUTE_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0);
date.setText(relativeDateTimeString); date.setText(relativeDateTimeString);
date.setVisibility(View.VISIBLE);
} else if (pass.getExpirationDate().isPresent()) { } else if (pass.getExpirationDate().isPresent()) {
date.setVisibility(View.VISIBLE);
final CharSequence relativeDateTimeString = DateUtils.getRelativeDateTimeString(root.getContext(), pass.getExpirationDate().get().getMillis(), DateUtils.MINUTE_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0); final CharSequence relativeDateTimeString = DateUtils.getRelativeDateTimeString(root.getContext(), pass.getExpirationDate().get().getMillis(), DateUtils.MINUTE_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0);
if (pass.getExpirationDate().get().isAfterNow()) { if (pass.getExpirationDate().get().isAfterNow()) {