]> iEval git - unical.git/commitdiff
Add event basic tab. work in progress
authorPetru Trimbitas <l3asketballplayer@yahoo.com>
Wed, 12 Jun 2013 16:27:38 +0000 (19:27 +0300)
committerPetru Trimbitas <l3asketballplayer@yahoo.com>
Wed, 12 Jun 2013 16:27:38 +0000 (19:27 +0300)
res/layout/add_event_basic_tab.xml
src/ro/ieval/unical/AddEventActivity.java

index 7894af02572c691fed5e6f5476dd8ea7d729889d..aca5e874787c1a1fd4e765122e3a6eb8bc12c2f2 100644 (file)
         android:id="@+id/repeat_spinner"
         android:entries="@array/repeat_array"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content" />
+        android:layout_height="wrap_content"
+         />
 
     <LinearLayout
         android:layout_width="match_parent"
index d68d6497e65a1a3b838d462954d4f60923c9a977..d16b426714859745810799de01414440786195b9 100644 (file)
@@ -6,13 +6,18 @@ import android.app.ActionBar;
 import android.app.Activity;
 import android.app.DatePickerDialog.OnDateSetListener;
 import android.app.Fragment;
+import android.app.FragmentManager;
 import android.app.TimePickerDialog.OnTimeSetListener;
 import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
 import android.widget.DatePicker;
+import android.widget.Spinner;
+import android.widget.Switch;
 import android.widget.TextView;
 import android.widget.TimePicker;
 
@@ -53,8 +58,26 @@ public final class AddEventActivity extends Activity implements OnDateSetListene
                actionBar.addTab(t2);
                actionBar.addTab(t3);
                
+               handleViews(f1,f2,f3);
+               
        }
        
+       private void handleViews(Fragment f1,Fragment f2,Fragment f3) {
+               Switch repeatSwitch = (Switch) this.getFragmentManager().findFragmentById(f1.getId()).getView().findViewById(R.id.repeat_switch);
+               final Spinner repeatSpinner = (Spinner) this.getFragmentManager().findFragmentById(f1.getId()).getView().findViewById(R.id.repeat_spinner);
+               repeatSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
+                       
+                       @Override
+                       public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                               if(isChecked) {
+                                       repeatSpinner.setEnabled(true);
+                               }else {
+                                       repeatSpinner.setEnabled(false);
+                               }
+                       }
+               });
+       }
+
        @Override
        public boolean onCreateOptionsMenu(final Menu menu) {
                final MenuInflater inflater = getMenuInflater();
This page took 0.029573 seconds and 4 git commands to generate.