public int compare(DetailArretConteneur detailArretConteneur1, DetailArretConteneur detailArretConteneur2) { int x = detailArretConteneur1.getHoraire(); int y = detailArretConteneur2.getHoraire(); return (x < y) ? -1 : ((x == y) ? 0 : 1); } });
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Notification notification = (Notification) adapterView.getItemAtPosition(i); Intent intent = new Intent(ListNotif.this, DetailArret.class); Ligne ligne = Ligne.getLigne(notification.getLigneId()); Arret arret = Arret.getArret(notification.getArretId()); intent.putExtra("ligne", ligne); intent.putExtra("idArret", notification.getArretId()); intent.putExtra("nomArret", arret.nom); intent.putExtra("direction", notification.getDirection()); intent.putExtra("macroDirection", notification.getMacroDirection()); startActivity(intent); } });
private static Set<Integer> getExceptionsAjout(String date) { remplirException(date); return mapCalendriersExceptionAjout.get(date); }
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 ""; } } }
public void updateLocation(Location location) { if (location == null) { return; } synchronized (arrets) { for (Arret arret : arrets) { arret.calculDistance(location); } Collections.sort(arrets, new Arret.ComparatorDistance()); } metterAJourListeArrets(currentQuery); }
private void recuperationDonneesIntent() { trajet = new Trajet(); trajet.id = getIntent().getExtras().getInt("trajetId"); sequence = getIntent().getExtras().getInt("sequence"); trajet = AbstractTransportsApplication.getDataBaseHelper().selectSingle(trajet); direction = new Direction(); direction.id = trajet.directionId; direction = AbstractTransportsApplication.getDataBaseHelper().selectSingle(direction); ligne = new Ligne(); ligne.id = trajet.ligneId; ligne = AbstractTransportsApplication.getDataBaseHelper().selectSingle(ligne); }
static ArretFavori loadSettings(Context context, int appWidgetId) { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); ArretFavori favori = new ArretFavori(); favori.arretId = sharedPreferences.getString("11ArretId_" + appWidgetId, null); favori.ligneId = sharedPreferences.getString("11LigneId_" + appWidgetId, null); if (favori.arretId == null || favori.ligneId == null) { return null; } return favori; }
public static Ligne getLigne(String ligneId) { Ligne ligne = new Ligne(); ligne.id = ligneId; return AbstractTransportsApplication.getDataBaseHelper().selectSingle(ligne); }
public static Arret getArret(String arretId) { Arret arret = new Arret(); arret.id = arretId; return AbstractTransportsApplication.getDataBaseHelper().selectSingle(arret); } }
/** * Calcul la distance entre une location et la station. * * @param pCurrentLocation la location courante. */ public void calculDistance(Location pCurrentLocation) { if (pCurrentLocation != null) { float[] distanceResult = new float[1]; Location.distanceBetween(pCurrentLocation.getLatitude(), pCurrentLocation.getLongitude(), getLatitude(), getLongitude(), distanceResult); distance = (int) distanceResult[0]; } }
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Notification notification = (Notification) adapterView.getItemAtPosition(i); Intent intent = new Intent(ListNotif.this, DetailArret.class); Ligne ligne = Ligne.getLigne(notification.getLigneId()); Arret arret = Arret.getArret(notification.getArretId()); intent.putExtra("ligne", ligne); intent.putExtra("idArret", notification.getArretId()); intent.putExtra("nomArret", arret.nom); intent.putExtra("direction", notification.getDirection()); startActivity(intent); } });
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 ""; } } }
public int compare(DetailArretConteneur detailArretConteneur1, DetailArretConteneur detailArretConteneur2) { int x = detailArretConteneur1.getHoraire(); int y = detailArretConteneur2.getHoraire(); return (x < y) ? -1 : ((x == y) ? 0 : 1); } });
static ArretFavori loadSettings(Context context, int appWidgetId) { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); ArretFavori favori = new ArretFavori(); favori.arretId = sharedPreferences.getString("21ArretId_" + appWidgetId, null); favori.ligneId = sharedPreferences.getString("21LigneId_" + appWidgetId, null); if (favori.arretId == null || favori.ligneId == null) { return null; } return favori; }
private static Set<Integer> getExceptionsSuppr(String date) { remplirException(date); return mapCalendriersExceptionSuppr.get(date); }
@Override public int compare(DetailArretConteneur lhs, DetailArretConteneur rhs) { return (lhs.getHoraire() < rhs.getHoraire()) ? -1 : ((lhs.getHoraire() == rhs.getHoraire()) ? 0 : 1); } });
private List<ArretFavori> recupererFavoris() { ArretFavori favoriExemple = new ArretFavori(); if (groupe != null) { favoriExemple.groupe = groupe; } return TransportsRennesApplication.getDataBaseHelper().select(favoriExemple, "ordre"); }
@Override public int compare(DetailArretConteneur lhs, DetailArretConteneur rhs) { return (lhs.getHoraire() < rhs.getHoraire()) ? -1 : ((lhs.getHoraire() == rhs.getHoraire()) ? 0 : 1); } });
private List<ArretFavori> recupererFavoris() { ArretFavori favoriExemple = new ArretFavori(); if (groupe != null) { favoriExemple.groupe = groupe; } return AbstractTransportsApplication.getDataBaseHelper().select(favoriExemple, "ordre"); }