From: Marius Gavrilescu Date: Sat, 15 Jun 2013 15:39:19 +0000 (+0300) Subject: Continue work on the basic tab X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=0dde54565696721d489bf4633b844268200508b1;p=unical.git Continue work on the basic tab --- diff --git a/res/layout/add_event_basic_tab.xml b/res/layout/add_event_basic_tab.xml index 00d07c2..05b98ab 100644 --- a/res/layout/add_event_basic_tab.xml +++ b/res/layout/add_event_basic_tab.xml @@ -123,12 +123,9 @@ + android:inputType="number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> - + android:visibility="gone" /> + diff --git a/src/ro/ieval/unical/AddEventActivity.java b/src/ro/ieval/unical/AddEventActivity.java index 9219640..62afe13 100644 --- a/src/ro/ieval/unical/AddEventActivity.java +++ b/src/ro/ieval/unical/AddEventActivity.java @@ -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"); diff --git a/src/ro/ieval/unical/TrivialFragment.java b/src/ro/ieval/unical/TrivialFragment.java index 4a1c0b2..9486f83 100644 --- a/src/ro/ieval/unical/TrivialFragment.java +++ b/src/ro/ieval/unical/TrivialFragment.java @@ -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); }