]> iEval git - unical.git/commitdiff
Continue work on the basic tab
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 15 Jun 2013 15:39:19 +0000 (18:39 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 15 Jun 2013 15:39:19 +0000 (18:39 +0300)
res/layout/add_event_basic_tab.xml
src/ro/ieval/unical/AddEventActivity.java
src/ro/ieval/unical/TrivialFragment.java

index 00d07c2918e9e61148f24f9594f61d4f0100f0ea..05b98ab1e4ca4c39dcddc9f2e456af589db3c5b6 100644 (file)
        
                <EditText
                    android:id="@+id/repeat_time"
-                   android:layout_width="0dip"
-                   android:layout_height="wrap_content"
-                   android:layout_weight="1"
-                   android:ems="4"
-                   android:text="1"
-                   android:inputType="number" />
+                   android:inputType="number"
+                   android:layout_width="wrap_content"
+                   android:layout_height="wrap_content" />
        
                <Spinner
                        android:id="@+id/repeat_spinner"
                    android:inputType="number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
-                   android:visibility="gone"
-               />
-       
+                   android:visibility="gone" />
+               <TextView
+               style="@android:style/Widget.DeviceDefault.EditText"
+                   android:id="@+id/repeat_until"
+                   android:layout_width="wrap_content"
+                   android:layout_height="wrap_content"
+               android:onClick="showDateTimePickerDialog"
+                   android:ems="8"
+                   android:visibility="gone" />
            </LinearLayout>
        </LinearLayout>
 </LinearLayout>
index 9219640ce93b53bdc79351012aa605e3eb15cc25..62afe13b269b6c11e3c63550394402f7d1433d44 100644 (file)
@@ -74,7 +74,7 @@ public final class AddEventActivity extends Activity implements OnDateSetListene
 
        public void showDateTimePickerDialog(final View v) {
                dateTimeTextView=(TextView) v;
-               if(v.getId()==R.id.date_start || v.getId()==R.id.date_end)
+               if(v.getId()==R.id.date_start || v.getId()==R.id.date_end || v.getId() == R.id.repeat_until)
                        new DatePickerFragment().show(getFragmentManager(), "datePicker");
                else
                        new TimePickerFragment().show(getFragmentManager(), "timePicker");
index 4a1c0b2b38a17f39b160c424e011eb9a50d2374f..9486f831b042619702e0f1a0c9fa37b0aa364130 100644 (file)
@@ -14,8 +14,11 @@ import android.widget.Switch;
 public final class TrivialFragment extends Fragment {
        private static class OnItemSelectedListener implements android.widget.AdapterView.OnItemSelectedListener{
                private final View repeatCount;
-               public OnItemSelectedListener(final View repeatCount) {
+               private final View repeatUntil;
+
+               public OnItemSelectedListener(final View repeatCount, final View repeatUntil) {
                        this.repeatCount=repeatCount;
+                       this.repeatUntil=repeatUntil;
                }
 
                @Override
@@ -23,12 +26,15 @@ public final class TrivialFragment extends Fragment {
                        switch(pos){
                        case 0:
                                repeatCount.setVisibility(View.GONE);
+                               repeatUntil.setVisibility(View.GONE);
                                break;
                        case 1:
                                repeatCount.setVisibility(View.GONE);
+                               repeatUntil.setVisibility(View.VISIBLE);
                                break;
                        case 2:
                                repeatCount.setVisibility(View.VISIBLE);
+                               repeatUntil.setVisibility(View.GONE);
                                break;
                        default:
                        }
@@ -50,7 +56,7 @@ public final class TrivialFragment extends Fragment {
                        if(isChecked) {
                                Utils.setEnabledRecursively(layout, true);
                                final Spinner repeatType = (Spinner) root.findViewById(R.id.repeat_type);
-                               repeatType.setOnItemSelectedListener(new OnItemSelectedListener(root.findViewById(R.id.repeat_count)));
+                               repeatType.setOnItemSelectedListener(new OnItemSelectedListener(root.findViewById(R.id.repeat_count),root.findViewById(R.id.repeat_until)));
                        }else {
                                Utils.setEnabledRecursively(layout, false);
                        }
This page took 0.031845 seconds and 4 git commands to generate.