]> Johnzone git - dienst_android.git/commitdiff
fixed layout and implemented times for glue dienst
authorJohn Janus <john.janus@haw-hamburg.de>
Sat, 6 Apr 2013 22:12:21 +0000 (00:12 +0200)
committerJohn Janus <john.janus@haw-hamburg.de>
Sat, 6 Apr 2013 22:12:21 +0000 (00:12 +0200)
res/layout/activity_main.xml
res/values/strings.xml
src/de/rhinapotheke/notdienst/MainActivity.java

index 50ceb5d2e2ce5c3562908e73186fa91c9e29d2ad..463374c810a4d55dc60282d73cbc4d4119747502 100644 (file)
 
     <ScrollView
         android:id="@+id/scrollView1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" >
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent" >
 
         <LinearLayout
-            android:layout_width="290dp"
-            android:layout_height="422dp"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
             android:orientation="vertical" >
 
             <LinearLayout
@@ -34,7 +34,6 @@
                     android:id="@+id/changeDate"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="default"
                     android:onClick="chooseDate" />
 
                 <Button
             </LinearLayout>
 
             <TextView
-                android:id="@+id/textView1"
+                android:id="@+id/text_gl"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="@string/glue"
+                android:text="@string/glue_week"
                 android:textAppearance="?android:attr/textAppearanceMedium" />
 
             <TextView
index 5e56f98aa8562e2693bb34ee8700dab8af538348..aa187779ddbb1ae0d3d373dc414fc7ed917e5e51 100644 (file)
@@ -3,11 +3,13 @@
 
     <string name="app_name">Notdienst</string>
     <string name="action_settings">Settings</string>
-    <string name="glue">Glückstadt 8:00 - 8:00</string>
+    <string name="glue_week">Glückstadt 8:00 - 8:00</string>
     <string name="itz">Itzehoe 8:00 - 8:00</string>
     <string name="elm1">Elmshorn 9:00 - 9:00</string>
     <string name="elm2">Elmshorn 9:00 - 20:00</string>
     <string name="prev">&lt;</string>
     <string name="next">&gt;</string>
+    <string name="glue_sa">Glückstadt 17:00 - 19:00</string>
+    <string name="glue_so_hol">Glückstadt 9:00 - 13:00</string>
 
 </resources>
\ No newline at end of file
index 47cf9f53093c704be76f0f92998d410f20eb6989..535b009a8c217f5a251f9d9b9f85e5717761af53 100644 (file)
@@ -74,6 +74,13 @@ public class MainActivity extends Activity {
 
   private void updateDateLabel() {
     dateLabel.setText(fmtDate.format(cal.getTime()));
+    if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+      ((TextView) findViewById(R.id.text_gl)).setText(R.string.glue_so_hol);
+    } else if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
+      ((TextView) findViewById(R.id.text_gl)).setText(R.string.glue_sa);
+    } else {
+      ((TextView) findViewById(R.id.text_gl)).setText(R.string.glue_week);
+    }
     //dateLabel.setText(fmtDate.format(cal.getTime()));
     //cal.get(Calendar.DAY_OF_MONTH) + " "
     //      + cal.get(Calendar.DAY_OF_MONTH) + " "