Comments (10)
OK, I'll leave this API. That's basically by design.
So stick with the API you are using.
from horologist.
If you want square devices, then you probably want to control everything. A lot of these changes are only with round devices in mind.
So I'll keep that API for you. Hopefully everything else works automatically like RSB even if you control layout manually
from horologist.
Adding in here. #2088
I was tempted to mark this method as deprecated. But if you want to use the default ScalingLazyColumn API and also AppScaffold/ScreenScaffold then it's still useful.
Generally we want to encourage use or rememberResponsiveColumnState(padding)
as it should give a better result across devices and content variants.
from horologist.
I just migrated from Horologist 0.5.6 to 0.5.22 so I also migrated from WearNavScaffold / scrollable to AppScaffold / SwipeDismissableNavHost / composable with columnState.
I'm still using scalingLazyColumnDefaults in two places:
- My media player:
val columnState = rememberColumnState(
factory = ScalingLazyColumnDefaults.scalingLazyColumnDefaults(
initialCenterIndex = 0
)
) - The main screen:
ScalingLazyColumnDefaults.scalingLazyColumnDefaults(
autoCentering = AutoCenteringParams(itemIndex = 0),
initialCenterIndex = 0,
userScrollEnabled = shouldUserScrollBeEnabled,
)
Is the responsive layout able to replicate this behavior?
0.5.22 doesn't seem to have a "rememberResponsiveColumnState" but rememberColumnState takes a factory that defaults to ScalingLazyColumnDefaults.responsive().
from horologist.
0.5.23 has this API. We got internal guidance that we should adjust the padding based on the content.
See here for an example
You can see a diff here using it https://github.com/android/wear-os-samples/pull/1020/files including screenshots
from horologist.
@yschimke I tried it and it no longer centers the contents.
i.e.:
val columnState = rememberColumnState(
factory = ScalingLazyColumnDefaults.scalingLazyColumnDefaults(
initialCenterIndex = 0
)
)
vs
val columnState = rememberResponsiveColumnState()
I tried adjusting verticalAlignment and contentPadding but to no avail. Should I just stay with scalingLazyColumnDefaults for now? If this behavior is not possible with the new APIs, then I would request to please not deprecate the old ones. Thank you.
from horologist.
I also noticed another regression where you can no longer scroll items to the centre of the screen on some lists; I have to investigate this one further.
from horologist.
@yschimke Just for more clarity, what am I missing by not using the rememberResponsiveColumnState() or rememberColumnState() that uses a responsive factory by default? I know the library is in active development but all of the different options are a little overwhelming. Thank you.
from horologist.
I also noticed another regression where you can no longer scroll items to the centre of the screen on some lists; I have to investigate this one further.
There is no guarantee that you can scroll items to the center the screen. If you want that you can use autoCentering. But the new APIs try to achieve the right amount of padding, so content isn't clipped.
You aren't missing anything if you are happy to control the layout how you want.
The aim in general is for APIs that neatly solve two problems
- Most effectively using available space even as the content, device size and font scaling change
- Avoid clipping that might cause play store rejections
The library and API is evolving with updating guidance from UX teams.
It started with
WearNavScaffold + rememberColumnState(Factory) and Factory was belowTimeText()
evolved to
WearNavScaffold + rememberColumnState(Factory) and Factory was responsive()
And now a much nicer IMHO API of
AppScaffold/ScreenScaffold + rememberResponsiveColumnState(... ItemType, ItemType ...)
Unfortunately Horologist will always be experimental as requirements change with the hope to get the right API to migrate to Wear Compose in future.
from horologist.
@yschimke Thanks, this helps a lot. Just as a reference, here's what I see as the bottom-most scroll position with the different options:
This can still be achieved by using val columnState = rememberColumnState(factory = ScalingLazyColumnDefaults.scalingLazyColumnDefaults())
in 0.5.22.
rememberColumnState(factory = ScalingLazyColumnDefaults.belowTimeText())
val columnState = rememberColumnState()
![image](https://private-user-images.githubusercontent.com/2005192/310598116-11d6f19f-49fd-4db5-bf85-8b478b4ad103.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NTA1MzgsIm5iZiI6MTcxOTc1MDIzOCwicGF0aCI6Ii8yMDA1MTkyLzMxMDU5ODExNi0xMWQ2ZjE5Zi00OWZkLTRkYjUtYmY4NS04YjQ3OGI0YWQxMDMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURh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nState = rememberResponsiveColumnState()
![image](https://private-user-images.githubusercontent.com/2005192/310598391-967afa34-df05-404f-bf51-464104f50543.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NTA1MzgsIm5iZiI6MTcxOTc1MDIzOCwicGF0aCI6Ii8yMDA1MTkyLzMxMDU5ODM5MS05NjdhZmEzNC1kZjA1LTQwNGYtYmY1MS00NjQxMDRmNTA1NDMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MzBUMTIyMzU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTk5YTUyZWZlYWQzNzdmMDRkOTZjMDgwYzA0YzEyNTkzZTE0M2M2OWNkNzk3MjA5NDc5ZDIzOWYzM2U4ZWFkYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.xBCOyCEU-R87bbMlwyh5StESAkHeJltm6G-9XRYfKLA)
![image](https://private-user-images.githubusercontent.com/2005192/310598423-dc11b4e2-8697-4795-8165-4a09ac0c646e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NTA1MzgsIm5iZiI6MTcxOTc1MDIzOCwicGF0aCI6Ii8yMDA1MTkyLzMxMDU5ODQyMy1kYzExYjRlMi04Njk3LTQ3OTUtODE2NS00YTA5YWMwYzY0NmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MzBUMTIyMzU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2ZjZTU1ZGMxMTQxN2M4Yjk4MTVjMDdjYzNiYWMyMjBkZTZkOWVlNTUyZWQyZTEwMzhiY2U0M2RiMDE3Nzk5ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.HdAI80-8CBdDXelOv_AKjadA7nbBTrIiT3ymvzK_LAw)
To me, the terminal state of the square scroll does look like a bug but if we can still use val columnState = rememberColumnState(factory = ScalingLazyColumnDefaults.scalingLazyColumnDefaults())
then that's fine.
For rejections due to clipping, we had them due to Dialog
behavior on round devices: https://issuetracker.google.com/issues/310112608
Thanks again for the details, it's much clearer for us now.
from horologist.
Related Issues (20)
- Invalid doc links
- Review pipeline initializations
- Use correct padding for all responsive SLC
- Use Responsive Dialog consistently
- Stop a release off a release branch from generating docs HOT 1
- rotaryWithScroll in Dialogs HOT 4
- Uamp isn't restarting playback after pause and resume HOT 2
- Using rotaryWithScroll and onRotaryInputAccumulatedWithFocus simultaneously HOT 5
- AGP 8.3.0 upgrade is blocked
- Improve Tile tracking initialization HOT 1
- Some datalayer docs out of date HOT 1
- [FR] Expose beyondViewportPageCount to PagerScreen HOT 1
- Some screenshot tests not completing HOT 3
- horologist-datalayer-watch dependencies HOT 6
- Horologist
- Tile "Bitmap.toImageResource()" enforce RGB_565 without possibility to change and keep alpha. HOT 2
- FR: Tiles API for GraphicsLayer
- Create a test to cover edge cases with Scaffold
- android_wear_capabilities and ressource shrinker HOT 1
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 horologist.