Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c5766da6 authored by Yeabkal Wubshit's avatar Yeabkal Wubshit
Browse files

Create InputDevice ViewBehavior

ViewBehavior will be a static inner class for InputDevice, providing
View-related behaviors pertaining to an InputDevice. We have added an
API in InputDevice to return its ViewBehavior.

This will be helpful if different InputDevice properties affect the way
an input- generated MotionEvent should be handled by a View. For
example, we have implemented a "shouldSmoothScroll" API in this change.
This API is to tell Views processing motions generated by the
InputDevice to prefer animating scrolls caused by such motions, to
deliver a better quality scrolling UX than compared to a regular scroll
that jumps by X pixels in a single frame.

Note that, a single ViewBehavior instance contains all behaviors for a
single InputDevice. This is unlike the other inner static class of
InputDevice: MotionRange. This decision of making a single ViewBehavior
contain all behaviors is made because not all View behaviors may depend
on source+axis (e.g. there could be a behavior that is globally
applicable to the whole InputDevice).

Bug: 246946631
Test: unit tests, manual
Change-Id: I65cf7d6556e26d199c9021f53bdae183f21d3c6d
parent 04d99941
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment