show a success toast after successufull copy

This commit is contained in:
tibbi 2016-11-11 18:39:29 +01:00
parent 36d31ba0ce
commit 08338f3d7a
8 changed files with 16 additions and 9 deletions

View File

@ -7,8 +7,8 @@ import android.net.Uri
import android.os.Build import android.os.Build
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.support.v4.provider.DocumentFile import android.support.v4.provider.DocumentFile
import android.widget.Toast
import com.simplemobiletools.filepicker.extensions.getSDCardPath import com.simplemobiletools.filepicker.extensions.getSDCardPath
import com.simplemobiletools.filepicker.extensions.toast
import java.util.regex.Pattern import java.util.regex.Pattern
class Utils { class Utils {
@ -22,7 +22,7 @@ class Utils {
} }
fun showToast(context: Context, resId: Int) { fun showToast(context: Context, resId: Int) {
Toast.makeText(context, context.resources.getString(resId), Toast.LENGTH_SHORT).show() context.toast(resId)
} }
fun hasStoragePermission(cxt: Context): Boolean { fun hasStoragePermission(cxt: Context): Boolean {

View File

@ -495,11 +495,12 @@ public class ItemsFragment extends android.support.v4.app.Fragment
public void copySucceeded(File file) { public void copySucceeded(File file) {
rescanItem(file); rescanItem(file);
fillItems(); fillItems();
Utils.Companion.showToast(getContext(), R.string.copying_success);
} }
@Override @Override
public void copyFailed() { public void copyFailed() {
Utils.Companion.showToast(getContext(), R.string.copy_failed); Utils.Companion.showToast(getContext(), R.string.copying_failed);
} }
public interface ItemInteractionListener { public interface ItemInteractionListener {

View File

@ -30,8 +30,9 @@
<string name="invalid_destination">Konnte nicht an ausgewähltes Ziel schreiben</string> <string name="invalid_destination">Konnte nicht an ausgewähltes Ziel schreiben</string>
<string name="please_select_destination">Bitte wähle ein Ziel</string> <string name="please_select_destination">Bitte wähle ein Ziel</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string> <string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Konnte die Datei nicht kopieren</string>
<string name="copying">Kopiere</string> <string name="copying">Kopiere</string>
<string name="copying_success">Files copied successfully</string>
<string name="copying_failed">Konnte die Datei nicht kopieren</string>
<string name="copying_no_delete">Copying, please delete source files manually</string> <string name="copying_no_delete">Copying, please delete source files manually</string>
<string name="already_exists">A file with that name already exists</string> <string name="already_exists">A file with that name already exists</string>
<string name="ok">OK</string> <string name="ok">OK</string>

View File

@ -30,8 +30,9 @@
<string name="invalid_destination">Impossibile scrivere nella destinazione selezionata</string> <string name="invalid_destination">Impossibile scrivere nella destinazione selezionata</string>
<string name="please_select_destination">Seleziona una destinazione</string> <string name="please_select_destination">Seleziona una destinazione</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string> <string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Impossibile copiare i file</string>
<string name="copying">Copia in corso</string> <string name="copying">Copia in corso</string>
<string name="copying_success">Files copied successfully</string>
<string name="copying_failed">Impossibile copiare i file</string>
<string name="copying_no_delete">Copying, please delete source files manually</string> <string name="copying_no_delete">Copying, please delete source files manually</string>
<string name="already_exists">A file with that name already exists</string> <string name="already_exists">A file with that name already exists</string>
<string name="ok">OK</string> <string name="ok">OK</string>

View File

@ -30,8 +30,9 @@
<string name="invalid_destination">選択した宛先に書き込みできませんでした</string> <string name="invalid_destination">選択した宛先に書き込みできませんでした</string>
<string name="please_select_destination">宛先を選択してください</string> <string name="please_select_destination">宛先を選択してください</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string> <string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">ファイルをコピーできませんでした</string>
<string name="copying">コピー中</string> <string name="copying">コピー中</string>
<string name="copying_success">Files copied successfully</string>
<string name="copying_failed">ファイルをコピーできませんでした</string>
<string name="copying_no_delete">Copying, please delete source files manually</string> <string name="copying_no_delete">Copying, please delete source files manually</string>
<string name="already_exists">A file with that name already exists</string> <string name="already_exists">A file with that name already exists</string>
<string name="ok">OK</string> <string name="ok">OK</string>

View File

@ -30,8 +30,9 @@
<string name="invalid_destination">Não foi possível escrever no destino selecionado</string> <string name="invalid_destination">Não foi possível escrever no destino selecionado</string>
<string name="please_select_destination">Por favor selecione um destino</string> <string name="please_select_destination">Por favor selecione um destino</string>
<string name="source_and_destination_same">A origem e o destino não podem ser iguais</string> <string name="source_and_destination_same">A origem e o destino não podem ser iguais</string>
<string name="copy_failed">Não foi possível copiar os ficheiros</string>
<string name="copying">A copiar</string> <string name="copying">A copiar</string>
<string name="copying_success">Files copied successfully</string>
<string name="copying_failed">Não foi possível copiar os ficheiros</string>
<string name="copying_no_delete">A copiar, apague os ficheiros originais manualmente</string> <string name="copying_no_delete">A copiar, apague os ficheiros originais manualmente</string>
<string name="already_exists">Já existe um ficheiro com este nome/string> <string name="already_exists">Já existe um ficheiro com este nome/string>
<string name="ok">OK</string> <string name="ok">OK</string>

View File

@ -30,8 +30,9 @@
<string name="invalid_destination">Det gick inte att skriva till målet</string> <string name="invalid_destination">Det gick inte att skriva till målet</string>
<string name="please_select_destination">Please select a destination</string> <string name="please_select_destination">Please select a destination</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string> <string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Kunde inte kopiera filen</string>
<string name="copying">Kopierar</string> <string name="copying">Kopierar</string>
<string name="copying_success">Files copied successfully</string>
<string name="copying_failed">Kunde inte kopiera filen</string>
<string name="copying_no_delete">Copying, please delete source files manually</string> <string name="copying_no_delete">Copying, please delete source files manually</string>
<string name="already_exists">A file with that name already exists</string> <string name="already_exists">A file with that name already exists</string>
<string name="ok">OK</string> <string name="ok">OK</string>

View File

@ -30,8 +30,9 @@
<string name="invalid_destination">Could not write to the selected destination</string> <string name="invalid_destination">Could not write to the selected destination</string>
<string name="please_select_destination">Please select a destination</string> <string name="please_select_destination">Please select a destination</string>
<string name="source_and_destination_same">Source and destination cannot be the same</string> <string name="source_and_destination_same">Source and destination cannot be the same</string>
<string name="copy_failed">Could not copy the files</string>
<string name="copying">Copying</string> <string name="copying">Copying</string>
<string name="copying_success">Files copied successfully</string>
<string name="copying_failed">An error occurred during the copy</string>
<string name="copying_no_delete">Copying, please delete source files manually</string> <string name="copying_no_delete">Copying, please delete source files manually</string>
<string name="already_exists">A file with that name already exists</string> <string name="already_exists">A file with that name already exists</string>
<string name="ok">OK</string> <string name="ok">OK</string>