Comments (7)
Yep, but you would still need to wrap things with HierarchicalFocusCoordinator
, and move between them. I'm not sure we have a pattern for that.
cc @BowerSteve is there a defined pattern for shifting focus between multiple row sized components in Wear Compose?
from horologist.
Yep - not really a Horologist issue, but I can see what you drew that conclusion from the docs.
I'll fix docs next week.
You probably want to use Horologist's onRotaryInputAccumulatedWithFocus, which handles the focus for you.
We could build a wrapper for InlineSlider that does all this for you. Would that work for you?
from horologist.
Hello, thank you for your response and proactivity.
You're right, InlineSlider is a material component and does not have anything to do with Horologist. I think I was just reading about some other rotary input-related issues of Horologist and mixed up the two.
The onRotaryInputAccumulatedWithFocus
modifier accumulates a Float which would somehow need to be tied with the slider value state. For that reason, I'm using the raw onRotaryScrollEvent
.
I increment the slider value when triggered and ignore the scroll value. This feels fine for Galaxy Watch 4 and the Emulator, but may be unusable for other devices.
If there is any built in code support for this, I think it should be part of the Wear material library itself. It is up to you though to judge that.
I think in an ideal scenario, the current InlineSlider should handle rotary input automatically when it gets focused.
from horologist.
PR above is what it would look like for Stepper. Do you need InlineSlider particularly? How are you using it?
from horologist.
I have an InlineSlider acting as a difficulty selector.
I alone wouldn't bother adding the rotary input to it, but my app kept getting rejected at Play Store reviews due to missing rotary input, even though it was present on every scrollable screen. I then tried adding rotary to this screen and the review issue has disappeared, who knows if that was the problem though.
It would be great to have some quick feedback from the reviewers with a screenshot of the problem that they have encountered.
from horologist.
This is tough, I'm not sure we can do this if it's not full screen. If you have two items on this screen that are scrollable, what should it do?
I could make the default scrollable modifiers for InlineSlider, but you'd have to know to use it.
Closing for now, in favour of PR for screen level Stepper, and no obvious fix for InlineSlider.
from horologist.
I thought it could use the focus hierarchy for determining the consumer of the input.
If the InlineSlider is focused -> Scroll the slider
No component focused -> Scroll the list
I don't know how feasible this is though.
from horologist.
Related Issues (20)
- Use correct padding for all responsive SLC
- Use Responsive Dialog consistently HOT 1
- [Feature request] scalingLazyColumnDefaults does not support userScrollEnabled parameter HOT 10
- 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 7
- 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 HOT 1
- Create a test to cover edge cases with Scaffold HOT 1
- android_wear_capabilities and resource shrinker HOT 1
- Add possibility to set `initialCenterItemIndex` when using `rememberResponsiveColumnState`
- Adopt a conventions gradle plugin 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.