private CharSequence getTempsRestant(Arret arret) { try { List<DetailArretConteneur> prochainsDeparts = Horaire.getProchainHorairesAsList(arret.favori.ligneId, arret.favori.arretId, 1, calendar, arret.favori.macroDirection); return prochainsDeparts.isEmpty() ? "" : Formatteur.formatterCalendar(myContext, prochainsDeparts.get(0).getHoraire(), now); } catch (SQLiteException ignore) { return ""; } } }
private CharSequence getTempsRestant(Arret arret) { try { List<DetailArretConteneur> prochainsDeparts = Horaire.getProchainHorairesAsList(arret.favori.ligneId, arret.favori.arretId, 1, calendar, arret.favori.macroDirection); return prochainsDeparts.isEmpty() ? "" : Formatteur.formatterCalendar(myContext, prochainsDeparts.get(0).getHoraire(), now); } catch (SQLiteException ignore) { return ""; } } }
int now = calendar.get(Calendar.HOUR_OF_DAY) * 60 + calendar.get(Calendar.MINUTE); try { List<DetailArretConteneur> prochainsDeparts1 = Horaire.getProchainHorairesAsList(favoris.get(0).ligneId, favoris.get(0).arretId, 1, calendar, favoris.get(0).macroDirection); remoteViews.setTextViewText( List<DetailArretConteneur> prochainsDeparts2 = Horaire.getProchainHorairesAsList(favoris.get(1).ligneId, favoris.get(1).arretId, 1, calendar, favoris.get(1).macroDirection); remoteViews.setTextViewText( List<DetailArretConteneur> prochainsDeparts3 = Horaire.getProchainHorairesAsList(favoris.get(2).ligneId, favoris.get(2).arretId, 1, calendar, favoris.get(2).macroDirection); remoteViews.setTextViewText(
private static void remplirRemoteViews2Arret(Context context, RemoteViews remoteViews, List<ArretFavori> favoris, Calendar calendar) { int now = calendar.get(Calendar.HOUR_OF_DAY) * 60 + calendar.get(Calendar.MINUTE); try { List<DetailArretConteneur> prochainsDeparts1 = Horaire.getProchainHorairesAsList(favoris.get(0).ligneId, favoris.get(0).arretId, 2, calendar, favoris.get(0).macroDirection); remoteViews.setTextViewText( R.id.tempsRestant11_2arret, prochainsDeparts1.size() < 1 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts1.get(0).getHoraire(), now)); remoteViews.setTextViewText( R.id.tempsRestant12_2arret, prochainsDeparts1.size() < 2 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts1.get(1).getHoraire(), now)); } catch (SQLiteException ignore) { } try { List<DetailArretConteneur> prochainsDeparts2 = Horaire.getProchainHorairesAsList(favoris.get(1).ligneId, favoris.get(1).arretId, 2, calendar, favoris.get(1).macroDirection); remoteViews.setTextViewText( R.id.tempsRestant21_2arret, prochainsDeparts2.size() < 1 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts2.get(0).getHoraire(), now)); remoteViews.setTextViewText( R.id.tempsRestant22_2arret, prochainsDeparts2.size() < 2 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts2.get(1).getHoraire(), now)); } catch (SQLiteException ignore) { } }
private static void remplirRemoteViews1Arret(Context context, RemoteViews remoteViews, List<ArretFavori> favoris, Calendar calendar) { int now = calendar.get(Calendar.HOUR_OF_DAY) * 60 + calendar.get(Calendar.MINUTE); try { List<DetailArretConteneur> prochainsDeparts = Horaire.getProchainHorairesAsList(favoris.get(0).ligneId, favoris.get(0).arretId, 4, calendar, favoris.get(0).macroDirection); remoteViews.setTextViewText( R.id.tempsRestant1_1arret, prochainsDeparts.size() < 1 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts.get(0).getHoraire(), now)); remoteViews.setTextViewText( R.id.tempsRestant2_1arret, prochainsDeparts.size() < 2 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts.get(1).getHoraire(), now)); remoteViews.setTextViewText( R.id.tempsRestant3_1arret, prochainsDeparts.size() < 3 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts.get(2).getHoraire(), now)); remoteViews.setTextViewText( R.id.tempsRestant4_1arret, prochainsDeparts.size() < 4 ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts.get(3).getHoraire(), now)); } catch (SQLiteException ignore) { } }
List<DetailArretConteneur> prochainsDepart = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 1, calendar, favori.macroDirection);
List<DetailArretConteneur> prochainsDepart = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 1, calendar, null);
calendar.add(Calendar.MINUTE, -3); try { List<DetailArretConteneur> prochainsDeparts = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 2, calendar, favori.macroDirection); LOG_YBO.debug("Prochains departs : " + prochainsDeparts);
do { calendar.add(Calendar.MINUTE, 1); prochainsDeparts = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 2, calendar, null); } while (prochainsDeparts.size() >= 2 && prochainsDeparts.get(1).getHoraire() < now); LOG_YBO.debug("Prochains departs : " + prochainsDeparts);
calendar.add(Calendar.MINUTE, -3); try { List<DetailArretConteneur> prochainsDeparts = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 2, calendar, favori.macroDirection); LOG_YBO.debug("Prochains departs : " + prochainsDeparts);
calendar.add(Calendar.MINUTE, -3); try { List<DetailArretConteneur> prochainsDeparts = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 3, calendar, favori.macroDirection); LOG_YBO.debug("Prochains departs : " + prochainsDeparts);
do { calendar.add(Calendar.MINUTE, 1); prochainsDeparts = Horaire.getProchainHorairesAsList(favori.ligneId, favori.arretId, 3, calendar, null); } while (prochainsDeparts.size() >= 2 && prochainsDeparts.get(1).getHoraire() < now); LOG_YBO.debug("Prochains departs : " + prochainsDeparts);