Home Controls: Fix column computation.

When we enter home controls from a full screen media player and auto
rotation is off, the columns were not being computed correctly. This is
because we were getting the config resources from the application
context and not the activity context.

Bug: 203177915
Test: Manual
Change-Id: Iec76d61b1506022746127b58d022656e82da99d3
This commit is contained in:
Aaron Liu
2022-02-03 19:55:38 +00:00
parent 4324a25dba
commit d276dd5efc

View File

@@ -437,7 +437,7 @@ class ControlsUiControllerImpl @Inject constructor (
* number of columns. This helps prevent text truncation on these devices.
*/
private fun findMaxColumns(): Int {
val res = context.resources
val res = activityContext.resources
var maxColumns = res.getInteger(R.integer.controls_max_columns)
val maxColumnsAdjustWidth =
res.getInteger(R.integer.controls_max_columns_adjust_below_width_dp)