]> iEval git - unical.git/blobdiff - src/ro/ieval/unical/TrivialFragment.java
Removes final atribute from Event fields. Fixes a bug when setting the date
[unical.git] / src / ro / ieval / unical / TrivialFragment.java
index 4a1c0b2b38a17f39b160c424e011eb9a50d2374f..e578abf05c107ca76a2a9371c5cbb87501d0f2a2 100644 (file)
@@ -1,6 +1,8 @@
 package ro.ieval.unical;
 
+import android.app.ActionBar;
 import android.app.Fragment;
+import android.app.FragmentTransaction;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -14,8 +16,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,16 +28,19 @@ 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:
                        }
-               }
+        }
 
                @Override public void onNothingSelected(final AdapterView<?> arg0) { /* do nothing */   }
        }
@@ -50,7 +58,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.019416 seconds and 4 git commands to generate.