Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd40f71

Browse files
committed
Allow sending newly exported data
With this change once data is exported it can be sent to another application. Translation contributions: Clonewayx: cs PanderMusubi: nl pbeckmann: de
1 parent e650842 commit cd40f71

5 files changed

Lines changed: 75 additions & 2 deletions

File tree

app/src/main/java/protect/card_locker/ImportExportActivity.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public void onClick(DialogInterface dialog, int which)
250250
builder.create().show();
251251
}
252252

253-
private void onExportComplete(boolean success, File path)
253+
private void onExportComplete(boolean success, final File path)
254254
{
255255
AlertDialog.Builder builder = new AlertDialog.Builder(this);
256256

@@ -277,6 +277,28 @@ public void onClick(DialogInterface dialog, int which)
277277
}
278278
});
279279

280+
if(success)
281+
{
282+
final CharSequence sendLabel = ImportExportActivity.this.getResources().getText(R.string.sendLabel);
283+
284+
builder.setPositiveButton(sendLabel, new DialogInterface.OnClickListener()
285+
{
286+
@Override
287+
public void onClick(DialogInterface dialog, int which)
288+
{
289+
Uri outputUri = Uri.fromFile(path);
290+
Intent sendIntent = new Intent(Intent.ACTION_SEND);
291+
sendIntent.putExtra(Intent.EXTRA_STREAM, outputUri);
292+
sendIntent.setType("text/plain");
293+
294+
ImportExportActivity.this.startActivity(Intent.createChooser(sendIntent,
295+
sendLabel));
296+
297+
dialog.dismiss();
298+
}
299+
});
300+
}
301+
280302
builder.create().show();
281303
}
282304

app/src/main/res/values-cs/strings.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,20 @@
5959
<string name="enterBarcodeInstructions">Zadejte hodnotu čárového kódu a potm vyberte kód, který představuje čárový kód, který je na kartě.</string>
6060

6161
<string name="copy_to_clipboard_toast">ID karty zkopírováno do schránky</string>
62-
62+
<string name="importExportHelp">Zálohování dat vám umožní přesunout vaše uložené karty na jiné zařízení.</string>
63+
<string name="importSuccessfulTitle">Import proběhl úspěšně</string>
64+
<string name="importFailedTitle">Import selhal</string>
65+
<string name="exportSuccessfulTitle">Export proběhl úspěšně</string>
66+
<string name="exportFailedTitle">Export selhal</string>
67+
<string name="exportOptionExplanation">Data jsou zapsána do kořenové složky externího uložiště.</string>
68+
<string name="importOptionFilesystemTitle">Import ze souborového systému</string>
69+
<string name="importOptionFilesystemExplanation">Vyberte konkrétní soubor v uložišti.</string>
70+
<string name="importOptionFilesystemButton">Ze souborového systému</string>
71+
<string name="importOptionApplicationTitle">Import ze souborového systému</string>
72+
<string name="importOptionApplicationExplanation">K otevření souboru použije externí aplikaci jako Dropbox, Google Drive, nebo vámi preferovaný prohlížeč souborů.</string>
73+
<string name="importOptionApplicationButton">Použít externí aplikaci</string>
74+
<string name="importOptionFixedTitle">Import z umístění exportu</string>
75+
<string name="importOptionFixedExplanation">Import ze stejné složky souborového systému do níž se zapisuje při exportu.</string>
76+
<string name="importOptionFixedButton">Použít složku exportu</string>
77+
<string name="sendLabel">Odeslat&#8230;</string>
6378
</resources>

app/src/main/res/values-de/strings.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,22 @@
4747
<string name="app_revision_fmt">Versions Information: <xliff:g id="app_revision_url">%s</xliff:g></string>
4848
<string name="importing">Importiere…</string>
4949
<string name="exporting">Exportiere…</string>
50+
51+
<string name="importExportHelp">Gesicherte Daten ermöglichen das Verschieben der Kundenkarten auf ein anderes Gerät.</string>
52+
<string name="importSuccessfulTitle">Import erfolgreich</string>
53+
<string name="importFailedTitle">Import fehlgeschlagen</string>
54+
<string name="exportSuccessfulTitle">Export erfolgreich</string>
55+
<string name="exportFailedTitle">Export fehlgeschlagen</string>
56+
<string name="exportOptionExplanation">Die Datei wird ins Wurzelverzeichnis des externen Speichers geschrieben.</string>
57+
<string name="importOptionFilesystemTitle">Importiere vom Dateisystem</string>
58+
<string name="importOptionFilesystemExplanation">Wähle eine Datei im Speicher aus.</string>
59+
<string name="importOptionFilesystemButton">Vom Dateisystem</string>
60+
<string name="importOptionApplicationTitle">Importiere vom Dateisystem</string>
61+
<string name="importOptionApplicationExplanation">Wähle eine Datei aus einer App wie Dropbox, Google Drive, oder deinem bevorzugten Dateisystem aus.</string>
62+
<string name="importOptionApplicationButton">Nutze eine externe App</string>
63+
<string name="importOptionFixedTitle">Importiere vom Export Ort</string>
64+
<string name="importOptionFixedExplanation">Importiere von derselben Stelle, wo die exportiere Datei liegen würde.</string>
65+
<string name="importOptionFixedButton">Verwende die exportierte Stelle</string>
66+
<string name="sendLabel">Senden&#8230;</string>
67+
5068
</resources>

app/src/main/res/values-nl/strings.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,21 @@
5656
<string name="confirm">Bevestig</string>
5757
<string name="deleteConfirmation">Bevestig deze kaart te verwijderen.</string>
5858
<string name="deleteTitle">Verwijder kaart</string>
59+
60+
<string name="importExportHelp">Data die is geback-upt maakt het mogelijk om je klantenkaarten naar een ander apparaat te verplaatsen.</string>
61+
<string name="importSuccessfulTitle">Importeren succesvol</string>
62+
<string name="importFailedTitle">Importeren mislukte</string>
63+
<string name="exportSuccessfulTitle">Exporteren succesvol</string>
64+
<string name="exportFailedTitle">Exporteren mislukt</string>
65+
<string name="exportOptionExplanation">Data is weggeschreven naar de hoogste map in externe opslag.</string>
66+
<string name="importOptionFilesystemTitle">Importeer van filesysteem</string>
67+
<string name="importOptionFilesystemExplanation">Kies een specifiek bestand van het filesysteem.</string>
68+
<string name="importOptionFilesystemButton">Van filesysteem</string>
69+
<string name="importOptionApplicationTitle">Importeer van filesysteem</string>
70+
<string name="importOptionApplicationExplanation">Gebruik een externe applicatie zoals Dropbox, Google Drive of je favoriete bestandsbeheer om een bestand te openen.</string>
71+
<string name="importOptionApplicationButton">Gebruik externe applicatie</string>
72+
<string name="importOptionFixedTitle">Importeer van exporteerlocatie</string>
73+
<string name="importOptionFixedExplanation">Importeer van zelfde locatie op het filesysteem waar tijdens exporteren naar geschreven is.</string>
74+
<string name="importOptionFixedButton">gebruik exporteerlocaite</string>
75+
<string name="sendLabel">Verzend&#8230;</string>
5976
</resources>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<string name="deleteConfirmation">Please confirm that you want to delete this card.</string>
2323
<string name="ok">OK</string>
2424
<string name="copy_to_clipboard">Copy ID to clipboard</string>
25+
<string name="sendLabel">Send&#8230;</string>
2526

2627
<string name="editCardTitle">Edit Loyalty Card</string>
2728
<string name="addCardTitle">Add Loyalty Card</string>

0 commit comments

Comments
 (0)