mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-26 23:28:58 +03:00
Minor changes
This commit is contained in:
parent
3a1699f0b3
commit
beca2b429c
3 changed files with 7 additions and 2 deletions
|
@ -28,6 +28,7 @@ class SettingsActivity : BaseActivity(),
|
|||
override fun onCreate(savedState: Bundle?) {
|
||||
setAppTheme()
|
||||
super.onCreate(savedState)
|
||||
setTitle(R.string.label_settings)
|
||||
setContentView(R.layout.activity_preferences)
|
||||
|
||||
replaceFragmentStrategy = ReplaceFragment(this,
|
||||
|
|
|
@ -44,6 +44,11 @@ fun syncChaptersWithSource(db: DatabaseHelper,
|
|||
// Chapters from the db not in the source.
|
||||
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>()
|
||||
|
||||
db.inTransaction {
|
||||
|
|
|
@ -78,8 +78,7 @@ object LocaleHelper {
|
|||
if (systemLocale == null) {
|
||||
systemLocale = getConfigLocale(config)
|
||||
}
|
||||
// In API 16 and lower [systemLocale] can't be changed.
|
||||
if (configChange && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
if (configChange) {
|
||||
val configLocale = getConfigLocale(config)
|
||||
if (currentLocale == configLocale) {
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue