|
@@ -69,8 +69,7 @@ public abstract class AbstractPopup {
|
|
|
this.rootView = (LinearLayout) lInf.inflate(this.getLayoutId(), null);
|
|
|
}
|
|
|
|
|
|
- popupWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
|
|
|
- popupWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
|
|
|
+
|
|
|
popupWindow.setContentView(rootView);
|
|
|
|
|
|
Rect rectagle= new Rect();
|
|
@@ -79,6 +78,7 @@ public abstract class AbstractPopup {
|
|
|
|
|
|
int[] position = new int[2];
|
|
|
view.getLocationOnScreen(position);
|
|
|
+
|
|
|
rootView.measure(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
|
int x = position[0] + (view.getWidth() / 2) - (rootView.getMeasuredWidth() / 2);
|
|
@@ -92,6 +92,11 @@ public abstract class AbstractPopup {
|
|
|
|
|
|
this.configureView(rootView);
|
|
|
|
|
|
+ int smallBottomOffset = 10;
|
|
|
+
|
|
|
+ popupWindow.setWidth(rootView.getMeasuredWidth());
|
|
|
+ popupWindow.setHeight(rootView.getMeasuredHeight() + smallBottomOffset);
|
|
|
+
|
|
|
popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x, y);
|
|
|
}
|
|
|
|