当前位置: 首页>>代码示例>>Java>>正文


Java DateTime.isAfterNow方法代码示例

本文整理汇总了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());
    }
}
 
开发者ID:riteshakya037,项目名称:Android-Scrapper,代码行数:26,代码来源:GameUpdateReceiver.java

示例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();
}
 
开发者ID:gvsucis,项目名称:mobile-app-dev-book,代码行数:18,代码来源:JournalAdapter.java

示例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();
}
 
开发者ID:gvsucis,项目名称:mobile-app-dev-book,代码行数:18,代码来源:JournalAdapter.java


注:本文中的org.joda.time.DateTime.isAfterNow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。