disable compression on OTG devices for now
This commit is contained in:
parent
ad2c644f29
commit
f6b6d4a872
2 changed files with 12 additions and 2 deletions
|
@ -221,14 +221,19 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
|
|||
|
||||
private fun compressSelection() {
|
||||
val firstPath = fileDirItems[selectedPositions.first()].path
|
||||
if (activity.isPathOnOTG(firstPath)) {
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
return
|
||||
}
|
||||
|
||||
CompressAsDialog(activity, firstPath) {
|
||||
activity.handleSAFDialog(firstPath) {
|
||||
activity.toast(R.string.compressing)
|
||||
val paths = selectedPositions.map { fileDirItems[it].path }
|
||||
Thread {
|
||||
if (zipPaths(paths, it)) {
|
||||
activity.toast(R.string.compression_successful)
|
||||
activity.runOnUiThread {
|
||||
activity.toast(R.string.compression_successful)
|
||||
listener?.refreshItems()
|
||||
finishActMode()
|
||||
}
|
||||
|
@ -242,6 +247,11 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
|
|||
|
||||
private fun decompressSelection() {
|
||||
val firstPath = fileDirItems[selectedPositions.first()].path
|
||||
if (activity.isPathOnOTG(firstPath)) {
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
return
|
||||
}
|
||||
|
||||
activity.handleSAFDialog(firstPath) {
|
||||
activity.toast(R.string.decompressing)
|
||||
val paths = selectedPositions.map { fileDirItems[it].path }.filter { it.isZipFile() }
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/file_path"
|
||||
android:layout_marginTop="@dimen/normal_margin"
|
||||
android:layout_marginTop="@dimen/small_margin"
|
||||
android:text="@string/filename"
|
||||
android:textSize="@dimen/smaller_text_size"/>
|
||||
|
||||
|
|
Loading…
Reference in a new issue