Comments (10)
A quick test of 1, are you able to add this in and test on that device?
After adding this in, I no longer get any haptic feedback at all even though it is enabled on the Galaxy Watch 4 with Wear OS 4 I'm using.
from horologist.
We returned Samsung haptics to its original state, so it should be working as before - haptics setting shouldn't influence compose haptics on GW devices
from horologist.
Thanks for the report. We can add specific haptics but we would need to know which ones are preferred. I'll see if it's doing something stupid and using the ones for a different model.
Is there documentation for this setting? Or it's a standard wear one?
from horologist.
I can confirm the same 'issue' exists on a Samsung Galaxy Watch 4 with the touch bezel (= rotary input on this device). In the system settings app > General > Touch bezel, there is an option "Vibration feedback". Sounds like it is kind of standard Wear but depends on the device what it's called and where it is located.
Turning it off doesn't change the behavior of apps using the rotaryWithScroll
modifier, while other apps that (presumably) use a classic ScrollView do change and stop vibrating when rotating. Easy to spot as thin vs thick scroll bar.
from horologist.
Thanks for the report. We can add specific haptics but we would need to know which ones are preferred. I'll see if it's doing something stupid and using the ones for a different model.
Is there documentation for this setting? Or it's a standard wear one?
Specific or not the existing one is overly aggressive and should be toned down. Best course of action would be to use the same one used in all the standard apps
The setting also exists on the Pixel Watch as "Using crown" - https://www.verizon.com/support/knowledge-base-303381/
from horologist.
So I think we need to do one of two things
- Find the relevant haptics code for this device, or hopefully class of devices.
- Fallback to reading the setting, possibly
Settings.Global.getInt(context.contentResolver, "wear_vibrate_for_rotary_input")
It's possible neither are public APIs.
A quick test of 1, are you able to add this in and test on that device?
public class LikePixelWatchRotaryHapticFeedback(private val view: View) : RotaryHapticFeedback {
@ExperimentalHorologistApi
override fun performHapticFeedback(
type: RotaryHapticsType,
) {
when (type) {
RotaryHapticsType.ScrollItemFocus -> {
view.performHapticFeedback(
if (Build.VERSION.SDK_INT >= 33) {
ROTARY_SCROLL_ITEM_FOCUS
} else {
WEAR_SCROLL_ITEM_FOCUS
},
)
}
RotaryHapticsType.ScrollTick -> {
view.performHapticFeedback(
if (Build.VERSION.SDK_INT >= 33) ROTARY_SCROLL_TICK else WEAR_SCROLL_TICK,
)
}
RotaryHapticsType.ScrollLimit -> {
view.performHapticFeedback(
if (Build.VERSION.SDK_INT >= 33) ROTARY_SCROLL_LIMIT else WEAR_SCROLL_LIMIT,
)
}
}
}
private companion object {
// Hidden constants from HapticFeedbackConstants.java specific for Pixel Watch
// API 33
public const val ROTARY_SCROLL_TICK: Int = 18
public const val ROTARY_SCROLL_ITEM_FOCUS: Int = 19
public const val ROTARY_SCROLL_LIMIT: Int = 20
// API 30
public const val WEAR_SCROLL_TICK: Int = 10002
public const val WEAR_SCROLL_ITEM_FOCUS: Int = 10003
public const val WEAR_SCROLL_LIMIT: Int = 10003
}
}
you would pass it into
public fun rememberRotaryHapticHandler(
scrollableState: ScrollableState,
throttleThresholdMs: Long = 30,
hapticsThresholdPx: Long = 50,
hapticsChannel: Channel<RotaryHapticsType> = rememberHapticChannel(),
rotaryHaptics: RotaryHapticFeedback = rememberDefaultRotaryHapticFeedback(),
): RotaryHapticHandler {
And then that into the scroll modifiers
public fun Modifier.rotaryWithScroll(
scrollableState: ScrollableState,
focusRequester: FocusRequester = rememberActiveFocusRequester(),
flingBehavior: FlingBehavior? = ScrollableDefaults.flingBehavior(),
rotaryHaptics: RotaryHapticHandler = rememberRotaryHapticHandler(scrollableState),
reverseDirection: Boolean = false,
): Modifier = rotaryHandler(
from horologist.
I think we would stick with the current Samsung code. But mainly interested in devices other than pixel or Samsung.
Is the current published code not working for Samsung for you.
from horologist.
I created a prototype branch which should use device specific haptics based on the Wear version rather than specific device.
Change: 40a7940
Branch: https://github.com/google/horologist/tree/version_specific_rotary_haptics_16.10
Please test this solution and see whether it solves your problem @blakadder @jpelgrom .
Unfortunately I don't have a lot of devices at hand for testing so would be great to test that before submitting.
from horologist.
Sorry for the delay, I see the change was already merged. I only have a Galaxy Watch 4 to test which is using the same haptics settings as with <= 0.5.8 so nothing to test for me.
from horologist.
Released with 0.4.16. If still happening, raise an issue with specific device details, but should be fixed.
from horologist.
Related Issues (20)
- Chip doesn't set onClick label
- AmbientAware composable unnecessarily recreates the whole tree HOT 2
- Horologist media router usage HOT 1
- Compose-Layout transitive dep on compose-navigation HOT 4
- Improve tracking Tile installation HOT 2
- Invalid doc links
- Review pipeline initializations
- Use correct padding for all responsive SLC
- Use Responsive Dialog consistently
- [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 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
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.