Skip to content

Commit

Permalink
fix: hide upgrade button for collapsed toolbar in course dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-arshad-dev committed Jul 24, 2024
1 parent 90aefd7 commit 5ae073e
Showing 1 changed file with 46 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,16 @@ private fun CollapsingLayoutTablet(
)
}

Box(
Column(
modifier = Modifier
.onSizeChanged { size ->
expandedTopHeight.value = size.height.toFloat()
}
.offset { IntOffset(x = 0, y = backgroundImageHeight.value.roundToInt()) },
content = expandedTop,
)
) {
Box(content = expandedTop)
Box(content = upgradeButton)
}

Icon(
modifier = Modifier
Expand All @@ -400,19 +402,19 @@ private fun CollapsingLayoutTablet(
contentDescription = null
)

Column(modifier = Modifier
.offset {
IntOffset(
x = 0,
y = (backgroundImageHeight.value + expandedTopHeight.value).roundToInt()
)
}
.onSizeChanged { size ->
navigationHeight.value = size.height.toFloat()
}) {
Box(content = upgradeButton)
Box(content = navigation)
}
Box(
modifier = Modifier
.offset {
IntOffset(
x = 0,
y = (backgroundImageHeight.value + expandedTopHeight.value).roundToInt()
)
}
.onSizeChanged { size ->
navigationHeight.value = size.height.toFloat()
},
content = navigation,
)

Box(
modifier = Modifier
Expand Down Expand Up @@ -540,15 +542,15 @@ private fun CollapsingLayoutMobile(
}


Column(modifier = Modifier
.displayCutoutForLandscape()
.offset { IntOffset(x = 0, y = (collapsedTopHeight.value).roundToInt()) }
.onSizeChanged { size ->
navigationHeight.value = size.height.toFloat()
}) {
Box(content = upgradeButton)
Box(content = navigation)
}
Box(
modifier = Modifier
.displayCutoutForLandscape()
.offset { IntOffset(x = 0, y = (collapsedTopHeight.value).roundToInt()) }
.onSizeChanged { size ->
navigationHeight.value = size.height.toFloat()
},
content = navigation,
)

Box(
modifier = Modifier
Expand Down Expand Up @@ -659,7 +661,7 @@ private fun CollapsingLayoutMobile(
)
}

Box(
Column(
modifier = Modifier
.onSizeChanged { size ->
expandedTopHeight.value = size.height.toFloat()
Expand All @@ -670,9 +672,11 @@ private fun CollapsingLayoutMobile(
y = (offset.value + backgroundImageHeight.value - blurImagePaddingPx).roundToInt()
)
}
.alpha(factor),
content = expandedTop,
)
.alpha(factor)
) {
Box(content = expandedTop)
Box(content = upgradeButton)
}

Row(
modifier = Modifier
Expand Down Expand Up @@ -705,19 +709,19 @@ private fun CollapsingLayoutMobile(
}

val adaptiveImagePadding = blurImagePaddingPx * factor
Column(modifier = Modifier
.offset {
IntOffset(
x = 0,
y = (offset.value + backgroundImageHeight.value + expandedTopHeight.value - adaptiveImagePadding).roundToInt()
)
}
.onSizeChanged { size ->
navigationHeight.value = size.height.toFloat()
}) {
Box(content = upgradeButton)
Box(content = navigation)
}
Box(
modifier = Modifier
.offset {
IntOffset(
x = 0,
y = (offset.value + backgroundImageHeight.value + expandedTopHeight.value - adaptiveImagePadding).roundToInt()
)
}
.onSizeChanged { size ->
navigationHeight.value = size.height.toFloat()
},
content = navigation,
)

Box(
modifier = Modifier
Expand Down

0 comments on commit 5ae073e

Please sign in to comment.