public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootview = (RelativeLayout)inflater.Inflate (Resource.Layout.raffleroot, container, false); locationcontainerlayout=(LinearLayout)rootview.FindViewById (Resource.Id.raffleroot_locationcontainer_linerlayout); TextView locationtext=new TextView(nn_activity); locationtext.Text=nn_location; LinearLayout.LayoutParams param=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent,LinearLayout.LayoutParams.WrapContent); param.Gravity=global::Android.Views.GravityFlags.Center; param.LeftMargin=TapUtil.dptodx(5); locationtext.LayoutParameters=param; locationcontainerlayout.AddView (locationtext); //initialize listview listview=(ListView)rootview.FindViewById(Resource.Id.raffleroot_eventlist_listview); listview.Divider = null; adapter = new EventListAdapter (nn_activity,eventcards); listview.Adapter = adapter; //adapter.NotifyListChange (); listview.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => { (nn_activity as HomeScreen).ShowRaffleDetailFragment(e.Position); }; return rootview; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootview = (RelativeLayout)inflater.Inflate (Resource.Layout.raffleroot, container, false); locationcontainerlayout=(LinearLayout)rootview.FindViewById (Resource.Id.raffleroot_locationcontainer_linerlayout); locationtextview=(TextView)rootview.FindViewById (Resource.Id.raffleroot_location_textview); locationtextview.Text += " " + nn_location; confirmedtab = (Button)rootview.FindViewById (Resource.Id.raffleroot_toptabconfirmed_button); confirmedtab.Click -= OnConifrmedClick; confirmedtab.Click += OnConifrmedClick; potencialtab = (Button)rootview.FindViewById (Resource.Id.raffleroot_toptabpotencial_button); potencialtab.Click -= OnPotencialClick; potencialtab.Click += OnPotencialClick; confirmedtabindicator = (RelativeLayout)rootview.FindViewById (Resource.Id.raffleroot_toptabconfirmedindicator_relativelayout); potencialtabindicator = (RelativeLayout)rootview.FindViewById (Resource.Id.raffleroot_toptabpotencialindicator_relativelayout); if (showconfirmed) { confirmedtab.SetTextColor (Resources.GetColor(Resource.Color.iosblue)); potencialtab.SetTextColor (Resources.GetColor(Resource.Color.black)); confirmedtabindicator.SetBackgroundResource (Resource.Color.iosblue); potencialtabindicator.SetBackgroundResource (Resource.Color.light_gray); } else { confirmedtab.SetTextColor (Resources.GetColor(Resource.Color.black)); potencialtab.SetTextColor (Resources.GetColor(Resource.Color.iosblue)); confirmedtabindicator.SetBackgroundResource (Resource.Color.light_gray); potencialtabindicator.SetBackgroundResource (Resource.Color.iosblue); } // TextView locationtext=new TextView(nn_activity); // locationtext.SetTextColor (Color.Gray); // locationtext.Text=nn_location; // LinearLayout.LayoutParams param=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent,LinearLayout.LayoutParams.WrapContent); // param.Gravity=global::Android.Views.GravityFlags.Center; // param.LeftMargin=TapUtil.dptodx(5); // locationtext.LayoutParameters=param; // locationcontainerlayout.AddView (locationtext); //initialize listview listview=(ListView)rootview.FindViewById(Resource.Id.raffleroot_eventlist_listview); listview.Divider = null; adapter = new EventListAdapter (nn_activity,confirmedcards); listview.Adapter = adapter; //adapter.NotifyListChange (); listview.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => { if(showconfirmed){ (nn_activity as HomeScreen).ShowRaffleDetailFragment(confirmedcards[e.Position]); //(nn_activity as HomeScreen).ShowRaffleDetailFragment(confirmedcards,e.Position,0); } else{ (nn_activity as HomeScreen).ShowRaffleDetailFragment(potencialcards[e.Position]); //(nn_activity as HomeScreen).ShowRaffleDetailFragment(potencialcards,e.Position,1); } }; return rootview; }