|
@@ -12,6 +12,8 @@ import android.view.WindowManager;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.PopupWindow;
|
|
|
|
|
|
+import de.tudarmstadt.informatik.hostage.R;
|
|
|
+
|
|
|
/**
|
|
|
* Created by Julien on 13.02.14.
|
|
|
*/
|
|
@@ -28,6 +30,7 @@ public abstract class AbstractPopup {
|
|
|
private OnPopupItemClickListener onPopupItemClickListener;
|
|
|
private LinearLayout rootView;
|
|
|
private LayoutInflater lInf;
|
|
|
+ private View lastItemView;
|
|
|
|
|
|
abstract public int getLayoutId();
|
|
|
abstract void configureView(View view);
|
|
@@ -58,6 +61,8 @@ public abstract class AbstractPopup {
|
|
|
}
|
|
|
if (this.rootView != null){
|
|
|
this.getScrollableItemLayout().addView(view);
|
|
|
+ lastItemView = view;
|
|
|
+
|
|
|
//this.rootView.addView(view);
|
|
|
view.setOnTouchListener(new View.OnTouchListener() {
|
|
|
@Override
|
|
@@ -124,7 +129,7 @@ public abstract class AbstractPopup {
|
|
|
x = Math.max(0, x);
|
|
|
x = Math.min(windowWidth - width, x);
|
|
|
|
|
|
- height = windowHeight < height ? windowHeight : height;
|
|
|
+ height = (windowHeight < height ? windowHeight : height) - 10;
|
|
|
|
|
|
y = Math.max(0, y);
|
|
|
y = Math.min(windowHeight - height, y);
|
|
@@ -134,6 +139,15 @@ public abstract class AbstractPopup {
|
|
|
int smallBottomOffset = 45;
|
|
|
this.popupWindow.setWidth(width);
|
|
|
this.popupWindow.setHeight(height);
|
|
|
+
|
|
|
+ if(lastItemView != null){
|
|
|
+ View v = lastItemView.findViewById(R.id.bottom_seperator);
|
|
|
+
|
|
|
+ if(v != null){
|
|
|
+ v.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.popupWindow.showAtLocation(anchorView, Gravity.NO_GRAVITY, x, y-smallBottomOffset);
|
|
|
|
|
|
}
|