Skip to content

Commit

Permalink
Add missing override
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed Apr 12, 2024
1 parent 85de6a0 commit ba037ba
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,28 @@ class Subject(context: Context, config: SubjectConfigurationInterface?) {
field = depth
standardPairs[Parameters.COLOR_DEPTH] = depth.toString()
}

var useContextResourcesScreenResolution: Boolean? = false
/**
* Whether to get the size from the context resources or not.
* By default this is false, the size is obtained from WindowManager.
*
* @param useContextResourcesScreenResolution
*/
set(useContextResourcesScreenResolution) {
if (useContextResourcesScreenResolution == null) {
return
}

field = useContextResourcesScreenResolution
}


init {
setDefaultTimezone()
setDefaultLanguage()
setDefaultScreenResolution(context, config?.useContextResourcesScreenResolution)

if (config != null) {
config.userId?.let { userId = it }
config.networkUserId?.let { networkUserId = it }
Expand All @@ -197,6 +212,7 @@ class Subject(context: Context, config: SubjectConfigurationInterface?) {
config.screenResolution?.let { screenResolution = it }
config.screenViewPort?.let { screenViewPort = it }
config.colorDepth?.let { colorDepth = it }
config.useContextResourcesScreenResolution?.let { useContextResourcesScreenResolution = it }
}
v(TAG, "Subject created successfully.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ class SubjectControllerImpl // Constructors
subject.colorDepth = colorDepth
}

override var useContextResourcesScreenResolution: Boolean?
get() = subject.useContextResourcesScreenResolution
set(useContextResourcesScreenResolution) {
dirtyConfig.useContextResourcesScreenResolution = useContextResourcesScreenResolution
subject.useContextResourcesScreenResolution = useContextResourcesScreenResolution
}

// Private methods
private val subject: Subject
get() = serviceProvider.getOrMakeSubject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ open class SubjectConfiguration() : Configuration, SubjectConfigurationInterface
get() = _colorDepth ?: sourceConfig?.colorDepth
set(value) { _colorDepth = value }

private var _useContextResourcesScreenResolution: Boolean? = false
private var _useContextResourcesScreenResolution: Boolean? = null
override var useContextResourcesScreenResolution: Boolean?
get() = _useContextResourcesScreenResolution ?: sourceConfig?.useContextResourcesScreenResolution
set(value) { _useContextResourcesScreenResolution = value }
Expand Down Expand Up @@ -174,9 +174,9 @@ open class SubjectConfiguration() : Configuration, SubjectConfigurationInterface
}

/**
* Set this flag to true to define the default screen resolution based on the context's Resources
* display metrics, rather than the deprecated WindowManager. NB: the height value will be smaller
* using Resources as it doesn't include the menu bar.
* Set this flag to true to define the default screen resolution (at tracker initialization)
* based on the context's Resources display metrics, rather than the deprecated WindowManager.
* NB: the height value will be smaller using Resources as it doesn't include the menu bar.
* Defaults to false.
*/
fun useContextResourcesScreenResolution(useContextResourcesScreenResolution: Boolean?): SubjectConfiguration {
Expand Down

0 comments on commit ba037ba

Please sign in to comment.