]>
iEval git - unical.git/blob - src/ro/ieval/unical/AddEventTabListener.java
1 package ro
.ieval
.unical
;
3 import android
.app
.ActionBar
;
4 import android
.app
.ActionBar
.Tab
;
5 import android
.app
.Fragment
;
6 import android
.app
.FragmentTransaction
;
7 import android
.util
.Log
;
8 import android
.widget
.EditText
;
9 import android
.widget
.TextView
;
11 import java
.text
.ParseException
;
12 import java
.text
.SimpleDateFormat
;
13 import java
.util
.Date
;
15 public class AddEventTabListener
implements ActionBar
.TabListener
{
16 private Fragment fragment
;
18 private boolean isAdded
= false;
21 public AddEventTabListener(final Fragment fragment
,Event e
,int tabId
) {
22 this.fragment
= fragment
;
28 public void onTabSelected(final Tab tab
, final FragmentTransaction ft
) {
29 ft
.replace(android
.R
.id
.content
, fragment
, null);
33 public void onTabUnselected(final Tab tab
, final FragmentTransaction ft
) {
36 ev
.title
=((TextView
)fragment
.getView().findViewById(R
.id
.eventtitle
)).getText().toString();
37 String start
=((TextView
)fragment
.getView().findViewById(R
.id
.date_start
)).getText()+ " " +
38 ((TextView
)fragment
.getView().findViewById(R
.id
.time_start
)).getText();
39 String end
=((TextView
)fragment
.getView().findViewById(R
.id
.date_end
)).getText()+ " " +
40 ((TextView
)fragment
.getView().findViewById(R
.id
.time_end
)).getText();
42 Date s
=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(start
);
43 Date e
=new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(end
);
44 ev
.dtstart
=s
.getTime();
46 } catch (ParseException e
) {
52 ev
.description
=fragment
.getView().findViewById(R
.id
.description
).toString();
60 public void onTabReselected(final Tab tab
, final FragmentTransaction ft
) {
This page took 0.046369 seconds and 4 git commands to generate.