本文整理汇总了Java中org.joda.time.DateTime.isAfterNow方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.isAfterNow方法的具体用法?Java DateTime.isAfterNow怎么用?Java DateTime.isAfterNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.joda.time.DateTime
的用法示例。
在下文中一共展示了DateTime.isAfterNow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showNotification
import org.joda.time.DateTime; //导入方法依赖的package包/类
private void showNotification(Game game) {
DateTime dateTime = new DateTime(game.getGameDateTime(), Constants.DATE.VEGAS_TIME_ZONE).plusSeconds(60);
if (dateTime.isAfterNow()) {
String ringtonePath = MultiProcessPreference.getDefaultSharedPreferences().getString(mContext.getString(R.string.key_notification_ringtone), null);
Uri soundUri;
if (ringtonePath == null) {
soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
} else {
soundUri = Uri.parse(ringtonePath);
}
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(mContext)
.setSmallIcon(R.drawable.ic_league_white_24px)
.setContentTitle("Game Started - " + game.getLeagueType().getAcronym())
.setContentText(mContext.getString(R.string.team_vs_team_full, game.getFirstTeam().getCity(), game.getSecondTeam().getCity()))
.setSound(soundUri);
// Sets an ID for the notification
int mNotificationId = createHash(game.getFirstTeam().getCity() + game.getSecondTeam().getCity());
// Gets an instance of the NotificationManager service
NotificationManager mNotifyMgr =
(NotificationManager) mContext.getSystemService(NOTIFICATION_SERVICE);
// Builds the notification and issues it.
mNotifyMgr.notify(mNotificationId, mBuilder.build());
}
}
示例2: reloadFrom
import org.joda.time.DateTime; //导入方法依赖的package包/类
public void reloadFrom(final List<Trip> data) {
current.clear();
past.clear();
future.clear();
for (Trip t : data) {
DateTime begDate = DateTime.parse(t.startDate);
DateTime endDate = DateTime.parse(t.endDate);
if (begDate.isAfterNow()) {
future.add(t);
} else if (endDate.isBeforeNow()) {
past.add(t);
} else {
current.add(t);
}
}
notifyDataSetChanged();
}
示例3: reloadFrom
import org.joda.time.DateTime; //导入方法依赖的package包/类
public void reloadFrom(final List<Trip> data) {
current.clear();
past.clear();
future.clear();
for (Trip t : data) {
DateTime begDate = DateTime.parse(t.getStartDate());
DateTime endDate = DateTime.parse(t.getEndDate());
if (begDate.isAfterNow()) {
future.add(t);
} else if (endDate.isBeforeNow()) {
past.add(t);
} else {
current.add(t);
}
}
notifyDataSetChanged();
}