update Commons to 2.30.9
This commit is contained in:
parent
44f7543ef1
commit
fd1faf3071
|
@ -37,7 +37,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.29.2'
|
compile 'com.simplemobiletools:commons:2.30.9'
|
||||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package com.simplemobiletools.filemanager.activities
|
package com.simplemobiletools.filemanager.activities
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.support.v4.app.ActivityCompat
|
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||||
|
@ -14,6 +11,7 @@ import com.simplemobiletools.commons.dialogs.StoragePickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
|
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
|
||||||
import com.simplemobiletools.commons.helpers.LICENSE_MULTISELECT
|
import com.simplemobiletools.commons.helpers.LICENSE_MULTISELECT
|
||||||
|
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
|
||||||
import com.simplemobiletools.commons.models.FileDirItem
|
import com.simplemobiletools.commons.models.FileDirItem
|
||||||
import com.simplemobiletools.commons.models.RadioItem
|
import com.simplemobiletools.commons.models.RadioItem
|
||||||
import com.simplemobiletools.commons.models.Release
|
import com.simplemobiletools.commons.models.Release
|
||||||
|
@ -31,7 +29,6 @@ import kotlinx.android.synthetic.main.activity_main.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Breadcrumbs.BreadcrumbsListener {
|
class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Breadcrumbs.BreadcrumbsListener {
|
||||||
private val STORAGE_PERMISSION = 1
|
|
||||||
private val BACK_PRESS_TIMEOUT = 5000
|
private val BACK_PRESS_TIMEOUT = 5000
|
||||||
|
|
||||||
private var latestFragment: ItemsFragment? = null
|
private var latestFragment: ItemsFragment? = null
|
||||||
|
@ -45,7 +42,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
storeStoragePaths()
|
storeStoragePaths()
|
||||||
storeConfigVariables()
|
storeConfigVariables()
|
||||||
breadcrumbs.setListener(this)
|
breadcrumbs.listener = this
|
||||||
tryInitFileManager()
|
tryInitFileManager()
|
||||||
checkWhatsNewDialog()
|
checkWhatsNewDialog()
|
||||||
checkIfRootAvailable()
|
checkIfRootAvailable()
|
||||||
|
@ -56,7 +53,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
updateTextColors(main_screen)
|
updateTextColors(main_screen)
|
||||||
if (storedTextColor != config.textColor) {
|
if (storedTextColor != config.textColor) {
|
||||||
storedTextColor = config.textColor
|
storedTextColor = config.textColor
|
||||||
breadcrumbs.setTextColor(storedTextColor)
|
breadcrumbs.textColor = storedTextColor
|
||||||
openPath(currentPath)
|
openPath(currentPath)
|
||||||
}
|
}
|
||||||
invalidateOptionsMenu()
|
invalidateOptionsMenu()
|
||||||
|
@ -77,10 +74,13 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryInitFileManager() {
|
private fun tryInitFileManager() {
|
||||||
if (hasWriteStoragePermission()) {
|
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||||
initRootFileManager()
|
if (it) {
|
||||||
} else {
|
initRootFileManager()
|
||||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION)
|
} else {
|
||||||
|
toast(R.string.no_storage_permissions)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,19 +226,6 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
||||||
|
|
||||||
if (requestCode == STORAGE_PERMISSION) {
|
|
||||||
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
initRootFileManager()
|
|
||||||
} else {
|
|
||||||
toast(R.string.no_storage_permissions)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun itemClicked(item: FileDirItem) {
|
override fun itemClicked(item: FileDirItem) {
|
||||||
openPath(item.path)
|
openPath(item.path)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
|
maven { url "https://maven.google.com" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue