Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
                }
            }
        }
Exemplo n.º 4
0
 public override Android.Support.V4.App.Fragment GetItem(int position)
 {
     //return Singleton.Instance.GoalFragment;
     return(GoalContextDao.GetGoalContext(position).GoalFragment);
 }