Skip to content

Commit

Permalink
Added Error when Invalid ICAO in Search
Browse files Browse the repository at this point in the history
  • Loading branch information
amacz13 committed Dec 10, 2019
1 parent 93db02a commit b433edc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/fr/unicornclass/snowtamtam/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void onClick(View view) {
card.setVisibility(View.VISIBLE);
} catch (Exception e) {
card.setVisibility(View.GONE);
searchBar.setError(getString(R.string.invalidICAO));
}
} else {
card.setVisibility(View.GONE);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/fr/unicornclass/snowtamtam/ShowAirport.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public void onSuccess(String result) {
final Spinner sp = root.findViewById(R.id.runwaySelector);
fab.setEnabled(false);
sp.setEnabled(false);
Toast.makeText(root.getContext(), getString(R.string.noSnowtam), Toast.LENGTH_SHORT).show();
}
swp.setRefreshing(false);
}
Expand Down Expand Up @@ -165,6 +166,7 @@ public void onSuccess(String result) {
final Spinner sp = root.findViewById(R.id.runwaySelector);
fab.setEnabled(false);
sp.setEnabled(false);
Toast.makeText(root.getContext(), getString(R.string.noSnowtam), Toast.LENGTH_SHORT).show();
}
swp.setRefreshing(false);
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@
<string name="darkTheme">Thème Sombre</string>
<string name="title_activity_settings">Paramètres</string>
<string name="noGroup">Aucun groupe n\'existe pour l\'instant</string>
<string name="noSnowtam">Aucun Snowtam disponible pour cet aéroport</string>
<string name="invalidICAO">OACI Erroné</string>
</resources>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<string name="placeholder">Placeholder</string>
<string name="title_activity_show_airport_group">Show Airport Group</string>
<string name="title_activity_search">Search</string>
<string name="searchByOACI">Search by OACI Code</string>
<string name="searchByOACI">Search by ICAO Code</string>
<string name="title_activity_raw_snowtam">Raw Snowtam</string>
<string name="month_January">January</string>
<string name="month_February">February</string>
Expand Down Expand Up @@ -45,4 +45,6 @@
<string name="style">Appearance</string>
<string name="darkTheme">Dark Theme</string>
<string name="noGroup">There is no group for the moment</string>
<string name="noSnowtam">No Snowtam available for this airport</string>
<string name="invalidICAO">Invalid ICAO</string>
</resources>

0 comments on commit b433edc

Please sign in to comment.