update commons and add Whats new dialog handling
This commit is contained in:
parent
f7c3ad8d1c
commit
044ccb3619
4 changed files with 29 additions and 11 deletions
|
@ -32,7 +32,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:1.2.3'
|
compile 'com.simplemobiletools:commons:1.2.4'
|
||||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
||||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
|
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
|
||||||
compile 'com.booking:rtlviewpager:1.0.1'
|
compile 'com.booking:rtlviewpager:1.0.1'
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
|
import com.simplemobiletools.commons.models.Release
|
||||||
import com.simplemobiletools.gallery.R
|
import com.simplemobiletools.gallery.R
|
||||||
import com.simplemobiletools.gallery.adapters.DirectoryAdapter
|
import com.simplemobiletools.gallery.adapters.DirectoryAdapter
|
||||||
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
|
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
|
||||||
|
@ -90,11 +91,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
tryloadGallery()
|
tryloadGallery()
|
||||||
|
|
||||||
if (DirectoryAdapter.foregroundColor != config.primaryColor) {
|
|
||||||
DirectoryAdapter.foregroundColor = config.primaryColor
|
|
||||||
setupAdapter()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
@ -114,6 +110,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
else
|
else
|
||||||
getDirectories()
|
getDirectories()
|
||||||
handleZooming()
|
handleZooming()
|
||||||
|
checkWhatsNewDialog()
|
||||||
|
checkIfColorChanged()
|
||||||
} else {
|
} else {
|
||||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION)
|
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION)
|
||||||
}
|
}
|
||||||
|
@ -157,6 +155,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkIfColorChanged() {
|
||||||
|
if (DirectoryAdapter.foregroundColor != config.primaryColor) {
|
||||||
|
DirectoryAdapter.foregroundColor = config.primaryColor
|
||||||
|
setupAdapter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun prepareForDeleting(paths: ArrayList<String>) {
|
override fun prepareForDeleting(paths: ArrayList<String>) {
|
||||||
toast(R.string.deleting)
|
toast(R.string.deleting)
|
||||||
mToBeDeleted = paths
|
mToBeDeleted = paths
|
||||||
|
@ -343,4 +348,16 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
deleteDirs()
|
deleteDirs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkWhatsNewDialog() {
|
||||||
|
arrayListOf<Release>().apply {
|
||||||
|
add(Release(46, R.string.release_46))
|
||||||
|
add(Release(47, R.string.release_47))
|
||||||
|
add(Release(49, R.string.release_49))
|
||||||
|
add(Release(50, R.string.release_50))
|
||||||
|
add(Release(51, R.string.release_51))
|
||||||
|
add(Release(52, R.string.release_52))
|
||||||
|
checkWhatsNew(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,16 +11,16 @@ class SettingsActivity : SimpleActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_settings)
|
setContentView(R.layout.activity_settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
|
||||||
setupCustomizeColors()
|
setupCustomizeColors()
|
||||||
setupSameSorting()
|
setupSameSorting()
|
||||||
setupShowHiddenFolders()
|
setupShowHiddenFolders()
|
||||||
setupAutoplayVideos()
|
setupAutoplayVideos()
|
||||||
setupShowMedia()
|
setupShowMedia()
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResume() {
|
|
||||||
super.onResume()
|
|
||||||
updateTextColors(settings_holder)
|
updateTextColors(settings_holder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import android.view.ViewConfiguration
|
||||||
import com.simplemobiletools.commons.extensions.getMimeType
|
import com.simplemobiletools.commons.extensions.getMimeType
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
import com.simplemobiletools.commons.helpers.*
|
import com.simplemobiletools.commons.helpers.*
|
||||||
|
import com.simplemobiletools.gallery.BuildConfig
|
||||||
import com.simplemobiletools.gallery.R
|
import com.simplemobiletools.gallery.R
|
||||||
import com.simplemobiletools.gallery.activities.SimpleActivity
|
import com.simplemobiletools.gallery.activities.SimpleActivity
|
||||||
import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE
|
import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE
|
||||||
|
@ -111,7 +112,7 @@ fun Activity.hasNavBar(): Boolean {
|
||||||
|
|
||||||
fun SimpleActivity.launchAbout() {
|
fun SimpleActivity.launchAbout() {
|
||||||
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_SUBSAMPLING or LICENSE_GLIDE or LICENSE_CROPPER or
|
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_SUBSAMPLING or LICENSE_GLIDE or LICENSE_CROPPER or
|
||||||
LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_FILEPROPERTIES)
|
LICENSE_MULTISELECT or LICENSE_RTL, BuildConfig.VERSION_NAME)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AppCompatActivity.showSystemUI() {
|
fun AppCompatActivity.showSystemUI() {
|
||||||
|
|
Loading…
Reference in a new issue