Browse Source

fixed simple popup table layout
added new radiobutton icon

Julien Clauter 10 years ago
parent
commit
5da53b4152

BIN
res/drawable-hdpi/rd_btn_off.png


BIN
res/drawable-hdpi/rd_btn_on.png


BIN
res/drawable-mdpi/rd_btn_off.png


BIN
res/drawable-mdpi/rd_btn_on.png


BIN
res/drawable-xhdpi/rd_btn_off.png


BIN
res/drawable-xhdpi/rd_btn_on.png


BIN
res/drawable-xxhdpi/rd_btn_off.png


BIN
res/drawable-xxhdpi/rd_btn_on.png


+ 4 - 2
res/layout/simple_popup_item.xml

@@ -8,7 +8,7 @@
     android:baselineAligned="false">
 
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="fill_parent"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@color/dark_grey"
         android:padding="10dp">
@@ -37,7 +37,9 @@
         android:layout_alignParentEnd="true"
         android:clickable="false"
         android:checked="true"
-        android:enabled="false" />
+        android:enabled="false"
+        android:button="@drawable/rd_btn_off"
+        />
 
     </RelativeLayout>
 </RelativeLayout>

+ 3 - 1
res/layout/simple_popup_table.xml

@@ -4,7 +4,9 @@
     android:orientation="vertical"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    >
+    android:minWidth="230dp"
+    android:alpha="0.5"
+    android:background="@android:color/background_dark">
 
     <TextView
         android:layout_width="match_parent"

+ 2 - 0
res/values/colors.xml

@@ -4,4 +4,6 @@
         <color name="dark_grey">#FF808080</color>
         <color name="holo_red">#FFF44444</color>
         <color name="holo_dark_green">#ff669900</color>
+        <color name="apptheme_color">#33b5e5</color>
+
 </resources>

+ 7 - 2
src/de/tudarmstadt/informatik/hostage/ui2/popup/AbstractPopup.java

@@ -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);
     }