Add message when download fails
app/src/main/java/eu/lepiller/nani/DictionaryDownloadActivity.java
17 | 17 | import android.widget.ProgressBar; | |
18 | 18 | import android.widget.TextView; | |
19 | 19 | ||
20 | + | import com.google.android.material.snackbar.Snackbar; | |
21 | + | ||
20 | 22 | import java.io.File; | |
21 | 23 | import java.io.FileOutputStream; | |
22 | 24 | import java.io.IOException; | |
… | |||
283 | 285 | download_bar.setProgress(100); | |
284 | 286 | removeProgress(); | |
285 | 287 | updateLayout(d); | |
288 | + | if(!d.isDownloaded()) { | |
289 | + | Snackbar.make(findViewById(R.id.name_view), getString(R.string.error_dico_checksum_fail), | |
290 | + | Snackbar.LENGTH_LONG).show(); | |
291 | + | d.remove(); | |
292 | + | } | |
286 | 293 | } | |
287 | 294 | } | |
288 | 295 | } |
app/src/main/res/values/strings.xml
61 | 61 | <string name="error_dico_io">Error fetching dictionary list: cannot write to cache file.</string> | |
62 | 62 | <string name="error_dico_not_found">Error fetching dictionary list: cannot find it on server.</string> | |
63 | 63 | <string name="no_dico_list">Dictionary list not yet downloaded, updating???</string> | |
64 | + | <string name="error_dico_checksum_fail">Hash mismatch when verifying checksum: file is corrupted; deleting.</string> | |
64 | 65 | ||
65 | 66 | <!-- Result view --> | |
66 | 67 | <string name="sense_number">%d.</string> |