Browse Source

deleted 'remove button' in detail view and added an action bar with a trash can instead

Daniel Lazar 9 years ago
parent
commit
89a730512d

+ 30 - 10
res/layout/fragment_record_detail.xml

@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_width="match_parent"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="match_parent"
+    >
+<ScrollView android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:id="@+id/scrollView"
             android:fillViewport="true">
@@ -159,14 +162,31 @@
 				android:layout_marginTop="10dp"
 				android:layout_marginBottom="20dp"/>
 
-	</LinearLayout>
-
 
-		<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
-				android:text="@string/delete" android:id="@+id/record_delete_button"
-				android:layout_gravity="center_horizontal" android:layout_weight="0"
-				android:layout_margin="8dp" android:background="@color/holo_red"
-				android:textColor="@android:color/white"/>
+	</LinearLayout>
 
 	</LinearLayout>
-</ScrollView>
+</ScrollView>
+<RelativeLayout
+    style="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"
+    android:orientation="horizontal"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:alpha="0.8"
+    android:id="@+id/linearLayout"
+    android:layout_alignParentBottom="true" android:layout_alignParentLeft="true"
+    android:layout_alignParentStart="true">
+
+    <ImageButton
+        style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:id="@+id/DeleteButton"
+        android:src="@drawable/ic_action_discard"
+        android:layout_gravity="right"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentTop="true"
+        android:layout_toLeftOf="@+id/FilterButton"/>
+
+</RelativeLayout>
+</RelativeLayout>

+ 3 - 2
src/de/tudarmstadt/informatik/hostage/ui/fragment/RecordDetailFragment.java

@@ -15,6 +15,7 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
+import android.widget.ImageButton;
 import android.widget.LinearLayout;
 import android.widget.ScrollView;
 import android.widget.TextView;
@@ -59,7 +60,7 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 	private TextView mRecordDetailsTextBssid;
 	private TextView mRecordDetailsTextRemoteip;
 	private TextView mRecordDetailsTextProtocol;
-	private Button mRecordDeleteButton;
+	private ImageButton mRecordDeleteButton;
 
 	/**
 	 * Sets the record of which the details should be displayed
@@ -134,7 +135,7 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 		mRecordDetailsTextBssid = (TextView) view.findViewById(R.id.record_details_text_bssid);
 		mRecordDetailsTextRemoteip = (TextView) view.findViewById(R.id.record_details_text_remoteip);
 		mRecordDetailsTextProtocol = (TextView) view.findViewById(R.id.record_details_text_protocol);
-		mRecordDeleteButton = (Button) view.findViewById(R.id.record_delete_button);
+		mRecordDeleteButton = (ImageButton) view.findViewById(R.id.DeleteButton);
 	}