[Fixed] Reverse scrolling setting is reversed

If useTouchpadNaturalScrolling is false, "Reverse scrolling" should be on.

[The API value]
useTouchpadNaturalScrolling: false

[The expected UX behavior]
Reverse scrolling: on
fingers upward, scroll up, content moves down

The description of "useTouchpadNaturalScrolling":
Returns true if moving two fingers upwards on the touchpad should scroll down, which is known as natural scrolling.

The description of "Reverse scrolling":
Content moves up when you scroll down.

Bug: 280047007
Test: manual and passed atest TrackpadReverseScrollingPreferenceControllerTest
Change-Id: Ia5e30fa14b599ddcffae99005114f10412ccad3c
This commit is contained in:
danielwbhuang
2023-05-03 23:59:55 +08:00
parent 2b44fc26d1
commit 0b79c92348
2 changed files with 20 additions and 20 deletions

View File

@@ -30,12 +30,12 @@ public class TrackpadReverseScrollingPreferenceController extends TogglePreferen
@Override
public boolean isChecked() {
return InputSettings.useTouchpadNaturalScrolling(mContext);
return !InputSettings.useTouchpadNaturalScrolling(mContext);
}
@Override
public boolean setChecked(boolean isChecked) {
InputSettings.setTouchpadNaturalScrolling(mContext, isChecked);
InputSettings.setTouchpadNaturalScrolling(mContext, !isChecked);
return true;
}