Method getScaledScrollFactor
in the android.support.wearable.input.RotaryEncoder
class is now deprecated, but there is no explanation of what should be used instead.
Asked
Active
Viewed 255 times
1

Vladimir Jovanović
- 2,261
- 2
- 24
- 43
2 Answers
3
From the official documentation:
getScaledScrollFactor(Context context) This method is deprecated. use either getScaledVerticalScrollFactor(ViewConfiguration, Context) or getScaledHorizontalScrollFactor(ViewConfiguration, Context) instead

TofferJ
- 4,678
- 1
- 37
- 49
1
Now that RotaryEncoder
is completely deprecated, its methods should be replaced with methods from com.google.android.wearable.input.RotaryEncoderHelper
.

Vladimir Jovanović
- 2,261
- 2
- 24
- 43
-
When I use Ctrl+B in Android Studio to look at the decompiled class RotaryEncoderHelper, its static methods all just throw RuntimeException("Stub!") when called. So the code will compile, but it will not work. – HendrikFrans Jun 07 '22 at 12:41
-
1@HendrikFrans It will work. This happens because the implementation is provided by Android and is available at runtime but not at compile time. You can find more info here: https://stackoverflow.com/a/70512534/5821000 and here: https://stackoverflow.com/a/39913711/5821000 – Vladimir Jovanović Jun 11 '22 at 10:16
-
1I stand corrected, thank you. I always download the sources for the SDK, so I am not used to seeing such stubs. The lack of implementation code for RotaryEncoderHelper presumably has to do with Wear OS / wearable code not all being open source like that of its Android basis. – HendrikFrans Jun 13 '22 at 07:23