|
|
@ -107,8 +107,8 @@ class WelcomeConfigFragment : BasePreferenceFragment(), |
|
|
|
private fun upPreferenceSummary(preferenceKey: String, value: String?) { |
|
|
|
private fun upPreferenceSummary(preferenceKey: String, value: String?) { |
|
|
|
val preference = findPreference<Preference>(preferenceKey) ?: return |
|
|
|
val preference = findPreference<Preference>(preferenceKey) ?: return |
|
|
|
when (preferenceKey) { |
|
|
|
when (preferenceKey) { |
|
|
|
PreferKey.defaultCover, |
|
|
|
PreferKey.welcomeImage, |
|
|
|
PreferKey.defaultCoverDark -> preference.summary = if (value.isNullOrBlank()) { |
|
|
|
PreferKey.welcomeImageDark -> preference.summary = if (value.isNullOrBlank()) { |
|
|
|
getString(R.string.select_image) |
|
|
|
getString(R.string.select_image) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
value |
|
|
|
value |
|
|
@ -123,7 +123,6 @@ class WelcomeConfigFragment : BasePreferenceFragment(), |
|
|
|
file = FileUtils.createFileIfNotExist(file, "covers", name) |
|
|
|
file = FileUtils.createFileIfNotExist(file, "covers", name) |
|
|
|
file.writeBytes(bytes) |
|
|
|
file.writeBytes(bytes) |
|
|
|
putPrefString(preferenceKey, file.absolutePath) |
|
|
|
putPrefString(preferenceKey, file.absolutePath) |
|
|
|
BookCover.upDefaultCover() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|