Git Product home page Git Product logo

Comments (7)

yschimke avatar yschimke commented on June 12, 2024 1

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.

yschimke avatar yschimke commented on June 12, 2024

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.

cvb941 avatar cvb941 commented on June 12, 2024

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.

yschimke avatar yschimke commented on June 12, 2024

PR above is what it would look like for Stepper. Do you need InlineSlider particularly? How are you using it?

from horologist.

cvb941 avatar cvb941 commented on June 12, 2024

image

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.

yschimke avatar yschimke commented on June 12, 2024

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.

cvb941 avatar cvb941 commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.