public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootview = new RelativeLayout (nn_activity); rootview.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); rootview.Id = TapUtil.generateViewId (); //list to show event history historyeventlist = new ListView (nn_activity); historyeventlist.LayoutParameters= new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); historyeventlist.Id = TapUtil.generateViewId (); adapter = new EventHistoryListAdapter (nn_activity,historylist); historyeventlist.Adapter = adapter; rootview.AddView (historyeventlist); return rootview; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootview = new RelativeLayout (nn_activity); rootview.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); rootview.SetBackgroundColor (Resources.GetColor(Resource.Color.soarnix_bg_gray)); rootview.Id = TapUtil.generateViewId (); //list to show event history historyeventlist = new ListView (nn_activity); historyeventlist.LayoutParameters= new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); historyeventlist.Id = TapUtil.generateViewId (); adapter = new EventHistoryListAdapter (nn_activity,historylist); historyeventlist.Adapter = adapter; //add a relative layout to rootview to show no result event nohistorylayout=new RelativeLayout(nn_activity); nohistorylayout.LayoutParameters= new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); nohistorylayout.SetBackgroundResource(Resource.Color.soarnix_bg_gray); nohistorylayout.Visibility = ViewStates.Gone; nohistorytext = new TextView (nn_activity); nohistorytext.Text = HistoryScreenData.NoRecordMessage; nohistorytext.Gravity = GravityFlags.Center; RelativeLayout.LayoutParams nohistorytextparam=new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent); nohistorytextparam.AddRule (LayoutRules.CenterInParent); nohistorytextparam.SetMargins (TapUtil.dptodx (10), 0, TapUtil.dptodx (10), 0); nohistorytext.LayoutParameters = nohistorytextparam; nohistorylayout.AddView (nohistorytext); rootview.AddView (historyeventlist); rootview.AddView (nohistorylayout); return rootview; }