I see constructs similar to the following a lot (in android since I do mostly android in Java)
final WindowManager.LayoutParams paramsWM
...
paramsWM.gravity = Gravity.TOP|Gravity.LEFT;
So is it simply taking the bitwise OR of the two values or is there more to this than meets the eye? If it's just the bitwise OR, then in the above I would end up with
//think math, not java for syntax below
paramsWM.gravity = Gravity.TOP|Gravity.LEFT = 48|3=51;
Again, if it's just bitwise, this shortcut is only permissible when I know the recipient (i.e. paramsWM.gravity
) can handle the addition: right? Furthermore, could I equally have written
//this is java again
final WindowManager.LayoutParams paramsWM
...
paramsWM.gravity = Gravity.TOP + Gravity.LEFT;