There are posts related to elevation for views for pre-lollipop devices. I applied techniques that could be applied to the dialog but I still can not have elevation/shadow to my dialog.
I tried this in the style but it did not work.
<item name="android:background">@android:drawable/dialog_holo_light_frame</item>
ViewCompat.setElevation() and View.setOutLineProvider() methods are available from Lollipop. So can not use them.
I am not able to add the screeshots here for unknown reason. But the dialog is flat on KK and is elevated and look nice on Lollipop.
This is how I created dialog:
AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.AlertDialogStyle));
Dialog dialog = builder.create();
And AlertDialogStyle is just this:
<style name="AlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
</style>
Can you help me with any clue on how can I add elevation to dialog on pre-lollipop or pre-21 devices ?