I came across this code inside `AccessibilityEvent...
# android
o
I came across this code inside
AccessibilityEvent
I wonder why the android team choose to represent ints in hexadecimal for static fields. Of course we can’t know why unless we ask the team directly i guess. So, in general, why the use of hexadecimal might be beneficial to represent ints in such case?
a
Its useful if the values are used for a bit mask (everything in powers of 2). For simple cases its obvious like 2, 4, 8, 16, etc but less obvious for higher numbers. The last number in the screenshot would be 262144 and if you add a new one its much easier to just know it should be 0x00080000 without opening a calculator.
☝️ 1
t
it really paid off in Gravity.java where the RTL support was added as a high number flag on top of the existing values