Browse Source

solved merge conflicts int res/xml/profile_preferences.xml

Alexander Brakowski 10 years ago
parent
commit
81d3c38130

+ 1 - 1
AndroidManifest.xml

@@ -42,7 +42,7 @@
 				android:value="14"/>
 		<meta-data
 				android:name="com.google.android.maps.v2.API_KEY"
-				android:value="AIzaSyCLAiF5Dx6qkDwWUfNnteMcapILmjCbuZ0"/>
+				android:value="AIzaSyCqh4bb4aMzvDcpDfiqHyXoAWFTQ6iNxe8"/>
 		<activity
 				android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
 				android:configChanges="keyboardHidden|orientation|screenSize"

+ 147 - 0
res/layout-land/fragment_statistics.xml

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@android:color/transparent"
+    >
+
+
+
+
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@+id/toolbar_layout"
+        android:paddingLeft="4dp"
+        android:paddingRight="4dp"
+        android:weightSum="2.">
+
+        <RelativeLayout
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:id="@+id/plot_parent_layout"
+            android:layout_weight="0.9">
+
+            <!-- TITLE LAYOUT -->
+            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:orientation="vertical"
+                android:layout_height="40dp"
+                android:layout_width="match_parent"
+                android:id="@+id/title_layout"
+                android:padding="5dp"
+                android:layout_alignParentTop="true"
+                android:layout_alignParentLeft="true"
+                android:layout_alignParentStart="true">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:text="Title"
+                    android:textAlignment="center"
+                    android:id="@+id/title_text_view" />
+            </LinearLayout>
+            <!-- PLOT LAYOUT -->
+            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:orientation="vertical"
+                android:layout_height="match_parent"
+                android:layout_width="match_parent"
+                android:id="@+id/plot_layout"
+                android:padding="2dp"
+                android:layout_below="@+id/title_layout"
+                >
+            </LinearLayout>
+
+        </RelativeLayout>
+
+
+        <!-- LIST LAYOUT -->
+        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_height="match_parent"
+            android:layout_width="match_parent"
+            android:id="@+id/list_parent_layout"
+            android:paddingTop="5dp"
+            android:layout_weight="1.1"
+            >
+
+            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:orientation="horizontal"
+                android:layout_height="30dp"
+                android:layout_width="match_parent"
+                android:id="@+id/table_header_layout"
+                android:weightSum="1"
+                android:paddingLeft="2dp"
+                android:paddingRight="2dp">
+
+                <TextView
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:textAppearance="?android:attr/textAppearanceSmall"
+                    android:text="table header title"
+                    android:id="@+id/table_header_title_textview"
+                    android:gravity="bottom|left"
+                    android:textAlignment="viewStart"
+                    android:paddingLeft="75dp"
+                    android:layout_weight="0.4"
+                    android:textStyle="bold" />
+                <TextView
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:textAppearance="?android:attr/textAppearanceSmall"
+                    android:text="value"
+                    android:id="@+id/table_header_value_textview"
+                    android:textAlignment="viewEnd"
+                    android:layout_weight="0.6"
+                    android:gravity="bottom|right"
+                    android:textStyle="bold" />
+            </LinearLayout>
+            <ListView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_below="@+id/table_header_layout"
+                android:id="@+id/legend_list_view"
+                android:paddingBottom="0dp"
+                android:paddingTop="6dp"
+                />
+
+        </RelativeLayout>
+    </LinearLayout>
+
+
+    <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/toolbar_layout"
+        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/FilterButton"
+            android:src="@drawable/ic_filter"
+            android:visibility="invisible"
+            android:layout_alignParentTop="true"
+            android:layout_toLeftOf="@+id/plot_data_button" />
+
+        <ImageButton
+            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/plot_data_button"
+            android:src="@drawable/ic_sort_by_size"
+            android:layout_gravity="right"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentEnd="true"/>
+
+    </RelativeLayout>
+
+</RelativeLayout>

+ 2 - 2
res/layout/actionbar_donebar.xml

@@ -17,7 +17,7 @@
 				android:src="@drawable/ic_action_cancel"
 				style="@style/DoneBarActionButtonImage"/>
 		<TextView
-				android:text="Discard"
+				android:text="@string/discard"
 				style="@style/DoneBarActionButtonText"/>
 
 	</LinearLayout>
@@ -31,7 +31,7 @@
 				android:src="@drawable/ic_action_done"
 				style="@style/DoneBarActionButtonImage"/>
 		<TextView
-				android:text="Save"
+				android:text="@string/save"
 				style="@style/DoneBarActionButtonText"/>
 
 	</LinearLayout>

+ 2 - 2
res/layout/fragment_about.xml

@@ -40,7 +40,7 @@
 				android:layout_marginLeft="10dp">
 			<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
 					  android:textAppearance="?android:attr/textAppearanceMedium"
-					  android:text="UI developed by"
+					  android:text="@string/ui_dev_by"
 					  android:id="@+id/textView4" android:layout_gravity="center_horizontal|left"
 					  android:singleLine="false" android:autoText="false"
 					  android:layout_marginTop="8dp" android:textStyle="bold"
@@ -82,7 +82,7 @@
 				android:layout_alignParentEnd="true" android:layout_marginRight="10dp">
 			<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
 			          android:textAppearance="?android:attr/textAppearanceMedium"
-			          android:text="Core developed by" android:id="@+id/textView8"
+			          android:text="@string/core_dev_by" android:id="@+id/textView8"
 			          android:singleLine="false"
 			          android:autoText="false" android:layout_marginTop="8dp"
 			          android:textStyle="bold" android:textColor="@android:color/holo_blue_dark"

+ 4 - 4
res/layout/fragment_settings.xml

@@ -12,13 +12,13 @@
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:textAppearance="?android:attr/textAppearanceMedium"
-				android:text="Device rooted"
+				android:text="@string/device_rooted"
 				android:id="@+id/textView" android:textStyle="bold"/>
 		<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:textAppearance="?android:attr/textAppearanceMedium"
-				android:text="Porthack installed"
+				android:text="@string/porthack_installed"
 				android:id="@+id/textView2"
 				android:layout_below="@+id/textView" android:layout_alignParentLeft="true"
 				android:layout_alignParentStart="true" android:textStyle="bold"/>
@@ -26,14 +26,14 @@
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:textAppearance="?android:attr/textAppearanceMedium"
-				android:text="Yes"
+				android:text="@string/yes"
 				android:id="@+id/settings_device_rooted" android:layout_above="@+id/textView2"
 				android:layout_alignParentRight="true" android:layout_alignParentEnd="true"/>
 		<TextView
 				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
 				android:textAppearance="?android:attr/textAppearanceMedium"
-				android:text="Yes"
+				android:text="@string/yes"
 				android:id="@+id/settings_porthack_installed" android:layout_below="@+id/settings_device_rooted"
 				android:layout_alignParentRight="true" android:layout_alignParentEnd="true"/>
 	</RelativeLayout>

+ 42 - 39
res/layout/fragment_statistics.xml

@@ -6,52 +6,61 @@
     android:background="@android:color/transparent"
     >
 
-
-        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-            android:orientation="vertical"
-            android:layout_height="40dp"
-            android:layout_width="match_parent"
-            android:id="@+id/title_layout"
-            android:padding="5dp"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentLeft="true"
-            android:layout_alignParentStart="true">
-
-            <TextView
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:textAppearance="?android:attr/textAppearanceMedium"
-                android:text="Title"
-                android:textAlignment="center"
-                android:id="@+id/title_text_view" />
-        </LinearLayout>
-
-
-
         <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:orientation="vertical"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_above="@+id/toolbar_layout"
-            android:layout_below="@+id/title_layout"
+            android:paddingLeft="4dp"
+            android:paddingRight="4dp"
             android:weightSum="2.">
 
-            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_height="match_parent"
-              android:layout_width="match_parent"
-              android:id="@+id/plot_layout"
-               android:padding="2dp"
-               android:layout_weight="1.1">
-            </LinearLayout>
+            <RelativeLayout
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent"
+                android:id="@+id/plot_parent_layout"
+                android:layout_weight="0.9">
 
+                <!-- TITLE LAYOUT -->
+                <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                    android:orientation="vertical"
+                    android:layout_height="40dp"
+                    android:layout_width="match_parent"
+                    android:id="@+id/title_layout"
+                    android:padding="5dp"
+                    android:layout_alignParentTop="true"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true">
 
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:textAppearance="?android:attr/textAppearanceMedium"
+                        android:text="Title"
+                        android:textAlignment="center"
+                        android:id="@+id/title_text_view" />
+                </LinearLayout>
+                <!-- PLOT LAYOUT -->
+                <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                    android:orientation="vertical"
+                    android:layout_height="match_parent"
+                    android:layout_width="match_parent"
+                    android:id="@+id/plot_layout"
+                    android:padding="2dp"
+                    android:layout_below="@+id/title_layout"
+                    >
+                </LinearLayout>
+
+            </RelativeLayout>
+
+
+            <!-- LIST LAYOUT -->
             <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_height="match_parent"
                 android:layout_width="match_parent"
                 android:id="@+id/list_parent_layout"
                 android:paddingTop="5dp"
-                android:layout_weight="0.9"
+                android:layout_weight="1.1"
                 >
 
                 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@@ -95,13 +104,10 @@
                     />
 
             </RelativeLayout>
-
-
-
-
             </LinearLayout>
 
 
+    <!-- TOOLBAR LAYOUT -->
     <RelativeLayout
         style="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"
         android:orientation="horizontal"
@@ -136,7 +142,4 @@
 
     </RelativeLayout>
 
-
-
-
 </RelativeLayout>

+ 2 - 2
res/layout/plot_list_item.xml

@@ -27,7 +27,7 @@
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:text="title"
         android:id="@+id/title_text_view"
-        android:layout_weight="2"
+        android:layout_weight="3"
         android:paddingLeft="5dp"
         android:paddingRight="5dp"
         android:textColor="#000000" />
@@ -40,7 +40,7 @@
         android:id="@+id/value_text_view"
         android:textAlignment="textEnd"
         android:gravity="right"
-        android:layout_weight="4"
+        android:layout_weight="3"
         android:textColor="#000000" />
     </LinearLayout>
 </LinearLayout>

+ 2 - 1
res/layout/services_list_item.xml

@@ -43,13 +43,14 @@
                 android:textSize="12dp"/>
         <TextView
                 android:id="@+id/services_item_rec_attacks"
+                android:layout_toRightOf="@id/services_item_text"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentEnd="true"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentRight="false"
-                android:layout_marginLeft="150dp"
                 android:layout_marginTop="25dp"
+                android:layout_marginLeft="150dp"
                 android:layout_weight="1"
                 android:text="20"
                 android:textStyle="bold"

+ 19 - 0
res/values-de/strings.xml

@@ -78,4 +78,23 @@
     <string name="recorded_attacks">Angriffe: </string>
     <string name="current_connection">aktuelle Verbindung</string>
     <string name="monitor_services">Überwache Dienste</string>
+
+    <string name="device_rooted">Gerät gerooted</string>
+    <string name="porthack_installed">Porthack installiert</string>
+    <string name="yes">Ja</string>
+    <string name="no">Nein</string>
+
+    <string name="ui_dev_by">UI Entwicklung</string>
+    <string name="core_dev_by">Core Entwicklung</string>
+    <string name="advanced_settings">Erweiterte Einstellungen</string>
+    <string name="change_name_of_profile">Ändere den Namen des Profils</string>
+    <string name="change_desc_of_profile">Ändere die Beschreibung des Profils</string>
+    <string name="change_icon_of_profile">Wähle ein Icon für das Profil</string>
+    <string name="profile_description">Beschreibung</string>
+    <string name="general">Allgemein</string>
+    <string name="select_icon">Wähle Icon</string>
+    <string name="delete_profile">Profil löschen</string>
+    <string name="really_want_delete_profiel">Willst du dieses Profil wirklich löschen?</string>
+    <string name="discard">Verwerfen</string>
+    <string name="save">Speichern</string>
 </resources>

+ 34 - 0
res/values-de/strings_preferences.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="settings">Einstellungen</string>
+    <string name="export_to_location">Exportiere auf externen Speicher</string>
+    <string name="pref_alarm">Tonauswahl</string>
+    <string name="pref_alarm_default">VIBRATION</string>
+    <string name="pref_alarm_summ">Wähle einen Benachrichtigunston</string>
+    <string name="pref_storage">Externes Sichern</string>
+    <string name="pref_external_storage_title">Externes Sichern</string>
+    <string name="pref_external_storage_summ">Exportiere Log File auf SD-Karte</string>
+    <string name="pref_external_location_title">Anderer Ort</string>
+    <string name="pref_notification">Benachrichtigung</string>
+    <string name="pref_vibration">Vibration</string>
+    <string name="pref_vibration_summ">Aktiviere Vibration</string>
+    <string name="pref_upload">Upload von Aufzeichnungen</string>
+    <string name="pref_upload_server">Server</string>
+    <string name="pref_connection_settings">Verbindungs Einstellungen</string>
+    <string name="pref_max_connections">Max Verbindungen</string>
+    <string name="pref_max_connections_default">5</string>
+    <string name="pref_timeout">Socket Timeout</string>
+    <string name="pref_timeout_summary">Socket timeout in Sekunden</string>
+    <string name="pref_timeout_default">30</string>
+    <string name="pref_sleeptime">Stream sleep time</string>
+    <string name="pref_sleeptime_summary">Zeit in ms für stream sleep time</string>
+    <string name="pref_sleeptime_default">500</string>
+    <string name="pref_location_settings">Location Einstellungen</string>
+    <string name="pref_location_time">Location Data Timeout</string>
+    <string name="pref_location_time_summary">Timeout nach location data Anfrage in ms</string>
+    <string name="pref_location_time_default">60000</string>
+    <string name="pref_location_retries">Retries</string>
+    <string name="pref_location_retries_default">3</string>
+
+</resources>

+ 18 - 0
res/values/strings.xml

@@ -78,4 +78,22 @@
     <string name="recorded_attacks">recorded attacks: </string>
     <string name="current_connection">Current connection</string>
     <string name="monitor_services">Monitor services</string>
+
+    <string name="device_rooted">Device rooted</string>
+    <string name="porthack_installed">Porthack installed</string>
+    <string name="yes">Yes</string>
+    <string name="no">No</string>
+
+    <string name="ui_dev_by">UI developed by</string>
+    <string name="core_dev_by">Core developed by</string>
+    <string name="advanced_settings">Advanced Settings</string>
+    <string name="change_name_of_profile">Change the name of this profile</string>
+    <string name="change_desc_of_profile">Change the description of this profile here</string>
+    <string name="change_icon_of_profile">Choose an icon for this profile</string>
+    <string name="general">General</string>
+    <string name="profile_description">Description</string>
+    <string name="select_icon">Select Icon</string>
+    <string name="delete_profile">Delete profile</string>
+    <string name="discard">Discard</string>
+    <string name="save">Save</string>
 </resources>

+ 1 - 0
res/values/strings_preferences.xml

@@ -2,6 +2,7 @@
 <resources>
 
 	<string name="settings">Settings</string>
+    <string name="export_to_location">Export to external location</string>
 	<string name="pref_alarm">Set Sound</string>
 	<string name="pref_alarm_default">VIBRATION</string>
 	<string name="pref_alarm_summ">Select Notification Sound</string>

+ 6 - 7
res/xml/profile_preferences.xml

@@ -1,21 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-	<PreferenceCategory android:title="General"
+	<PreferenceCategory android:title="@string/general"
 	                    android:key="pref_profile_general_settings">
 		<EditTextPreference android:key="pref_profile_general_name"
 		                    android:title="Name"
-		                    android:summary="Change the name of this profile"
+		                    android:summary="@string/change_name_of_profile"
 		                    android:defaultValue=""/>
 
 		<EditTextPreference android:key="pref_profile_general_description"
-		                    android:title="Description"
-		                    android:summary="Change the description of this profile here"
+		                    android:title="@string/profile_description"
+		                    android:summary="@string/change_desc_of_profile"
 		                    android:defaultValue="" />
 
 		<Preference android:key="pref_profile_general_image"
 		            android:title="Icon"
-		            android:summary="Choose an icon for this profile" />
-
+		            android:summary="@string/change_icon_of_profile" />
 	</PreferenceCategory>
-</PreferenceScreen>
+</PreferenceScreen>

+ 3 - 3
res/xml/settings_preferences.xml

@@ -17,10 +17,10 @@
 				android:title="@string/pref_alarm" />
 	</PreferenceCategory>
 
-	<PreferenceCategory android:title="Advanced Settings">
+	<PreferenceCategory android:title="@string/advanced_settings">
 		<PreferenceScreen
 				android:key="pref_advanced settings"
-				android:title="Advanced Settings"
+				android:title="@string/advanced_settings"
 				android:persistent="false">
 			<PreferenceCategory android:title="@string/pref_storage" >
 				<CheckBoxPreference
@@ -39,7 +39,7 @@
 				<Preference
 						android:key="pref_external_export"
 						android:dependency="pref_external_storage"
-				        android:title="Export to external location"
+				        android:title="@string/export_to_location"
 				        />
 
 			</PreferenceCategory>

+ 11 - 0
src/com/echo/holographlibrary/BarGraph.java

@@ -203,6 +203,16 @@ public class BarGraph extends View {
         this.popupImageID = id;
     }
 
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        super.onLayout(changed, l, t, r, b);
+        if(mFullImage != null)
+            mFullImage = null;
+        postInvalidate();
+    }
+
+
     @Override
     public boolean onTouchEvent(MotionEvent event) {
 
@@ -245,6 +255,7 @@ public class BarGraph extends View {
     		mFullImage.recycle();
     	
     	super.onDetachedFromWindow();
+        postInvalidate();
     }
     
     public void setOnBarClickedListener(OnBarClickedListener listener) {

+ 27 - 2
src/com/echo/holographlibrary/LineGraph.java

@@ -655,8 +655,33 @@ public class LineGraph extends View {
 
 	    return true;
 	}
-	
-	public void setOnPointClickedListener(OnPointClickedListener listener) {
+
+    @Override
+    protected void onDetachedFromWindow()
+    {
+        if(fullImage != null)
+            fullImage.recycle();
+
+        super.onDetachedFromWindow();
+        //postInvalidate();
+    }
+
+    @Override
+    protected void onSizeChanged (int w, int h, int oldw, int oldh){
+        super.onSizeChanged(w,h,oldw,oldh);
+        //postInvalidate();
+    }
+
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        super.onLayout(changed, l, t, r, b);
+        if(fullImage != null)
+            fullImage = null;
+        postInvalidate();
+    }
+
+    public void setOnPointClickedListener(OnPointClickedListener listener) {
 		this.listener = listener;
 	}
 	

+ 4 - 4
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ProfileManagerListAdapter.java

@@ -102,15 +102,15 @@ public class ProfileManagerListAdapter extends ArrayAdapter<Profile> {
 			@Override
 			public void onClick(View v) {
 				new AlertDialog.Builder(context)
-						.setTitle("Delete profile")
-						.setMessage("Do you really want to delete this profile?")
-						.setNegativeButton("No", new DialogInterface.OnClickListener() {
+						.setTitle(R.string.delete_profile)
+						.setMessage(R.string.really_want_delete_profiel)
+						.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
 							@Override
 							public void onClick(DialogInterface dialog, int which) {
 
 							}
 						})
-						.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+						.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
 							public void onClick(DialogInterface dialog, int which) {
 								ProfileManager profileManager = ProfileManager.getInstance();
 

+ 4 - 2
src/de/tudarmstadt/informatik/hostage/ui2/dialog/ChecklistDialog.java

@@ -95,11 +95,13 @@ public class ChecklistDialog extends DialogFragment {
     	for(Integer i : this.mSelectedItems){
     		list.add(this.itemTitles.get(i.intValue()));
     	}
-        if (this.mSelectedItems.size() == 0){
+        if (this.mSelectedItems.size() == 0 && !this.isMultipleChoice){
             list.add(this.itemTitles.get(this.selectedIndex));
-        }
+       }
     	return list;
     }
+
+
 	
 	@Override
 	public Dialog onCreateDialog(Bundle savedInstanceState) {

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ProfileEditFragment.java

@@ -129,7 +129,7 @@ public class ProfileEditFragment extends PreferenceFragment implements
 						intent.setType("image/*");
 						intent.setAction(Intent.ACTION_GET_CONTENT);
 						int PICK_IMAGE = 1;
-						startActivityForResult(Intent.createChooser(intent, "Select Icon"), PICK_IMAGE);
+						startActivityForResult(Intent.createChooser(intent, getString(R.string.select_icon)), PICK_IMAGE);
 						return true;
 					}
 				}

+ 4 - 4
src/de/tudarmstadt/informatik/hostage/ui2/fragment/SettingsFragment.java

@@ -25,18 +25,18 @@ public class SettingsFragment extends Fragment {
 		TextView porthackText = (TextView) v.findViewById(R.id.settings_porthack_installed);
 
 		if(MainActivity.isRooted){
-			rootedText.setText("Yes");
+			rootedText.setText(R.string.yes);
 			rootedText.setTextColor(getResources().getColor(R.color.holo_dark_green));
 		} else {
-			rootedText.setText("No");
+			rootedText.setText(R.string.no);
 			rootedText.setTextColor(getResources().getColor(R.color.holo_red));
 		}
 
 		if(MainActivity.porthackInstalled){
-			porthackText.setText("Yes");
+			porthackText.setText(R.string.yes);
 			porthackText.setTextColor(getResources().getColor(R.color.holo_dark_green));
 		} else {
-			porthackText.setText("No");
+			porthackText.setText(R.string.no);
 			porthackText.setTextColor(getResources().getColor(R.color.holo_red));
 		}
 

+ 42 - 27
src/de/tudarmstadt/informatik/hostage/ui2/fragment/StatisticsFragment.java

@@ -6,6 +6,7 @@ import android.app.FragmentManager;
 import android.app.FragmentTransaction;
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.Configuration;
 import android.graphics.Color;
 import android.os.Bundle;
 import android.view.LayoutInflater;
@@ -147,12 +148,6 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
 
     }
 
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setHasOptionsMenu(true);
-    }
-
     private ImageButton getFilterButton(){
         return (ImageButton) this.rootView.findViewById(R.id.FilterButton);
     }
@@ -175,7 +170,6 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         if (this.filter == null){
             Intent intent = this.getActivity().getIntent();
             LogFilter filter = intent.getParcelableExtra(LogFilter.LOG_FILTER_INTENT_KEY);
-
             if(filter == null){
                 this.clearFilter();
             } else {
@@ -183,28 +177,32 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
             }
         }
 
-        View rootView = inflater.inflate(this.getLayoutID(), container, false);
+        this.rootView = inflater.inflate(this.getLayoutID(), container, false);
 
-        LinearLayout plotLayout = (LinearLayout) rootView.findViewById(R.id.plot_layout);
-        plotLayout.setWillNotDraw(false);
+        this.configureRootView(this.rootView);
 
-        container.setWillNotDraw(false);
+        return this.rootView;
+    }
 
-        this.legendListView = (ListView) rootView.findViewById(R.id.legend_list_view);
-        this.legendListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
-                StatisticsFragment.this.userTappedOnLegendItem(i);
-            }
-        });
-        this.rootView = rootView;
-        rootView.setWillNotDraw(false);
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setHasOptionsMenu(true);
+        setRetainInstance(true);
+    }
 
-        this.configureRootView(rootView);
+    @Override
+    public void onConfigurationChanged(Configuration newConfig){
+        super.onConfigurationChanged(newConfig);
+        LayoutInflater inflater = LayoutInflater.from(getActivity());
 
-        return rootView;
-    }
+        ViewGroup container = (ViewGroup) this.getView();
+        container.removeAllViewsInLayout();
+        this.rootView = inflater.inflate(this.getLayoutID(), container, false);
+        container.addView(this.rootView);
 
+        this.configureRootView(this.rootView);
+    }
 
     private Context getBaseContext(){
         return this.getActivity().getBaseContext();
@@ -217,9 +215,19 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
     public void configureRootView(View rootView){
         LinearLayout plotLayout = (LinearLayout) rootView.findViewById(R.id.plot_layout);
         plotLayout.setWillNotDraw(false);
-
         plotLayout.removeAllViews();
 
+        plotLayout.setWillNotDraw(false);
+
+        this.legendListView = (ListView) rootView.findViewById(R.id.legend_list_view);
+        this.legendListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+                StatisticsFragment.this.userTappedOnLegendItem(i);
+            }
+        });
+        rootView.setWillNotDraw(false);
+
         this.actualiseCurrentPlot();
 
         ImageButton visualButton = (ImageButton) rootView.findViewById(R.id.plot_data_button);
@@ -443,12 +451,18 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
         ArrayList<String> titles =dialog.getSelectedItemTitles();
 
         if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
-            this.filter.setProtocols(titles.size() == 0 ? this.protocolTitles() : titles);
+            //titles = titles.size() == 0 ? this.protocolTitles() : titles;
+            this.filter.setProtocols(titles);
             this.actualiseCurrentPlot();
             return;
         }
         if (title.equals(FILTER_MENU_PROTOCOL_SINGLE_CHOICE_TITLE)){
+            if (titles.size() == 0){
+                titles = new ArrayList<String>();
+                titles.add(this.protocolTitles().get(0));
+            }
             this.filter.setProtocols(titles);
+
             this.actualiseCurrentPlot();
             String fragTitle = "" + this.getCurrentSelectedProtocol() + ": " + this.selectedCompareData;
             this.setTitle(fragTitle);
@@ -599,7 +613,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
             titles.add(FILTER_MENU_TITLE_ESSID);
             titles.add(FILTER_MENU_TITLE_PROTOCOLS);
             titles.add(FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
-            if (this.filter.hasESSIDs() || this.filter.hasATimestamp()){
+            if (this.filter.hasESSIDs() || this.filter.hasATimestamp() || (this.filter.getProtocols() != null  && this.filter.hasProtocols() && this.filter.getProtocols().size() != this.protocolTitles().size())){
                 titles.add(FILTER_MENU_TITLE_REMOVE);
             }
         } else {
@@ -755,6 +769,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
             this.lineGraph = new LineGraph(this.getActivity());
             LinearLayout plotLayout = (LinearLayout) this.rootView.findViewById(R.id.plot_layout);
             plotLayout.addView(this.lineGraph);
+            this.lineGraph.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT ));
         }
         return this.lineGraph;
     }
@@ -1294,7 +1309,7 @@ public class StatisticsFragment extends Fragment implements ChecklistDialog.Chec
             return this.filter.hasESSIDs();
         }
         if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
-            return this.filter.hasProtocols();
+            return (this.filter.getProtocols() != null  && this.filter.hasProtocols() && this.filter.getProtocols().size() != this.protocolTitles().size());
         }
         if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)){
             return this.filter.hasBelowTimestamp();

+ 12 - 6
src/de/tudarmstadt/informatik/hostage/ui2/popup/AbstractPopup.java

@@ -3,7 +3,6 @@ package de.tudarmstadt.informatik.hostage.ui2.popup;
 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Rect;
-import android.util.DisplayMetrics;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -13,13 +12,13 @@ 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.
  */
 public abstract class AbstractPopup {
 
+    static final int ORIENTATION_LANDSCAPE = 2;
+
     public interface OnPopupItemClickListener {
         public void onItemClick(Object data);
     }
@@ -88,8 +87,12 @@ public abstract class AbstractPopup {
             this.popupWindow.setContentView(this.rootView);
 
             final Rect windowFrame= new Rect();
+
             Window window = this.context.getWindow();
             window.getDecorView().getWindowVisibleDisplayFrame(windowFrame);
+            int orientation = 1; //this.context.getResources().getConfiguration().orientation;
+            int windowWidth = orientation == ORIENTATION_LANDSCAPE ? windowFrame.height() : windowFrame.width();
+            int windowHeight = orientation == ORIENTATION_LANDSCAPE ? windowFrame.width() : windowFrame.height();
 
             final int[] position = new int[2];
             anchorView.getLocationOnScreen(position);
@@ -99,14 +102,17 @@ public abstract class AbstractPopup {
             int width = this.rootView.getMeasuredWidth();
             int height = this.rootView.getMeasuredHeight();
 
+            //int alh = (position[0] + width) - windowFrame.width();
+            //if (alh < 0) alh = 0;
+
             int x = position[0] + (anchorWidth / 2) - (width / 2);
             int y = position[1] - height;
 
-            x = Math.min(0,x);
-            x = Math.max(windowFrame.width() - width, x);
+            x = Math.max(0, x);
+            x = Math.min(windowWidth - width, x);
 
             y = Math.min(0,y);
-            y = Math.max(windowFrame.height() - height, y);
+            y = Math.max(windowHeight - height, y);
 
             AbstractPopup.this.configureView(this.rootView);