public void OnItemSelected(AdapterView parent, View view, int position, long id) { string goalTime = (string)Singleton.Instance.GoalSpinner.SelectedItem; if (goalTime == "Day") { Singleton.Instance.MonthSpinner.Visibility = ViewStates.Visible; } else { Singleton.Instance.MonthSpinner.Visibility = ViewStates.Gone; } GoalTimeDao.Update(goalTime); var obj = new GoalFragmentAdapter(Singleton.Instance.GoalActivity.SupportFragmentManager); Singleton.Instance.GoalViewPager.Adapter = obj; Singleton.Instance.GoalViewPager.AddOnPageChangeListener(new GoalFragmentPagerChangeListener()); var instance = Singleton.Instance; for (int i = 0; i < obj.Count; i++) { GoalContext goalContext = GoalContextDao.GetGoalContext(i); if (goalContext.IsViewCreated) { goalContext.UpdateTextView(); } else { break; } } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.Goal_Fragment, container, false); #region Get Layout Controls GoalContextDao.Update(Index, v.FindViewById <TextView>(Resource.Id.tvGoalContent), v.FindViewById <LinearLayout>(Resource.Id.overallLayout)); GoalContextDao.GetGoalContext(Index).UpdateTextView(); #endregion return(v); }
public void OnItemSelected(AdapterView parent, View view, int position, long id) { MonthDao.UpdateByTitle((string)Singleton.Instance.MonthSpinner.SelectedItem); for (int i = 0; i < 28; i++) { GoalContext goalContext = GoalContextDao.GetGoalContext(i); if (goalContext.IsViewCreated) { goalContext.UpdateTextView(); } else { break; } } }
public override Android.Support.V4.App.Fragment GetItem(int position) { //return Singleton.Instance.GoalFragment; return(GoalContextDao.GetGoalContext(position).GoalFragment); }