Skip to content

Commit a4bf534

Browse files
committed
1.7.1
1 parent 1778c9a commit a4bf534

File tree

9 files changed

+261
-13
lines changed

9 files changed

+261
-13
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/app-release.apk

-23.1 KB
Binary file not shown.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "com.aerophile.app"
99
minSdkVersion 17
1010
targetSdkVersion 25
11-
versionCode 32
12-
versionName "1.7"
11+
versionCode 33
12+
versionName "1.7.1"
1313
}
1414
buildTypes {
1515
release {

app/src/main/java/com/aerophile/app/LauncherActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ void requete() {
189189
void resultat(int code) {
190190
if(code == 0) {
191191
message(getString(R.string.envoie_mail_envoye));
192-
journeeAttente.setAttente(0);
193-
daoJournee.modifierJournee(journeeAttente);
194-
daoJournee.close();
195192
} else {
196193
message(getString(R.string.envoie_erreur_attente_reessayez));
197194
}
195+
journeeAttente.setAttente(0);
196+
daoJournee.modifierJournee(journeeAttente);
197+
daoJournee.close();
198198
}
199199

200200
@UiThread

app/src/main/java/com/aerophile/app/VolListActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
178178
if(journeeCourante.getPasdeVol() != ancienVol) {
179179
togglePasDeVol();
180180
}
181-
setTitle("Aérophile - " + journeeCourante.getDate());
181+
setTitle(Dates.dateToReadable(journeeCourante.getDate()));
182182
}
183183
}
184184
if (requestCode == CALLBACK_APP) {

app/src/main/java/com/aerophile/app/VolListFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void onCreate(Bundle savedInstanceState) {
5353

5454
journeeCourante = daoJournee.getJourneeEnCours();
5555

56-
if(!daoVol.existeVolEnCours()) {
56+
if(!daoVol.existeVolEnCours(journeeCourante.getId())) {
5757

5858
// Nouveau vol en haut
5959
Vol nouveauVol = new Vol();
@@ -101,7 +101,7 @@ public long onRafraichirListe(long idVolSelected) {
101101
long idVol = 0;
102102
if(!vols.isEmpty()) {
103103
int i = 0;
104-
if(!daoVol.existeVolEnCours()) {
104+
if(!daoVol.existeVolEnCours(journeeCourante.getId())) {
105105
// Nouveau vol en haut
106106
Vol nouveauVol = new Vol();
107107
nouveauVol.setId(0);

app/src/main/java/com/aerophile/app/dao/VolDAO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ public Vol getVol(long id){
128128
return vol;
129129
}
130130

131-
public boolean existeVolEnCours(){
132-
Cursor cursor = database.query(DatabaseHandler.VOL_TABLE_NAME, new String[]{DatabaseHandler.VOL_KEY}, DatabaseHandler.VOL_ENCOURS + " = 1", null, null, null, null);
131+
public boolean existeVolEnCours(long id){
132+
Cursor cursor = database.query(DatabaseHandler.VOL_TABLE_NAME, new String[]{DatabaseHandler.VOL_KEY}, DatabaseHandler.VOL_ENCOURS + " = 1 AND " + DatabaseHandler.VOL_JOURNEE + " = " + id, null, null, null, null);
133133
cursor.moveToFirst();
134134
boolean response = !cursor.isAfterLast();
135135
cursor.close();

app/src/main/java/com/aerophile/app/utils/Dates.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public static Date stringToDate(String date) {
2929
} catch (ParseException e) {
3030
Log.d("AEROBUG", "Date non parsable");
3131
}
32+
format = new SimpleDateFormat("dd MMMM yyyy", Locale.getDefault());
33+
try {
34+
return format.parse(date);
35+
} catch (ParseException e) {
36+
Log.d("AEROBUG", "Date non parsable");
37+
}
3238
return new Date(Long.valueOf(date));
3339
}
3440

build/intermediates/dex-cache/cache.xml

Lines changed: 244 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)