remove some redundant function
This commit is contained in:
parent
a9520ef182
commit
1e67bc9823
|
@ -66,11 +66,6 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
mStoredTextColor = config.textColor
|
mStoredTextColor = config.textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
config.isFirstRun = false
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun tryInitFileManager() {
|
private fun tryInitFileManager() {
|
||||||
if (hasWriteStoragePermission()) {
|
if (hasWriteStoragePermission()) {
|
||||||
initRootFileManager()
|
initRootFileManager()
|
||||||
|
|
|
@ -6,7 +6,6 @@ import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.filemanager.R
|
import com.simplemobiletools.filemanager.R
|
||||||
import com.simplemobiletools.filemanager.extensions.config
|
|
||||||
import kotlinx.android.synthetic.main.dialog_create_new.view.*
|
import kotlinx.android.synthetic.main.dialog_create_new.view.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
@ -50,7 +49,7 @@ class CreateNewItemDialog(val activity: Activity, val path: String, val callback
|
||||||
|
|
||||||
private fun createDirectory(file: File, alertDialog: AlertDialog): Boolean {
|
private fun createDirectory(file: File, alertDialog: AlertDialog): Boolean {
|
||||||
return if (activity.needsStupidWritePermissions(path)) {
|
return if (activity.needsStupidWritePermissions(path)) {
|
||||||
val documentFile = activity.getFileDocument(file.absolutePath, activity.config.treeUri) ?: return false
|
val documentFile = activity.getFileDocument(file.absolutePath) ?: return false
|
||||||
documentFile.createDirectory(file.name)
|
documentFile.createDirectory(file.name)
|
||||||
success(alertDialog)
|
success(alertDialog)
|
||||||
true
|
true
|
||||||
|
@ -68,7 +67,7 @@ class CreateNewItemDialog(val activity: Activity, val path: String, val callback
|
||||||
private fun createFile(file: File, alertDialog: AlertDialog): Boolean {
|
private fun createFile(file: File, alertDialog: AlertDialog): Boolean {
|
||||||
try {
|
try {
|
||||||
if (activity.needsStupidWritePermissions(path)) {
|
if (activity.needsStupidWritePermissions(path)) {
|
||||||
val documentFile = activity.getFileDocument(file.absolutePath, activity.config.treeUri) ?: return false
|
val documentFile = activity.getFileDocument(file.absolutePath) ?: return false
|
||||||
documentFile.createFile("", file.name)
|
documentFile.createFile("", file.name)
|
||||||
success(alertDialog)
|
success(alertDialog)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue