Fix clock widget height when system bar visibility has changed

Fix #50
This commit is contained in:
MM20 2022-04-01 15:38:55 +02:00
parent b1b116a7d3
commit 6501c263dd
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -265,8 +265,6 @@ class LauncherScaffoldView @JvmOverloads constructor(
val hideStatusBar = viewModel.hideStatusBar.value == true val hideStatusBar = viewModel.hideStatusBar.value == true
val hideNavBar = viewModel.hideNavBar.value == true val hideNavBar = viewModel.hideNavBar.value == true
Log.d("MM20", "status: $hideStatusBar, nav: $hideNavBar")
var topPadding = 0 var topPadding = 0
var leftPadding = 0 var leftPadding = 0
var rightPadding = 0 var rightPadding = 0
@ -289,6 +287,7 @@ class LauncherScaffoldView @JvmOverloads constructor(
} }
setPadding(leftPadding, topPadding, rightPadding, bottomPadding) setPadding(leftPadding, topPadding, rightPadding, bottomPadding)
binding.widgetContainer.setClockWidgetHeight(height - paddingTop - paddingBottom)
} }
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {