mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
remove Long extension
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
package com.simplemobiletools.filemanager.extensions
|
||||
|
||||
import java.text.DecimalFormat
|
||||
|
||||
fun Long.formatSize(): String {
|
||||
if (this <= 0)
|
||||
return "0 B"
|
||||
|
||||
val units = arrayOf("B", "kB", "MB", "GB", "TB")
|
||||
val digitGroups = (Math.log10(toDouble()) / Math.log10(1024.0)).toInt()
|
||||
return DecimalFormat("#,##0.#").format(this / Math.pow(1024.0, digitGroups.toDouble())) + " " + units[digitGroups]
|
||||
}
|
@ -76,9 +76,11 @@ class ItemsFragment : android.support.v4.app.Fragment(), ItemsAdapter.ItemOperat
|
||||
val adapter = ItemsAdapter(activity as SimpleActivity, mItems, this) {
|
||||
itemClicked(it)
|
||||
}
|
||||
items_list.adapter = adapter
|
||||
items_list.addItemDecoration(RecyclerViewDivider(context))
|
||||
items_list.setOnTouchListener { view, motionEvent -> checkDelete(); false }
|
||||
items_list.apply {
|
||||
this@apply.adapter = adapter
|
||||
addItemDecoration(RecyclerViewDivider(context))
|
||||
setOnTouchListener { view, motionEvent -> checkDelete(); false }
|
||||
}
|
||||
}
|
||||
|
||||
fun setListener(listener: ItemInteractionListener) {
|
||||
|
Reference in New Issue
Block a user