Ejemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var ignore = base.OnCreateView(inflater, container, savedInstanceState);

            var view = this.BindingInflate(FragmentId, null);

            _toolbar = view.FindViewById <Toolbar>(Resource.Id.toolbar);
            //_toolbar.SetTitleTextColor(Resource.Color.white);
            if (_toolbar != null)
            {
                ((MainActivity)Activity).SetSupportActionBar(_toolbar);
                ((MainActivity)Activity).SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                _drawerToggle = new MvxActionBarDrawerToggle(
                    Activity,                                                   // host Activity
                    ((MainActivity)Activity).DrawerLayout,                      // DrawerLayout object
                    _toolbar,                                                   // nav drawer icon to replace 'Up' caret
                    Resource.String.drawer_open,                                // "open drawer" description
                    Resource.String.drawer_close                                // "close drawer" description
                    );
                _drawerToggle.DrawerOpened += (sender, e) => ((MainActivity)Activity).HideSoftKeyboard();
                ((MainActivity)Activity).DrawerLayout.SetDrawerListener(_drawerToggle);
            }
            _actionBar = ((MainActivity)Activity).SupportActionBar;
            _actionBar.SetCustomView(Resource.Layout.toolbar_search);
            _edtSearch = (AppCompatEditText)_actionBar.CustomView.FindViewById(Resource.Id.edtSearch);
            _edtSearch.AddTextChangedListener(this);

            Messenger = Mvx.Resolve <IMvxMessenger>();
            Messenger.Subscribe <ToastMessage>(DisplayToast);


            return(view);
        }
Ejemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view     = inflater.Inflate(Resource.Layout.EditTimeEntryFragment, container, false);
            var toolbar  = view.FindViewById <Toolbar> (Resource.Id.EditTimeEntryFragmentToolbar);
            var activity = (Activity)Activity;

            activity.SetSupportActionBar(toolbar);
            Toolbar = activity.SupportActionBar;
            Toolbar.SetDisplayHomeAsUpEnabled(true);

            var durationLayout = inflater.Inflate(Resource.Layout.DurationTextView, null);

            DurationTextView = durationLayout.FindViewById <TextView> (Resource.Id.DurationTextViewTextView);

            Toolbar.SetCustomView(durationLayout, new ActionBar.LayoutParams((int)GravityFlags.Center));
            Toolbar.SetDisplayShowCustomEnabled(true);
            Toolbar.SetDisplayShowTitleEnabled(false);

            HasOptionsMenu = true;

            ActionFAB         = view.FindViewById <StartStopFab> (Resource.Id.EditStartStopBtn);
            StartTimeEditText = view.FindViewById <EditText> (Resource.Id.StartTimeEditText).SetFont(Font.Roboto);
            StopTimeEditText  = view.FindViewById <EditText> (Resource.Id.StopTimeEditText).SetFont(Font.Roboto);
            StopTimeEditLabel = view.FindViewById <TextView> (Resource.Id.StopTimeEditLabel);

            DescriptionBit = view.FindViewById <TogglField> (Resource.Id.Description)
                             .DestroyAssistView().DestroyArrow()
                             .SetName(Resource.String.BaseEditTimeEntryFragmentDescription);
            DescriptionEditText = DescriptionBit.TextField;

            ProjectBit = view.FindViewById <TogglField> (Resource.Id.Project)
                         .SetName(Resource.String.BaseEditTimeEntryFragmentProject)
                         .SimulateButton();
            ProjectEditText = ProjectBit.TextField;

            TagsBit = view.FindViewById <TogglTagsField> (Resource.Id.TagsBit);

            BillableCheckBox = view.FindViewById <CheckBox> (Resource.Id.BillableCheckBox).SetFont(Font.RobotoLight);

            DurationTextView.Click           += OnDurationTextViewClick;
            StartTimeEditText.Click          += OnStartTimeEditTextClick;
            StopTimeEditText.Click           += OnStopTimeEditTextClick;
            DescriptionEditText.TextChanged  += OnDescriptionTextChanged;
            DescriptionEditText.EditorAction += OnDescriptionEditorAction;
            DescriptionEditText.FocusChange  += OnDescriptionFocusChange;
            ProjectBit.Click               += OnProjectEditTextClick;
            ProjectEditText.Click          += OnProjectEditTextClick;
            TagsBit.FullClick              += OnTagsEditTextClick;
            BillableCheckBox.CheckedChange += OnBillableCheckBoxCheckedChange;
            ActionFAB.Click += OnFABButtonClick;

            return(view);
        }
Ejemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view            = inflater.Inflate(Resource.Layout.EditTimeEntryFragment, container, false);
            var activityToolbar = view.FindViewById <Toolbar> (Resource.Id.EditTimeEntryFragmentToolbar);
            var activity        = (Activity)Activity;

            activity.SetSupportActionBar(activityToolbar);
            toolbar = activity.SupportActionBar;
            toolbar.SetDisplayHomeAsUpEnabled(true);


            var durationLayout = inflater.Inflate(Resource.Layout.DurationTextView, null);

            DurationTextView = durationLayout.FindViewById <TextView> (Resource.Id.DurationTextViewTextView);

            toolbar.SetCustomView(durationLayout, new ActionBar.LayoutParams((int)GravityFlags.Center));
            toolbar.SetDisplayShowCustomEnabled(true);
            toolbar.SetDisplayShowTitleEnabled(false);

            StartTimeEditText = view.FindViewById <EditText> (Resource.Id.StartTimeEditText).SetFont(Font.Roboto);
            StopTimeEditText  = view.FindViewById <EditText> (Resource.Id.StopTimeEditText).SetFont(Font.Roboto);
            stopTimeEditLabel = view.FindViewById <TextView> (Resource.Id.StopTimeEditLabel);

            DescriptionField = view.FindViewById <TogglField> (Resource.Id.Description)
                               .DestroyAssistView().DestroyArrow()
                               .SetName(Resource.String.EditTimeEntryFragmentDescription)
                               .SetHint(Resource.String.EditTimeEntryFragmentDescriptionHint);

            ProjectField = view.FindViewById <TogglField> (Resource.Id.Project)
                           .SetName(Resource.String.EditTimeEntryFragmentProject)
                           .SetHint(Resource.String.EditTimeEntryFragmentProjectHint)
                           .SimulateButton();

            TagsField                = view.FindViewById <TogglTagsField> (Resource.Id.TagsBit);
            BillableCheckBox         = view.FindViewById <CheckBox> (Resource.Id.BillableCheckBox).SetFont(Font.RobotoLight);
            editTimeEntryProgressBar = view.FindViewById <View> (Resource.Id.EditTimeEntryProgressBar);
            editTimeEntryContent     = view.FindViewById <View> (Resource.Id.EditTimeEntryContent);

            HasOptionsMenu = true;
            return(view);
        }
Ejemplo n.º 4
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.EditTimeEntryFragment, container, false);
            var toolbar = view.FindViewById<Toolbar> (Resource.Id.EditTimeEntryFragmentToolbar);
            var activity = (Activity)Activity;

            activity.SetSupportActionBar (toolbar);
            Toolbar = activity.SupportActionBar;
            Toolbar.SetDisplayHomeAsUpEnabled (true);

            var durationLayout = inflater.Inflate (Resource.Layout.DurationTextView, null);
            DurationTextView = durationLayout.FindViewById<TextView> (Resource.Id.DurationTextViewTextView);

            Toolbar.SetCustomView (durationLayout, new ActionBar.LayoutParams ((int)GravityFlags.Center));
            Toolbar.SetDisplayShowCustomEnabled (true);
            Toolbar.SetDisplayShowTitleEnabled (false);

            HasOptionsMenu = true;

            StartTimeEditText = view.FindViewById<EditText> (Resource.Id.StartTimeEditText).SetFont (Font.Roboto);
            StopTimeEditText = view.FindViewById<EditText> (Resource.Id.StopTimeEditText).SetFont (Font.Roboto);
            StopTimeEditLabel = view.FindViewById<TextView> (Resource.Id.StopTimeEditLabel);

            DescriptionBit = view.FindViewById<TogglField> (Resource.Id.Description)
                             .DestroyAssistView().DestroyArrow()
                             .SetName (Resource.String.BaseEditTimeEntryFragmentDescription);
            DescriptionEditText = DescriptionBit.TextField;

            ProjectBit = view.FindViewById<TogglField> (Resource.Id.Project)
                         .SetName (Resource.String.BaseEditTimeEntryFragmentProject)
                         .SimulateButton();
            ProjectEditText = ProjectBit.TextField;

            TagsBit = view.FindViewById<TogglTagsField> (Resource.Id.TagsBit);

            BillableCheckBox = view.FindViewById<CheckBox> (Resource.Id.BillableCheckBox).SetFont (Font.RobotoLight);

            DurationTextView.Click += OnDurationTextViewClick;
            StartTimeEditText.Click += OnStartTimeEditTextClick;
            StopTimeEditText.Click += OnStopTimeEditTextClick;
            DescriptionEditText.TextChanged += OnDescriptionTextChanged;
            DescriptionEditText.EditorAction += OnDescriptionEditorAction;
            DescriptionEditText.FocusChange += OnDescriptionFocusChange;
            ProjectBit.Click += OnProjectEditTextClick;
            ProjectEditText.Click += OnProjectEditTextClick;
            TagsBit.FullClick += OnTagsEditTextClick;
            BillableCheckBox.CheckedChange += OnBillableCheckBoxCheckedChange;

            return view;
        }
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.EditGroupedTimeEntryFragment, container, false);
            var activityToolbar = view.FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.EditTimeEntryFragmentToolbar);
            var activity = (Activity)Activity;

            activity.SetSupportActionBar (activityToolbar);
            toolbar = activity.SupportActionBar;
            toolbar.SetDisplayHomeAsUpEnabled (true);

            var durationLayout = inflater.Inflate (Resource.Layout.DurationTextView, null);
            DurationTextView = durationLayout.FindViewById<TextView> (Resource.Id.DurationTextViewTextView);

            toolbar.SetCustomView (durationLayout, new ActionBar.LayoutParams ((int)GravityFlags.Center));
            toolbar.SetDisplayShowCustomEnabled (true);
            toolbar.SetDisplayShowTitleEnabled (false);

            StartTimeEditText = view.FindViewById<EditText> (Resource.Id.StartTimeEditText).SetFont (Font.Roboto);
            StopTimeEditText = view.FindViewById<EditText> (Resource.Id.StopTimeEditText).SetFont (Font.Roboto);
            stopTimeEditLabel = view.FindViewById<TextView> (Resource.Id.StopTimeEditLabel);

            DescriptionField = view.FindViewById<TogglField> (Resource.Id.Description)
                               .DestroyAssistView().DestroyArrow()
                               .SetName (Resource.String.EditTimeEntryFragmentDescription)
                               .SetHint (Resource.String.EditTimeEntryFragmentDescriptionHint);

            ProjectField = view.FindViewById<TogglField> (Resource.Id.Project)
                           .SetName (Resource.String.EditTimeEntryFragmentProject)
                           .SetHint (Resource.String.EditTimeEntryFragmentProjectHint)
                           .SimulateButton();

            timeEntriesListView = view.FindViewById<ListView> (Resource.Id.timeEntryGroupListView);

            HasOptionsMenu = true;
            return view;
        }