Comments (3)
Done. For anyone who does not want import constraintlayout-compose, cuz this dependency increases roughly ~110kb to the release build.
BoxWithConstraints(
modifier = modifier
.fillMaxWidth()
) {
val maxHeightFloat = constraints.maxHeight.toFloat()
Row(
modifier = Modifier
.align(if (rightSide) Alignment.TopEnd else Alignment.TopStart)
.graphicsLayer(
translationX = with(LocalDensity.current) { (if (rightSide) displacement.dp else -displacement.dp).toPx() },
translationY = maxHeightFloat * normalizedOffsetPosition
)
) {
// val (box, content) = createRefs()
// if (indicatorContent != null) {
Box(
modifier = Modifier
.alpha(alpha)
// .constrainAs(content) {
// top.linkTo(box.top)
// bottom.linkTo(box.bottom)
// if (rightSide) end.linkTo(box.start)
// else start.linkTo(box.end)
// }
.testTag(TestTagsScrollbar.scrollbarIndicator),
) {
//indicatorContent(firstVisibleItemIndex.value, isSelected)
Text(text = firstVisibleItemIndex.value.toString())
}
// }
Box(
modifier = Modifier
// .align(if (rightSide) Alignment.TopEnd else Alignment.TopStart)
// .graphicsLayer(
// translationX = with(LocalDensity.current) { (if (rightSide) displacement.dp else -displacement.dp).toPx() },
// translationY = maxHeightFloat * normalizedOffsetPosition
// )
.padding(
start = if (rightSide) 0.dp else padding,
end = if (!rightSide) 0.dp else padding,
)
.clip(thumbShape)
.width(thickness)
.fillMaxHeight(normalizedThumbSize)
.alpha(alpha)
.background(if (isSelected) thumbSelectedColor else thumbColor)
// .constrainAs(box) {
// if (rightSide) end.linkTo(parent.end)
// else start.linkTo(parent.start)
// }
.testTag(TestTagsScrollbar.scrollbar)
)
}
from lazycolumnscrollbar.
Will check out
from lazycolumnscrollbar.
The code you provided removes functionality and is a regression. For know I will keep the ConstraintLayout as I don't want to reinvent the functionality it provides for this case.
In case you provide a full working PR without ConstraintLayout I will merge.
from lazycolumnscrollbar.
Related Issues (16)
- [Request] ColumnScrollbar HOT 5
- Weird crash on Column that didn't fill the screen height HOT 2
- Make scrollbar only react to touches on knob HOT 5
- Please Support stickyHeader HOT 1
- version 1.5 build failed HOT 1
- Add compose desktop support HOT 5
- Support ReverseLayout HOT 1
- documentation on usage not 100% correct. HOT 1
- Due to Snapshot issue, the app dies after some time. HOT 5
- Scrollbar is usable in its hidden state HOT 1
- contentPadding support HOT 5
- Horizontal support? HOT 2
- Can't download 2.0.1 HOT 3
- Can we add an option to customise Scrollbar hide animation HOT 5
- Please add some example images HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazycolumnscrollbar.