readd the Move button

This commit is contained in:
tibbi 2016-11-12 16:50:05 +01:00
parent 93b8281cfb
commit d4855573c9
12 changed files with 26 additions and 45 deletions

View file

@ -454,7 +454,7 @@ public class MainActivity extends SimpleActivity
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
final MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.directories_cab, menu);
inflater.inflate(R.menu.cab_directories, menu);
mActionMode = mode;
return true;
}
@ -504,7 +504,7 @@ public class MainActivity extends SimpleActivity
unhideFolders();
mode.finish();
return true;
case R.id.cab_copy:
case R.id.cab_copy_move:
displayCopyDialog();
return true;
default:

View file

@ -502,7 +502,7 @@ public class MediaActivity extends SimpleActivity
prepareForDeleting();
mode.finish();
return true;
case R.id.cab_copy:
case R.id.cab_copy_move:
displayCopyDialog();
return true;
default:

View file

@ -153,7 +153,7 @@ public class ViewPagerActivity extends SimpleActivity
case R.id.menu_set_as_wallpaper:
setAsWallpaper();
return true;
case R.id.menu_copy:
case R.id.menu_copy_move:
displayCopyDialog();
return true;
case R.id.menu_open_with:

View file

@ -6,21 +6,19 @@ import android.view.LayoutInflater
import android.view.WindowManager
import com.simplemobiletools.filepicker.extensions.humanizePath
import com.simplemobiletools.filepicker.extensions.toast
import com.simplemobiletools.gallery.Config
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.asynctasks.CopyTask
import kotlinx.android.synthetic.main.copy_item.view.*
import kotlinx.android.synthetic.main.dialog_copy_move.view.*
import java.io.File
class CopyDialog(val activity: SimpleActivity, val files: List<File>, val copyListener: CopyTask.CopyDoneListener, val listener: OnCopyListener) {
init {
val context = activity
val view = LayoutInflater.from(context).inflate(R.layout.copy_item, null)
val view = LayoutInflater.from(context).inflate(R.layout.dialog_copy_move, null)
val sourcePath = files[0].parent.trimEnd('/')
var destinationPath = ""
val config = Config.newInstance(context)
view.source.text = context.humanizePath(sourcePath)
@ -70,30 +68,14 @@ class CopyDialog(val activity: SimpleActivity, val files: List<File>, val copyLi
return@setOnClickListener
}
//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)
val pair = Pair<List<File>, File>(files, destinationDir)
CopyTask(copyListener, context).execute(pair)
dismiss()
/*} else {
if (Utils.isPathOnSD(context, sourcePath) && Utils.isPathOnSD(context, destinationPath)) {
val paths = ArrayList<String>()
for (f in files) {
val destination = File(destinationDir, f.name)
f.renameTo(destination)
paths.add(destination.absolutePath)
}
context.scanFile(paths.toTypedArray())
dismiss()
listener.onSuccess()
} else {
val pair = Pair<List<File>, File>(files, destinationDir)
CopyTask(copyListener, context).execute(pair)
dismiss()
}
}*/
})
}
}

View file

@ -23,8 +23,7 @@
android:layout_marginBottom="@dimen/activity_margin"
android:layout_marginLeft="@dimen/activity_margin"
android:paddingRight="@dimen/small_padding"
android:paddingTop="@dimen/small_padding"
android:text="source"/>
android:paddingTop="@dimen/small_padding"/>
<TextView
android:id="@+id/destination_label"
@ -44,7 +43,7 @@
android:paddingTop="@dimen/small_padding"
android:text="@string/select_destination"/>
<!--<RadioGroup
<RadioGroup
android:id="@+id/dialog_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -62,5 +61,5 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/move"/>
</RadioGroup>-->
</RadioGroup>
</LinearLayout>

View file

@ -22,8 +22,8 @@
android:title="@string/unhide_folder"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/cab_copy"
android:title="@string/copy"
android:id="@+id/cab_copy_move"
android:title="@string/copy_move"
app:showAsAction="never"/>
<item
android:id="@+id/cab_delete"

View file

@ -17,7 +17,7 @@
android:title="@string/delete"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/cab_copy"
android:title="@string/copy"
android:id="@+id/cab_copy_move"
android:title="@string/copy_move"
app:showAsAction="never"/>
</menu>

View file

@ -2,8 +2,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_copy"
android:title="@string/copy"
android:id="@+id/menu_copy_move"
android:title="@string/copy_move"
app:showAsAction="never"/>
<item
android:id="@+id/menu_set_as_wallpaper"

View file

@ -40,7 +40,7 @@
<string name="file_saved">Archivo guardado con éxito</string>
<string name="copy">Copy</string>
<string name="move">Move</string>
<string name="copy_move">Copy/Move to</string>
<string name="copy_move">Copy/Move</string>
<string name="copy_item">Copy item</string>
<string name="copy_items">Copy items</string>
<string name="source">Source</string>

View file

@ -40,7 +40,7 @@
<string name="file_saved">File saved successfully</string>
<string name="copy">コピー</string>
<string name="move">移動</string>
<string name="copy_move">Copy/Move to</string>
<string name="copy_move">Copy/Move</string>
<string name="copy_item">アイテムをコピー</string>
<string name="copy_items">アイテムをコピー</string>
<string name="source"></string>

View file

@ -40,7 +40,7 @@
<string name="file_saved">File saved successfully</string>
<string name="copy">Kopiera</string>
<string name="move">Flytta</string>
<string name="copy_move">Copy/Move to</string>
<string name="copy_move">Copy/Move</string>
<string name="copy_item">Kopiera objekt</string>
<string name="copy_items">Kopiera objekt</string>
<string name="source">Källa</string>

View file

@ -40,7 +40,7 @@
<string name="file_saved">File saved successfully</string>
<string name="copy">Copy</string>
<string name="move">Move</string>
<string name="copy_move">Copy/Move to</string>
<string name="copy_move">Copy/Move</string>
<string name="copy_item">Copy item</string>
<string name="copy_items">Copy items</string>
<string name="source">Source</string>