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 ""; } } }
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) { } }
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) { } }
R.id.tempsRestant1_3arret, prochainsDeparts1.isEmpty() ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts1.get(0).getHoraire(), now)); } catch (SQLiteException ignore) { R.id.tempsRestant2_3arret, prochainsDeparts2.isEmpty() ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts2.get(0).getHoraire(), now)); } catch (SQLiteException ignore) { R.id.tempsRestant3_3arret, prochainsDeparts3.isEmpty() ? "" : context.getString(R.string.dans) + ' ' + Formatteur.formatterCalendar(context, prochainsDeparts3.get(0).getHoraire(), now)); } catch (SQLiteException ignore) {