]> iEval git - unical.git/commitdiff
Add event. work in progress[2]
authorPetru <l3asketballplayer@yahoo.com>
Mon, 15 Jul 2013 18:47:28 +0000 (21:47 +0300)
committerPetru <l3asketballplayer@yahoo.com>
Mon, 15 Jul 2013 18:47:28 +0000 (21:47 +0300)
All fields are now stored in a variable

res/layout/add_event_basic_tab.xml
src/ro/ieval/unical/AddEventTabListener.java

index 05b98ab1e4ca4c39dcddc9f2e456af589db3c5b6..0b258cb05d33d9c6b8153a5ece30e0833bd1cf20 100644 (file)
@@ -28,6 +28,7 @@
         <TextView
             style="@android:style/Widget.DeviceDefault.EditText"
             android:id="@+id/time_start"
+            android:freezesText="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:onClick="showDateTimePickerDialog"
@@ -39,6 +40,7 @@
         <TextView
             style="@android:style/Widget.DeviceDefault.EditText"
             android:id="@+id/date_start"
+            android:freezesText="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:onClick="showDateTimePickerDialog"
@@ -63,6 +65,7 @@
         <TextView
             style="@android:style/Widget.DeviceDefault.EditText"
             android:id="@+id/time_end"
+            android:freezesText="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:onClick="showDateTimePickerDialog"
@@ -74,6 +77,7 @@
         <TextView
             style="@android:style/Widget.DeviceDefault.EditText"
             android:id="@+id/date_end"
+            android:freezesText="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:onClick="showDateTimePickerDialog"
index b38779cfd138babeff7db32598e0f491ab913bb0..364ce555738febbc01cac16e0228df7f1ba448be 100644 (file)
@@ -5,6 +5,10 @@ import android.app.ActionBar.Tab;
 import android.app.Fragment;
 import android.app.FragmentTransaction;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 public class AddEventTabListener implements ActionBar.TabListener {
        public Fragment fragment;
     private Event ev;
@@ -26,6 +30,19 @@ public class AddEventTabListener implements ActionBar.TabListener {
         switch (tabId) {
             case 0:
                 ev.title=fragment.getView().findViewById(R.id.eventtitle).toString();
+                String start=fragment.getView().findViewById(R.id.date_start).toString()+ " " +
+                             fragment.getView().findViewById(R.id.time_start).toString();
+                String end=fragment.getView().findViewById(R.id.date_end).toString()+ " " +
+                             fragment.getView().findViewById(R.id.time_end).toString();
+                try {
+                    Date s=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(start);
+                    Date e=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(end);
+                    ev.dtstart=s.getTime();
+                    ev.dtend=s.getTime();
+                } catch (ParseException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                }
+
                 break;
             case 1:
                 ev.description=fragment.getView().findViewById(R.id.description).toString();
This page took 0.032267 seconds and 4 git commands to generate.