I like it more than before, but there are a couple of things which are IMHO a bit ugly. Having a separate class helps avoid duplication of code, but in this specific case the little amount duplicated code is not enough to justify the onVisible variable and the protected beforeOpen() method, which make the code much harder to understand.
Better keep the small code duplication, which is short and simple.
Style issue: I find isUserVisibleApp quite hard to understand without reading the code which assigns to it; maybe "isActiveApplicationVisible" is more clear?
Thanks Łukasz!
I like it more than before, but there are a couple of things which are IMHO a bit ugly. Having a separate class helps avoid duplication of code, but in this specific case the little amount duplicated code is not enough to justify the onVisible variable and the protected beforeOpen() method, which make the code much harder to understand.
Better keep the small code duplication, which is short and simple.
Style issue: I find isUserVisibleApp quite hard to understand without reading the code which assigns to it; maybe "isActiveApplic ationVisible" is more clear?