do not reset callbacks on onAttachedToWindow; only dismiss if attached; updated gradle files