Minor changes

This commit is contained in:
len 2017-01-01 20:54:41 +01:00
parent 3a1699f0b3
commit beca2b429c
3 changed files with 7 additions and 2 deletions

View File

@ -28,6 +28,7 @@ class SettingsActivity : BaseActivity(),
override fun onCreate(savedState: Bundle?) { override fun onCreate(savedState: Bundle?) {
setAppTheme() setAppTheme()
super.onCreate(savedState) super.onCreate(savedState)
setTitle(R.string.label_settings)
setContentView(R.layout.activity_preferences) setContentView(R.layout.activity_preferences)
replaceFragmentStrategy = ReplaceFragment(this, replaceFragmentStrategy = ReplaceFragment(this,

View File

@ -44,6 +44,11 @@ fun syncChaptersWithSource(db: DatabaseHelper,
// Chapters from the db not in the source. // Chapters from the db not in the source.
val toDelete = dbChapters.filterNot { it in sourceChapters } val toDelete = dbChapters.filterNot { it in sourceChapters }
// Return if there's nothing to add or delete, avoiding unnecessary db transactions.
if (toAdd.isEmpty() && toDelete.isEmpty()) {
return Pair(emptyList(), emptyList())
}
val readded = mutableListOf<Chapter>() val readded = mutableListOf<Chapter>()
db.inTransaction { db.inTransaction {

View File

@ -78,8 +78,7 @@ object LocaleHelper {
if (systemLocale == null) { if (systemLocale == null) {
systemLocale = getConfigLocale(config) systemLocale = getConfigLocale(config)
} }
// In API 16 and lower [systemLocale] can't be changed. if (configChange) {
if (configChange && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
val configLocale = getConfigLocale(config) val configLocale = getConfigLocale(config)
if (currentLocale == configLocale) { if (currentLocale == configLocale) {
return return