public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (_resourceGridView == 0)
            {
                _resourceGridView = Resource.Layout.date_grid_fragment;
            }

            if (_resourceTheme == 0)
            {
                if (CalendarGridAdapter != null)
                {
                    _resourceTheme = CalendarGridAdapter.ThemeResource;
                }
            }

            if (DateGridView == null)
            {
                var localInflater = CaldroidFragment.ThemeInflater(Activity, inflater, _resourceTheme);

                DateGridView = (GridView)localInflater.Inflate(_resourceGridView, container, false);

                SetupGridView();
            }
            else
            {
                var parent = (ViewGroup)DateGridView.Parent;

                if (parent != null)
                {
                    parent.RemoveView(DateGridView);
                }
            }

            return(DateGridView);
        }
Example #2
0
        /// <summary>
        /// To support faster init.
        /// </summary>
        /// <returns>The instance.</returns>
        /// <param name="dialogTitle">Dialog title.</param>
        /// <param name="year">Year.</param>
        /// <param name="month">Month.</param>
        public static CaldroidFragment CreateInstance(string dialogTitle, int year, int month)
        {
            var caldroidFragment = new CaldroidFragment();

            var bundleArgs = new Bundle();

            bundleArgs.PutInt(YEAR, year);
            bundleArgs.PutInt(MONTH, month);
            bundleArgs.PutString(DIALOG_TITLE, dialogTitle);

            caldroidFragment.Arguments = bundleArgs;

            return(caldroidFragment);
        }
Example #3
0
        public CaldroidGridAdapter(Context context, int year, int month,
                                   Dictionary <string, object> dataFromCalendar,
                                   Dictionary <string, object> dataFromClient)
        {
            _year             = year;
            _month            = month;
            _context          = context;
            _dataFromClient   = new Dictionary <string, object>(dataFromClient);
            _dataFromCalendar = new Dictionary <string, object>(dataFromCalendar);

            LoadFromCalendarData();

            var inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);

            _layoutInflater = CaldroidFragment.ThemeInflater(context, inflater, ThemeResource);
        }
Example #4
0
 public DatePageChangeListener(CaldroidFragment calendarFragment)
 {
     _calendarFragment = calendarFragment;
 }