Continue work on the basic tab
[unical.git] / src / ro / ieval / unical / TrivialFragment.java
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.010384 seconds and 4 git commands to generate.