mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-06 21:33:39 +01:00
minor code style updates here and there
This commit is contained in:
parent
fd1faf3071
commit
ccc1b8bade
@ -1,10 +1,5 @@
|
||||
package com.simplemobiletools.filemanager.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
|
||||
open class SimpleActivity : BaseSimpleActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
}
|
||||
open class SimpleActivity : BaseSimpleActivity()
|
||||
|
@ -40,8 +40,6 @@ import java.util.zip.ZipOutputStream
|
||||
|
||||
class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList<FileDirItem>, val listener: ItemOperationsListener?, val itemClick: (FileDirItem) -> Unit) :
|
||||
RecyclerView.Adapter<ItemsAdapter.ViewHolder>() {
|
||||
private val BUFFER = 2048
|
||||
|
||||
val multiSelector = MultiSelector()
|
||||
val config = activity.config
|
||||
|
||||
@ -70,7 +68,7 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList<FileDir
|
||||
updateTitle(selectedPositions.size)
|
||||
}
|
||||
|
||||
fun updateTitle(cnt: Int) {
|
||||
private fun updateTitle(cnt: Int) {
|
||||
actMode?.title = "$cnt / ${mItems.size}"
|
||||
actMode?.invalidate()
|
||||
}
|
||||
@ -321,7 +319,7 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList<FileDir
|
||||
return true
|
||||
}
|
||||
|
||||
fun zipPaths(sourcePaths: List<String>, targetPath: String): Boolean {
|
||||
private fun zipPaths(sourcePaths: List<String>, targetPath: String): Boolean {
|
||||
val queue = LinkedList<File>()
|
||||
val fos = activity.getFileOutputStreamSync(targetPath, "application/zip") ?: return false
|
||||
|
||||
|
@ -31,14 +31,12 @@ class ChangeSortingDialog(val activity: SimpleActivity, val path: String = "", v
|
||||
|
||||
private fun setupSortRadio() {
|
||||
val sortingRadio = view.sorting_dialog_radio_sorting
|
||||
var sortBtn = sortingRadio.sorting_dialog_radio_name
|
||||
|
||||
if (currSorting and SORT_BY_SIZE != 0) {
|
||||
sortBtn = sortingRadio.sorting_dialog_radio_size
|
||||
} else if (currSorting and SORT_BY_DATE_MODIFIED != 0) {
|
||||
sortBtn = sortingRadio.sorting_dialog_radio_last_modified
|
||||
} else if (currSorting and SORT_BY_EXTENSION != 0)
|
||||
sortBtn = sortingRadio.sorting_dialog_radio_extension
|
||||
val sortBtn = when {
|
||||
currSorting and SORT_BY_SIZE != 0 -> sortingRadio.sorting_dialog_radio_size
|
||||
currSorting and SORT_BY_DATE_MODIFIED != 0 -> sortingRadio.sorting_dialog_radio_last_modified
|
||||
currSorting and SORT_BY_EXTENSION != 0 -> sortingRadio.sorting_dialog_radio_extension
|
||||
else -> sortingRadio.sorting_dialog_radio_name
|
||||
}
|
||||
sortBtn.isChecked = true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user