From bbdba815b4db96dc1bbd65a18b0b979d567a8984 Mon Sep 17 00:00:00 2001 From: Aleksandr Zhukov Date: Tue, 23 Jul 2024 14:17:46 +0200 Subject: [PATCH] Self review --- .../view/ui/delegate/GamificationToolbarDelegate.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/androidHyperskillApp/src/main/java/org/hyperskill/app/android/gamification_toolbar/view/ui/delegate/GamificationToolbarDelegate.kt b/androidHyperskillApp/src/main/java/org/hyperskill/app/android/gamification_toolbar/view/ui/delegate/GamificationToolbarDelegate.kt index 4b0e73879e..c9234bae66 100644 --- a/androidHyperskillApp/src/main/java/org/hyperskill/app/android/gamification_toolbar/view/ui/delegate/GamificationToolbarDelegate.kt +++ b/androidHyperskillApp/src/main/java/org/hyperskill/app/android/gamification_toolbar/view/ui/delegate/GamificationToolbarDelegate.kt @@ -172,6 +172,7 @@ class GamificationToolbarDelegate( ) } + @Suppress("MagicNumber") private fun applyInsetsToCollapsingToolbarLayout( context: Context, collapsingToolbarLayout: CollapsingToolbarLayout, @@ -203,12 +204,13 @@ class GamificationToolbarDelegate( collapsingToolbarLayout.updateLayoutParams { height = if (subtitle != null) { - context.resources.getDimensionPixelOffset(R.dimen.gamification_toolbar_with_subtitle_height) + - subtitlePaddingVertical + context.resources.getDimensionPixelOffset( + R.dimen.gamification_toolbar_with_subtitle_height + ) + subtitlePaddingVertical } else { R.dimen.gamification_toolbar_default_height } + insetTop } - collapsingToolbarLayout.expandedTitleMarginTop = insetTop + subtitlePaddingVertical * 3 + collapsingToolbarLayout.expandedTitleMarginTop = insetTop + subtitlePaddingVertical } } \ No newline at end of file