is it possible to get programmatically which flags are currently active on a Window?
We can enable flags with:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
Does api provides a way to get a list of currently active flags? Thanks
You can use:
int flags = getWindow().getAttributes().flags;
You can see it's used by the Window.setFlags()
implementation:
public void setFlags(int flags, int mask) {
final WindowManager.LayoutParams attrs = getAttributes();
attrs.flags = (attrs.flags&~mask) | (flags&mask);
...
To determine if individual flags are set, you must use bitwise and. For example:
if ((flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) != 0) ...