X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Funical%2FAddEventActivity.java;h=5606b65fca91679c93bfc561e585160ea5d18c05;hb=e6ba41a802c53e6d1ae9667f43955d00b20bb233;hp=0fc26ab477c6eeb54e93d37032fe3474b86f1918;hpb=6d7e08bf032626962f50c8d9db6c1c5b3d978271;p=unical.git diff --git a/src/ro/ieval/unical/AddEventActivity.java b/src/ro/ieval/unical/AddEventActivity.java index 0fc26ab..5606b65 100644 --- a/src/ro/ieval/unical/AddEventActivity.java +++ b/src/ro/ieval/unical/AddEventActivity.java @@ -1,16 +1,13 @@ package ro.ieval.unical; import android.app.ActionBar; import android.app.Activity; +import android.app.DialogFragment; import android.app.Fragment; -import android.app.FragmentTransaction; -import android.app.ActionBar.Tab; -import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.widget.TabHost; -import android.widget.TabHost.TabSpec; +import android.view.View; public final class AddEventActivity extends Activity { @Override @@ -18,15 +15,26 @@ public final class AddEventActivity extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.add_event); setTitle(R.string.addeventtitle); - ActionBar actionBar = getActionBar(); + final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); - ActionBar.Tab t1 = actionBar.newTab().setText(this.getString(R.string.addevtab1)); - ActionBar.Tab t2 = actionBar.newTab().setText(this.getString(R.string.addevtab2)); - ActionBar.Tab t3 = actionBar.newTab().setText(this.getString(R.string.addevtab3)); + final ActionBar.Tab t1 = actionBar.newTab().setText(this.getString(R.string.addevtab1)); + final ActionBar.Tab t2 = actionBar.newTab().setText(this.getString(R.string.addevtab2)); + final ActionBar.Tab t3 = actionBar.newTab().setText(this.getString(R.string.addevtab3)); - Fragment f1 = new AddEventBasicTabFragment(); - Fragment f2 = new AddEventDetailsTabFragment(); - Fragment f3 = new AddEventOtherTabFragment(); + final Fragment f1 = new TrivialFragment(); + final Bundle b1=new Bundle(); + b1.putInt(TrivialFragment.ARGUMENT_LAYOUT, R.layout.add_event_basic_tab); + f1.setArguments(b1); + + final Fragment f2 = new TrivialFragment(); + final Bundle b2=new Bundle(); + b2.putInt(TrivialFragment.ARGUMENT_LAYOUT, R.layout.add_event_details_tab); + f2.setArguments(b2); + + final Fragment f3 = new TrivialFragment(); + final Bundle b3=new Bundle(); + b3.putInt(TrivialFragment.ARGUMENT_LAYOUT, R.layout.add_event_other_tab); + f3.setArguments(b3); t1.setTabListener(new AddEventTabListener(f1)); t2.setTabListener(new AddEventTabListener(f2)); @@ -54,4 +62,15 @@ public final class AddEventActivity extends Activity { return false; } } + + public void showTimePickerDialog(View v) { + if(v.getId()==R.id.date_start || v.getId()==R.id.date_end) { + DialogFragment newFragment = new DatePickerFragment(); + newFragment.show(getFragmentManager(),"datePicker"); + } + else { + DialogFragment newFragment = new TimePickerFragment(); + newFragment.show(getFragmentManager(), "timePicker"); + } + } }