I have some issue with bottom margin on different devices. How to get same bottom margin for devices with/without on-screen buttons?
Implementation of PopupWindow:
DisplayMetrics dm = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
int height = dm.heightPixels;
View viewGroup= activity.getLayoutInflater().inflate(R.layout.my_dialog, null, false);
popupWindow = new PopupWindow(viewGroup, width, height);
Nexus 6
Samsung 5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#AA000000"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:background="#fff"
android:layout_weight="1">
...
</LinearLayout>
</LinearLayout>