Browse Source

changed resources files and adapter for services view

Daniel Lazar 10 years ago
parent
commit
1f8be48d16

+ 2 - 17
res/layout/services_list_item.xml

@@ -29,32 +29,17 @@
                 android:textStyle="bold"
                 android:textSize="16dp"/>
         <TextView
-                android:id="@+id/services_item_text"
+                android:id="@+id/services_item_rec_attacks"
                 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="50dp"
                 android:layout_marginTop="25dp"
                 android:layout_weight="1"
                 android:text="@string/recorded_attacks"
                 android:textStyle="bold"
                 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_marginTop="25dp"
-                android:layout_marginLeft="150dp"
-                android:layout_weight="1"
-                android:text="20"
-                android:textStyle="bold"
-                android:textSize="12dp"/>
+
         <Switch
                 android:id="@+id/services_item_switch"
                 android:layout_width="wrap_content"

+ 2 - 1
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ServicesListAdapter.java

@@ -19,6 +19,7 @@ import java.util.List;
 import de.tudarmstadt.informatik.hostage.R;
 import de.tudarmstadt.informatik.hostage.commons.HelperUtils;
 import de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity;
+import de.tudarmstadt.informatik.hostage.ui2.fragment.ServicesFragment;
 import de.tudarmstadt.informatik.hostage.ui2.model.ServicesListItem;
 
 /**
@@ -145,7 +146,7 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
 			holder.activated.setChecked(false);
 			setBackground(holder, R.drawable.services_circle);
 		}
-		holder.recordedAttacks.setText(item.attacks);
+		holder.recordedAttacks.setText(String.format(MainActivity.getContext().getResources().getString(R.string.recorded_attacks) + "  %d", Integer.valueOf(item.attacks)));
 	}
 
 	private void setBackground(ViewHolder holder, int drawable){