Fixed dismissing an activity toast when its activity is not visible

When dismiss was called while another activity was on top (likely also
when user has switched to another app), the toast was not dismissed.
Custom layout, image button and whole toast clickable

Made the code more flexible by adding the support for custom layout,
handling also image button (like the normal button), and adding an option
for making the whole toast clickable (instead of just the button).

Still in principle the desing of the code is constraining flexibility. It
really should allow for Android styling (by default using the app styles).
This change was a minimal change to allow the above with minimal changes to the
interface and following the existing design.
Merge branch 'fixForDismissingWhenInBackground'