From 408a62787e4432565f836d2c477206f7f92ca20a Mon Sep 17 00:00:00 2001 From: Petru Trimbitas Date: Thu, 13 Jun 2013 16:52:55 +0300 Subject: [PATCH] add event work in progress --- res/layout/add_event_basic_tab.xml | 34 +++++++++++------------- res/values/strings.xml | 24 +++++++++++++---- src/ro/ieval/unical/TrivialFragment.java | 30 +++++++++++++++++++++ 3 files changed, 64 insertions(+), 24 deletions(-) diff --git a/res/layout/add_event_basic_tab.xml b/res/layout/add_event_basic_tab.xml index 1f7ea5d..f05f666 100644 --- a/res/layout/add_event_basic_tab.xml +++ b/res/layout/add_event_basic_tab.xml @@ -109,44 +109,40 @@ android:layout_height="wrap_content" android:id="@+id/repeat_layout" android:orientation="vertical" > - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left" > - + End: Repeat Repeat every + day + days + week + weeks + month + months + year + years - - Daily - Weekly - Monthly - Yearly + + Day + Week + Month + Year + + + Days + Weeks + Months + Years Forever diff --git a/src/ro/ieval/unical/TrivialFragment.java b/src/ro/ieval/unical/TrivialFragment.java index 3de4ed4..1dc538f 100644 --- a/src/ro/ieval/unical/TrivialFragment.java +++ b/src/ro/ieval/unical/TrivialFragment.java @@ -2,10 +2,14 @@ package ro.ieval.unical; import android.app.Fragment; import android.os.Bundle; +import android.text.InputType; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemSelectedListener; import android.widget.CompoundButton; +import android.widget.EditText; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.Switch; @@ -29,6 +33,32 @@ public final class TrivialFragment extends Fragment { public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) { if(isChecked) { Utils.setEnabledRecursively(ll, true); + Spinner repeatType = (Spinner) view.findViewById(R.id.repeat_type); + final EditText repeatCount = new EditText(getActivity()); + repeatCount.setInputType(InputType.TYPE_CLASS_NUMBER); + final LinearLayout repeatLayout = (LinearLayout) view.findViewById(R.id.repeat_count_layout); + + repeatType.setOnItemSelectedListener(new OnItemSelectedListener() { + + @Override + public void onItemSelected(AdapterView arg0, + View arg1, int arg2, long arg3) { + if(arg2==1) { + //TODO adauga un date picker + //TODO sterge repeatCount + }else if(arg2==2) { + repeatLayout.addView(repeatCount); + }else { + //TODO sterge repeatCount + } + + } + + @Override + public void onNothingSelected(AdapterView arg0) { + + } + }); }else { Utils.setEnabledRecursively(ll, false); } -- 2.39.2