mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-21 14:20:39 +01:00
simplify the copydialog constructor
This commit is contained in:
parent
e87b6553a1
commit
3ce7d682b6
@ -368,7 +368,7 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
|||||||
itemsToCopy.add(new File(item.getPath()));
|
itemsToCopy.add(new File(item.getPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
new CopyDialog(getActivity(), itemsToCopy, mPath, this, new CopyDialog.OnCopyListener() {
|
new CopyDialog(getActivity(), itemsToCopy, this, new CopyDialog.OnCopyListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
fillItems();
|
fillItems();
|
||||||
|
@ -19,11 +19,12 @@ import com.simplemobiletools.filepicker.dialogs.FilePickerDialog
|
|||||||
import kotlinx.android.synthetic.main.copy_item.view.*
|
import kotlinx.android.synthetic.main.copy_item.view.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
class CopyDialog(val activity: Activity, val files: List<File>, val path: String, val copyListener: CopyTask.CopyListener, val listener: OnCopyListener) {
|
class CopyDialog(val activity: Activity, val files: List<File>, val copyListener: CopyTask.CopyListener, val listener: OnCopyListener) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val context = activity
|
val context = activity
|
||||||
val view = LayoutInflater.from(context).inflate(R.layout.copy_item, null)
|
val view = LayoutInflater.from(context).inflate(R.layout.copy_item, null)
|
||||||
|
val path = files[0].parent
|
||||||
view.source.text = "${path.trimEnd('/')}/"
|
view.source.text = "${path.trimEnd('/')}/"
|
||||||
|
|
||||||
view.destination.setOnClickListener {
|
view.destination.setOnClickListener {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user