allow copying and moving only photo and video files with the gallery

This commit is contained in:
tibbi 2016-11-12 19:57:18 +01:00
parent cf67f52ea2
commit 7c3ad32dee
4 changed files with 6 additions and 6 deletions

View file

@ -52,7 +52,7 @@ import butterknife.ButterKnife;
public class MainActivity extends SimpleActivity public class MainActivity extends SimpleActivity
implements AdapterView.OnItemClickListener, GridView.MultiChoiceModeListener, GridView.OnTouchListener, implements AdapterView.OnItemClickListener, GridView.MultiChoiceModeListener, GridView.OnTouchListener,
SwipeRefreshLayout.OnRefreshListener, ChangeSorting.ChangeDialogListener, GetDirectoriesAsynctask.GetDirectoriesListener, SwipeRefreshLayout.OnRefreshListener, ChangeSorting.ChangeDialogListener, GetDirectoriesAsynctask.GetDirectoriesListener,
CopyMoveTask.CopyListener { CopyMoveTask.CopyMoveListener {
@BindView(R.id.directories_grid) GridView mGridView; @BindView(R.id.directories_grid) GridView mGridView;
@BindView(R.id.directories_holder) SwipeRefreshLayout mSwipeRefreshLayout; @BindView(R.id.directories_holder) SwipeRefreshLayout mSwipeRefreshLayout;

View file

@ -51,7 +51,7 @@ import butterknife.ButterKnife;
public class MediaActivity extends SimpleActivity public class MediaActivity extends SimpleActivity
implements AdapterView.OnItemClickListener, GridView.MultiChoiceModeListener, GridView.OnTouchListener, implements AdapterView.OnItemClickListener, GridView.MultiChoiceModeListener, GridView.OnTouchListener,
SwipeRefreshLayout.OnRefreshListener, ChangeSorting.ChangeDialogListener, CopyMoveTask.CopyListener { SwipeRefreshLayout.OnRefreshListener, ChangeSorting.ChangeDialogListener, CopyMoveTask.CopyMoveListener {
private static final String TAG = MediaActivity.class.getSimpleName(); private static final String TAG = MediaActivity.class.getSimpleName();
@BindView(R.id.media_grid) GridView mGridView; @BindView(R.id.media_grid) GridView mGridView;
@BindView(R.id.media_holder) SwipeRefreshLayout mSwipeRefreshLayout; @BindView(R.id.media_holder) SwipeRefreshLayout mSwipeRefreshLayout;

View file

@ -43,7 +43,7 @@ import butterknife.OnClick;
public class ViewPagerActivity extends SimpleActivity public class ViewPagerActivity extends SimpleActivity
implements ViewPager.OnPageChangeListener, View.OnSystemUiVisibilityChangeListener, ViewPager.OnTouchListener, implements ViewPager.OnPageChangeListener, View.OnSystemUiVisibilityChangeListener, ViewPager.OnTouchListener,
ViewPagerFragment.FragmentClickListener, CopyMoveTask.CopyListener { ViewPagerFragment.FragmentClickListener, CopyMoveTask.CopyMoveListener {
@BindView(R.id.undo_delete) View mUndoBtn; @BindView(R.id.undo_delete) View mUndoBtn;
@BindView(R.id.view_pager) MyViewPager mPager; @BindView(R.id.view_pager) MyViewPager mPager;

View file

@ -16,7 +16,7 @@ import kotlinx.android.synthetic.main.dialog_copy_move.view.*
import java.io.File import java.io.File
import java.util.* import java.util.*
class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val copyMoveListener: CopyMoveTask.CopyListener) { class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val copyMoveListener: CopyMoveTask.CopyMoveListener) {
init { init {
val context = activity val context = activity
@ -76,13 +76,13 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
if (view.dialog_radio_group.checkedRadioButtonId == R.id.dialog_radio_copy) { if (view.dialog_radio_group.checkedRadioButtonId == R.id.dialog_radio_copy) {
context.toast(R.string.copying) context.toast(R.string.copying)
val pair = Pair<ArrayList<File>, File>(files, destinationDir) val pair = Pair<ArrayList<File>, File>(files, destinationDir)
CopyMoveTask(context, false, config.treeUri, copyMoveListener).execute(pair) CopyMoveTask(context, false, config.treeUri, true, copyMoveListener).execute(pair)
dismiss() dismiss()
} else { } else {
if (context.isPathOnSD(sourcePath) || context.isPathOnSD(destinationPath)) { if (context.isPathOnSD(sourcePath) || context.isPathOnSD(destinationPath)) {
context.toast(R.string.moving) context.toast(R.string.moving)
val pair = Pair<ArrayList<File>, File>(files, destinationDir) val pair = Pair<ArrayList<File>, File>(files, destinationDir)
CopyMoveTask(context, true, config.treeUri, copyMoveListener).execute(pair) CopyMoveTask(context, true, config.treeUri, true, copyMoveListener).execute(pair)
dismiss() dismiss()
} else { } else {
val updatedFiles = ArrayList<File>(files.size * 2) val updatedFiles = ArrayList<File>(files.size * 2)