當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。