At the official documentation there is an article of how to create custom dialogs. And there is also a picture of result dialog which have gradient border under it’s title.
When I copy this code to run it on my machine and look at the results I get the dialog without
gradient divider between the dialog’s title and it’s content:

Is this normal behavior and if it is, tell me how can I add divider by myself through the code, or using styles mechanism?
Yes this is a normal behavior for custom dialog. To have the divider below title use something like:
in your custom layout above the layout in which you have the imageview and textview.