Skip to content

Commit

Permalink
- fix overwriting default values via xml is not possible (as builder …
Browse files Browse the repository at this point in the history
…sets non null)

  - FIX #645
  • Loading branch information
mikepenz committed May 28, 2021
1 parent 5526797 commit 8c6ad31
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,33 @@ class LibsBuilder : Serializable {
var showVersion: Boolean = true
var showLoadingProgress = true

internal var _aboutShowIcon: Boolean? = null
var aboutShowIcon: Boolean = true
set(value) {
_aboutShowIcon = value
field = value
}
var aboutVersionString: String = ""
var aboutAppName: String? = null
internal var _aboutShowVersion: Boolean? = null
var aboutShowVersion: Boolean = true
set(value) {
_aboutShowVersion = value
field = value
}
var aboutDescription: String? = null
internal var _aboutShowVersionName: Boolean? = null
var aboutShowVersionName: Boolean = true
set(value) {
_aboutShowVersionName = value
field = value
}
internal var _aboutShowVersionCode: Boolean? = null
var aboutShowVersionCode: Boolean = true
set(value) {
_aboutShowVersionCode = value
field = value
}

var aboutMinimalDesign: Boolean = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,19 @@ class LibsFragmentCompat : Filterable {
}

//fill the builder with the information
builder.aboutShowIcon = ctx.extractBooleanBundleOrResource(builder.aboutShowIcon, "aboutLibraries_description_showIcon") ?: false
builder.aboutShowVersion = ctx.extractBooleanBundleOrResource(builder.aboutShowVersion, "aboutLibraries_description_showVersion") ?: false
builder.aboutShowVersionName = ctx.extractBooleanBundleOrResource(builder.aboutShowVersionName, "aboutLibraries_description_showVersionName")
?: false
builder.aboutShowVersionCode = ctx.extractBooleanBundleOrResource(builder.aboutShowVersionCode, "aboutLibraries_description_showVersionCode")
?: false
builder.aboutShowIcon = ctx.extractBooleanBundleOrResource(builder._aboutShowIcon, "aboutLibraries_description_showIcon") ?: false
builder.aboutShowVersion = ctx.extractBooleanBundleOrResource(builder._aboutShowVersion, "aboutLibraries_description_showVersion") ?: false
builder.aboutShowVersionName = ctx.extractBooleanBundleOrResource(builder._aboutShowVersionName, "aboutLibraries_description_showVersionName")
?: false
builder.aboutShowVersionCode = ctx.extractBooleanBundleOrResource(builder._aboutShowVersionCode, "aboutLibraries_description_showVersionCode")
?: false

builder.aboutAppName = ctx.extractStringBundleOrResource(builder.aboutAppName, "aboutLibraries_description_name") ?: ""
builder.aboutDescription = ctx.extractStringBundleOrResource(builder.aboutDescription, "aboutLibraries_description_text") ?: ""

builder.aboutAppSpecial1 = ctx.extractStringBundleOrResource(builder.aboutAppSpecial1, "aboutLibraries_description_special1_name")
builder.aboutAppSpecial1Description = ctx.extractStringBundleOrResource(builder.aboutAppSpecial1Description, "aboutLibraries_description_special1_text")
builder.aboutAppSpecial1Description =
ctx.extractStringBundleOrResource(builder.aboutAppSpecial1Description, "aboutLibraries_description_special1_text")
builder.aboutAppSpecial2 = ctx.extractStringBundleOrResource(builder.aboutAppSpecial2, "aboutLibraries_description_special2_name")
builder.aboutAppSpecial2Description = ctx.extractStringBundleOrResource(builder.aboutAppSpecial2Description, "aboutLibraries_description_special2_text")
builder.aboutAppSpecial3 = ctx.extractStringBundleOrResource(builder.aboutAppSpecial3, "aboutLibraries_description_special3_name")
Expand Down

0 comments on commit 8c6ad31

Please sign in to comment.