Change function name to onVisibleChanged & offVisibleChange.