Skip to content

Commit 868a76f

Browse files
committed
update the copy/move process a bit
1 parent 4446539 commit 868a76f

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

app/src/main/java/com/simplemobiletools/filemanager/asynctasks/CopyTask.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.os.AsyncTask
55
import android.support.v4.util.Pair
66
import android.util.Log
77
import com.simplemobiletools.filemanager.Config
8-
import com.simplemobiletools.filemanager.fragments.ItemsFragment
98
import com.simplemobiletools.filepicker.extensions.getFileDocument
109
import com.simplemobiletools.filepicker.extensions.needsStupidWritePermissions
1110
import com.simplemobiletools.filepicker.extensions.scanFile
@@ -134,14 +133,14 @@ class CopyTask(listener: CopyTask.CopyListener, val context: Context, val delete
134133
val listener = mListener?.get() ?: return
135134

136135
if (success) {
137-
listener.copySucceeded(if (deleteAfterCopy) ItemsFragment.ACTION_MOVE else ItemsFragment.ACTION_COPY)
136+
listener.copySucceeded(deleteAfterCopy)
138137
} else {
139138
listener.copyFailed()
140139
}
141140
}
142141

143142
interface CopyListener {
144-
fun copySucceeded(action: Int)
143+
fun copySucceeded(deleted: Boolean)
145144

146145
fun copyFailed()
147146
}

app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ public class ItemsFragment extends android.support.v4.app.Fragment
6868
private boolean mShowHidden;
6969
private int mSelectedItemsCnt;
7070

71-
public static int ACTION_COPY = 1;
72-
public static int ACTION_MOVE = 2;
73-
7471
@Nullable
7572
@Override
7673
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@@ -485,14 +482,14 @@ public void onDestroyActionMode(ActionMode mode) {
485482
}
486483

487484
@Override
488-
public void copySucceeded(int action) {
485+
public void copySucceeded(boolean deleted) {
489486
fillItems();
490-
Utils.Companion.showToast(getContext(), action == ACTION_COPY ? R.string.copying_success : R.string.moving_success);
487+
Utils.Companion.showToast(getContext(), deleted ? R.string.moving_success : R.string.copying_success);
491488
}
492489

493490
@Override
494491
public void copyFailed() {
495-
Utils.Companion.showToast(getContext(), R.string.copying_failed);
492+
Utils.Companion.showToast(getContext(), R.string.copy_move_failed);
496493
}
497494

498495
public interface ItemInteractionListener {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="source_and_destination_same">Source and destination cannot be the same</string>
3333
<string name="copying">Kopiere</string>
3434
<string name="copying_success">Files copied successfully</string>
35-
<string name="copying_failed">Konnte die Datei nicht kopieren</string>
35+
<string name="copy_move_failed">Konnte die Datei nicht kopieren</string>
3636
<string name="moving">Moving</string>
3737
<string name="moving_success">Files moved successfully</string>
3838
<string name="already_exists">A file with that name already exists</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="source_and_destination_same">Source and destination cannot be the same</string>
3333
<string name="copying">Copia in corso</string>
3434
<string name="copying_success">Files copied successfully</string>
35-
<string name="copying_failed">Impossibile copiare i file</string>
35+
<string name="copy_move_failed">Impossibile copiare i file</string>
3636
<string name="moving">Moving</string>
3737
<string name="moving_success">Files moved successfully</string>
3838
<string name="already_exists">A file with that name already exists</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="source_and_destination_same">Source and destination cannot be the same</string>
3333
<string name="copying">コピー中</string>
3434
<string name="copying_success">Files copied successfully</string>
35-
<string name="copying_failed">ファイルをコピーできませんでした</string>
35+
<string name="copy_move_failed">ファイルをコピーできませんでした</string>
3636
<string name="moving">Moving</string>
3737
<string name="moving_success">Files moved successfully</string>
3838
<string name="already_exists">A file with that name already exists</string>

app/src/main/res/values-pt-rPT/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="source_and_destination_same">A origem e o destino não podem ser iguais</string>
3333
<string name="copying">A copiar</string>
3434
<string name="copying_success">Ficheiros copiados com sucesso</string>
35-
<string name="copying_failed">Não foi possível copiar os ficheiros</string>
35+
<string name="copy_move_failed">Não foi possível copiar os ficheiros</string>
3636
<string name="moving">A mover</string>
3737
<string name="moving_success">Ficheiros movidos com sucesso</string>
3838
<string name="already_exists">Já existe um ficheiro com este nome</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="source_and_destination_same">Source and destination cannot be the same</string>
3333
<string name="copying">Kopierar</string>
3434
<string name="copying_success">Files copied successfully</string>
35-
<string name="copying_failed">Kunde inte kopiera filen</string>
35+
<string name="copy_move_failed">Kunde inte kopiera filen</string>
3636
<string name="moving">Moving</string>
3737
<string name="moving_success">Files moved successfully</string>
3838
<string name="already_exists">A file with that name already exists</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="source_and_destination_same">Source and destination cannot be the same</string>
3333
<string name="copying">Copying</string>
3434
<string name="copying_success">Files copied successfully</string>
35-
<string name="copying_failed">An error occurred</string>
35+
<string name="copy_move_failed">An error occurred</string>
3636
<string name="moving">Moving</string>
3737
<string name="moving_success">Files moved successfully</string>
3838
<string name="already_exists">A file with that name already exists</string>

0 commit comments

Comments
 (0)