Merge branch 'master' of github.com:SimpleMobileTools/Simple-Gallery

This commit is contained in:
tibbi 2019-04-01 12:23:02 +02:00
commit ee6d283c96
5 changed files with 9 additions and 9 deletions

View File

@ -801,7 +801,7 @@ class SettingsActivity : SimpleActivity() {
LAST_CONFLICT_APPLY_TO_ALL -> config.lastConflictApplyToAll = value.toBoolean() LAST_CONFLICT_APPLY_TO_ALL -> config.lastConflictApplyToAll = value.toBoolean()
} }
if(key.startsWith(LAST_VIDEO_POSITION_PREFIX)) { if (key.startsWith(LAST_VIDEO_POSITION_PREFIX)) {
config.saveLastVideoPosition(key, value as Int) config.saveLastVideoPosition(key, value as Int)
} }
} }

View File

@ -325,7 +325,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
private fun setLastVideoSavedPosition() { private fun setLastVideoSavedPosition() {
val pos = config.getLastVideoPosition(mUri.toString()) val pos = config.getLastVideoPosition(mUri.toString())
if(pos > 0) { if (pos > 0) {
setPosition(pos) setPosition(pos)
} }
} }

View File

@ -287,7 +287,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
private fun restoreLastVideoSavedPosition() { private fun restoreLastVideoSavedPosition() {
val pos = mConfig.getLastVideoPosition(mMedium.path) val pos = mConfig.getLastVideoPosition(mMedium.path)
if(pos > 0) { if (pos > 0) {
setPosition(pos) setPosition(pos)
} }
} }

View File

@ -385,11 +385,11 @@ class Config(context: Context) : BaseConfig(context) {
} }
} }
fun getLastVideoPosition(path: String): Int { fun getLastVideoPosition(path: String) = prefs.getInt("$LAST_VIDEO_POSITION_PREFIX${path.toLowerCase()}", 0)
return prefs.getInt("$LAST_VIDEO_POSITION_PREFIX${path.toLowerCase()}", 0)
}
fun getAllLastVideoPositions() = prefs.all.filterKeys { it.startsWith(LAST_VIDEO_POSITION_PREFIX) } fun getAllLastVideoPositions() = prefs.all.filterKeys {
it.startsWith(LAST_VIDEO_POSITION_PREFIX)
}
var rememberLastVideoPosition: Boolean var rememberLastVideoPosition: Boolean
get() = prefs.getBoolean(REMEMBER_LAST_VIDEO_POSITION, false) get() = prefs.getBoolean(REMEMBER_LAST_VIDEO_POSITION, false)