update commons and add Whats new dialog handling

This commit is contained in:
tibbi 2016-12-26 23:52:59 +01:00
parent f7c3ad8d1c
commit 044ccb3619
4 changed files with 29 additions and 11 deletions

View file

@ -32,7 +32,7 @@ android {
}
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.theartofdev.edmodo:android-image-cropper:2.3.1'
compile 'com.booking:rtlviewpager:1.0.1'

View file

@ -15,6 +15,7 @@ import android.view.Menu
import android.view.MenuItem
import android.view.View
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.models.Release
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.adapters.DirectoryAdapter
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
@ -90,11 +91,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
override fun onResume() {
super.onResume()
tryloadGallery()
if (DirectoryAdapter.foregroundColor != config.primaryColor) {
DirectoryAdapter.foregroundColor = config.primaryColor
setupAdapter()
}
}
override fun onPause() {
@ -114,6 +110,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
else
getDirectories()
handleZooming()
checkWhatsNewDialog()
checkIfColorChanged()
} else {
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION)
}
@ -157,6 +155,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
finish()
}
private fun checkIfColorChanged() {
if (DirectoryAdapter.foregroundColor != config.primaryColor) {
DirectoryAdapter.foregroundColor = config.primaryColor
setupAdapter()
}
}
override fun prepareForDeleting(paths: ArrayList<String>) {
toast(R.string.deleting)
mToBeDeleted = paths
@ -343,4 +348,16 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
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)
}
}
}

View file

@ -11,16 +11,16 @@ class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
}
override fun onResume() {
super.onResume()
setupCustomizeColors()
setupSameSorting()
setupShowHiddenFolders()
setupAutoplayVideos()
setupShowMedia()
}
override fun onResume() {
super.onResume()
updateTextColors(settings_holder)
}

View file

@ -13,6 +13,7 @@ import android.view.ViewConfiguration
import com.simplemobiletools.commons.extensions.getMimeType
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.gallery.BuildConfig
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE
@ -111,7 +112,7 @@ fun Activity.hasNavBar(): Boolean {
fun SimpleActivity.launchAbout() {
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() {