public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.fragment_garage, null);

            presenter = new GaragePresenter()
            {
                View = this
            };
            ViewInjector.Inject(this, view);
            StyleView();
            ToolbarHelper.SetToolbarStyle("√араж", false);
            (this.Activity as MenuActivity).HideToolbar();
            garageViewPager.PageSelected += GarageViewPager_PageSelected;
            return(view);
        }
Beispiel #2
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            ToolbarHelper.ShowToolbar(Activity, "Playlists");
            ToolbarHelper.ShowToolbarBackButton(Activity);

            var playlistRecycler = view.FindViewById <RecyclerView>(Resource.Id.playlist_recycler);

            SetUpPlaylistRecycler(playlistRecycler, view);

            var fileTextView = View.FindViewById <FileTextView>(Resource.Id.fileText);

            fileTextView.SetFile(DebugLog.BaseLog.FilePath);
        }
Beispiel #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _maximumCallCount = savedInstanceState.GetInt("maximumCallCount");
                    _currentCallIndex = savedInstanceState.GetInt("currentCallIndex");
                }

                SetContentView(Resource.Layout.HelpNowLayout);

                GetShowHelpNowSetting();

                GetAudioConfirmationSetting();

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.safetyPlanToolbar, Resource.String.SafetyPlanActionBarTitle, Color.White);

                SetupCallbacks();

                if (_confirmationAudioSetting)
                {
                    if (_spokenWord == null)
                    {
                        _spokenWord = new TextToSpeech(this, this);
                        Log.Info(TAG, "OnCreate: _spokenWord initialised");
                    }
                }
                if (_emergencyCallContacts == null)
                {
                    _emergencyCallContacts = new List <Contact>();
                }

                InitialiseTelephony();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Error occurred during creation - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, "Creating Help Now Activity", "HelpNowActivity.OnCreate");
                }
            }
        }
Beispiel #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedListItemIndex = savedInstanceState.GetInt("selectedListItemIndex");
                }

                SetContentView(Resource.Layout.ProblemSolvingLayout);
                Log.Info(TAG, "OnCreate: Set content view successfully");

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.problemSolvingToolbar, Resource.String.ProblemSolvingActionBarTitle, Color.White);

                GetFieldComponents();

                CheckMicPermission();

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.solution,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                UpdateAdapter();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanRelationshipsDialogSetActSpin), "ProblemSolvingActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedItemIndex = savedInstanceState.GetInt("selectedItemIndex");
                    _hotThoughtId      = savedInstanceState.GetInt("hotThoughtID");
                }

                SetContentView(Resource.Layout.EvidenceForHotThought);

                GetFieldComponents();

                CheckMicPermission();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.evidenceForToolbar, Resource.String.evidenceForHeading, Color.White);

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.evidence,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                GetHotThoughtText();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateForHotThought), "ThoughtRecordWizardEvidenceForHotThoughtStep.OnCreate");
                }
            }
        }
Beispiel #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedGroupPosition = savedInstanceState.GetInt("selectedGroupPosition");
                }

                SetContentView(Resource.Layout.ActivitiesLayout);

                GetFieldComponents();

                CheckMicPermission();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.activitiesToolbar, Resource.String.ActivitiesActionBarTitle, Color.White);

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.activities,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                UpdateAdapter();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorActivityCreate), "ActivitiesActivity.OnCreate");
                }
            }
        }
Beispiel #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedItemIndex = savedInstanceState.GetInt("selectedItemIndex");
                    _listItemSelected  = savedInstanceState.GetInt("listItemSelected");
                    _settingMenuItems  = savedInstanceState.GetBoolean("settingMenuItems");
                }

                SetContentView(Resource.Layout.ContactLayout);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.contactToolbar, Resource.String.safetyPlanWhoCanIRingActivityTitle, Color.White);

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.contacts,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                UpdateAdapter();
            }
            catch (System.Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreatingContactActivity), "ContactActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            try
            {
                SetContentView(Resource.Layout.Main2);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.my_toolbar, Resource.String.MainScreenActionBarTitle, Color.White);

                _toolbar.SetLogo(Resource.Drawable.ic_launcher);

                GetFieldComponents();

                if (_viewPager != null)
                {
                    _viewPager.Adapter            = new MainPagerAdapter(SupportFragmentManager);
                    _viewPager.OffscreenPageLimit = 2;
                }

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.mainbkgrnd4,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                GetOwnerInfo();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateMainActivity), "MainActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _listDate = Convert.ToDateTime(savedInstanceState.GetString("listDate"));
                }
                else
                {
                    if (Intent.HasExtra("RecordDate"))
                    {
                        _listDate = Convert.ToDateTime(Intent.Extras.GetString("RecordDate"));
                    }
                    else
                    {
                        _listDate = DateTime.Now;
                    }
                }

                SetContentView(Resource.Layout.ViewThoughtRecordsLayout);

                GetFieldComponents();

                SetupCallbacks();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.viewThoughtRecordsToolbar, Resource.String.ViewThoughRecordsActionBarTitle, Color.White);

                if (_selectedDateText != null)
                {
                    _selectedDateText.Text = _listDate.ToShortDateString();
                }

                LoadThoughtRecords();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateViewThoughtsActivity), "ViewThoughtsActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _fromDate = Convert.ToDateTime(savedInstanceState.GetString("fromDate"));
                    _toDate   = Convert.ToDateTime(savedInstanceState.GetString("toDate"));
                }
                SetContentView(Resource.Layout.ThoughtRecordMainMenu);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.thoughtRecordMainMenuToolbar, Resource.String.ThoughtRecordsActionBarTitle, Color.White);

                SetupButtonHooks();

                if (_spokenWord == null)
                {
                    _spokenWord = new TextToSpeech(this, this);
                }

                _fromDate = DateTime.Now.AddDays(-7);
                _toDate   = DateTime.Now;

                if (_selectedToDateLabel != null)
                {
                    _selectedToDateLabel.Text = _toDate.ToShortDateString();
                }
                if (_selectedFromDateLabel != null)
                {
                    _selectedFromDateLabel.Text = _fromDate.ToShortDateString();
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreatingThoughtRecordActivity), "ThoughtRecordActivity.OnCreate");
                }
            }
        }
Beispiel #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedItemIndex = savedInstanceState.GetInt("selectedItemIndex");
                    _problemIdeaID     = savedInstanceState.GetInt("problemIdeaID");
                    _ideaText          = savedInstanceState.GetString("ideaText");
                }
                else
                {
                    _problemIdeaID = Intent.GetIntExtra("problemIdeaID", -1);
                    _ideaText      = Intent.GetStringExtra("problemIdeaText");
                }

                SetContentView(Resource.Layout.SolutionPlanLayout);
                Log.Info(TAG, "OnCreate: Set content view successfully, problemIdeaID - " + _problemIdeaID.ToString() + ", problemIdeaText - " + _ideaText);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.solutionPlanToolbar, Resource.String.SolutionReviewToolbarTitle, Color.White);

                GetFieldComponents();

                CheckMicPermission();

                SetupCallbacks();

                if (_problemIdeaID != -1)
                {
                    _problemIdeaText.Text = _ideaText.Trim();
                }

                UpdateAdapter();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorSolutionPlanActivityCreateView), "SolutionPlanActivity.OnCreate");
                }
            }
        }
Beispiel #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.StructuredPlanLayout);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.modalPlanToolbar, Resource.String.ModalPlanActionBarTitle, Color.White);

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.structuredplanmain,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                if (_viewPager != null)
                {
                    _viewPager.Adapter            = new StructuredPlanPagerAdapter(SupportFragmentManager);
                    _viewPager.OffscreenPageLimit = 2;
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateModalPlanActivity), "StructuredPlanActivity.OnCreate");
                }
            }
        }
Beispiel #13
0
        public CustomerListPage()
        {
            InitializeComponent();

            BindingContext = VM = new CustomerListViewModel();

            // handle auth login/logout

            var tbLoginOut = ToolbarHelper.GenerateToolbarButton("Auth", new Command(async() =>
            {
                if (Settings.AzureADUserInfo != null)
                {
                    // logout
                    new AuthenticationContext(Settings.AzureADAuthority).TokenCache.Clear();

                    DependencyService.Get <IAuthenticator>().ClearCookies();

                    VM.CustomerList.Clear();
                    Settings.AzureADUserInfo = null;

                    await ToastHelper.Success("Logged Out!");
                }
                else
                {
                    // login
                    try
                    {
                        await D365AuthHelper.GetAuthorizationHeader();
                    }
                    catch (Exception ex)
                    {
                        await DisplayAlert("Authentication Error", ex.Message, "Ok");
                        return;
                    }

                    await VM.ExecuteLoadCustomersCommand();

                    await ToastHelper.Success("Customers Loaded!");
                }
            }));

            ToolbarItems.Add(tbLoginOut);
        }
Beispiel #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SummaryLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.summarytoolbar, Resource.String.SummaryTitle, Color.White);

            GetFieldComponents();

            _imageLoader = ImageLoader.Instance;

            _isLoadingBackground = true;
            _imageLoader.LoadImage
            (
                "drawable://" + Resource.Drawable.summarymain,
                new ImageLoadingListener
                (
                    loadingComplete: (imageUri, view, loadedImage) =>
            {
                var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                ImageLoader_LoadingComplete(null, args);
            }
                )
            );

            SetupCallbacks();

            GetPositivePictureForToday();
            if (_currentPictureUri == "")
            {
                if (_happyPicture != null)
                {
                    _happyPicture.Text = GetString(Resource.String.SummaryNoImages);
                }
            }

            SetupWeeksProgress();

            SetupRandomNotification();

            GetRandomMusicTrack();
        }
 private void GetElements(View view)
 {
     ordersViewPager = view.FindViewById<ViewPager>(Resource.Id.ordersViewPager);
     ci = view.FindViewById<CircleIndicator>(Resource.Id.indicator_default);
     ordersViewPager.PageSelected += (s, e) =>
     {
         switch (e.Position)
         {
             case 0:
                 ToolbarHelper.SetToolbarStyle($"Активные заказы", false);
                 break;
             case 1:
                 ToolbarHelper.SetToolbarStyle($"Предзаказы", false);
                 break;
             case 2:
                 ToolbarHelper.SetToolbarStyle($"Черновики", false);
                 break;
         }
     };
 }
Beispiel #16
0
        public override void OnWindowFocusChanged(bool hasFocus)
        {
            base.OnWindowFocusChanged(hasFocus);

            if (MainHeaderBottom <= 0)
            {
                var   llTabContainer = FindViewById <View>(Resource.Id.llTabContainer);
                int[] locations      = new int[2];
                llTabContainer.GetLocationInWindow(locations);
                MainHeaderBottom = locations[1] - StatusBarTintHelper.GetStatusBarHeight();

                var flToolbarBottom = FindViewById <FrameLayout>(Resource.Id.flToolbarBottom);
                flToolbarBottom.GetLocationInWindow(locations);
                ToolbarHelper.SetToolbarHeight(locations[1] - StatusBarTintHelper.GetStatusBarHeight());
            }

            llHeader.LayoutParameters.Height = MainHeaderBottom
                                               + StatusBarTintHelper.GetStatusBarHeight()
                                               + (int)MainApp.ThisApp.Resources.GetDimension(Resource.Dimension.fixedbar_height);
        }
Beispiel #17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.AnxietyLayout);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.anxietyToolbar, Resource.String.AnxietyActionBarTitle, Color.White);
                GetFieldComponents();
                SetupCallbacks();
            }
            catch (System.Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateAnxietyActivity), "AnxietyActivity.OnCreate");
                }
            }
        }
        /// <summary>
        /// 获取当前用户当前页面可访问的按钮
        /// </summary>
        /// <param name="menuCode"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public WebFxsResult <string> GetButtonByUserIdAndMenuCode(string menuCode, string pageName, int userId)
        {
            var result = new WebFxsResult <string>
            {
                ReturnCode = Entity.ReturnCodeType.Error,
                Content    = string.Empty
            };
            var buttons = repository.GetButtonByUserIdAndMenuCode(menuCode, userId);

            if (buttons.HasValue())
            {
                //构造json
                var dt = buttons.ToDataTable();
                result.Content = ToolbarHelper.GetToolBar(dt, pageName);
                if (!result.Content.IsNullOrEmpty())
                {
                    result.ReturnCode = Entity.ReturnCodeType.Success;
                }
            }

            return(result);
        }
Beispiel #19
0
        public ActionResult GetButtonsByUserIdAndMenuCode(string menuCode, string pageName)
        {
            if (menuCode.IsNullOrEmpty())
            {
                throw new ArgumentNullException("menuCode");
            }
            if (pageName.IsNullOrEmpty())
            {
                throw new ArgumentNullException("pageName");
            }

            var result = string.Empty;
            var rs     = _orgService.GetButtonsByUserIdAndMenuCode(menuCode, loginInfo.Id);

            if (rs.ReturnCode == ReturnCodeType.Success)
            {
                var dt = rs.Content.ToDataTable();
                result = ToolbarHelper.GetToolBar(dt, pageName);
            }

            return(Content(result));
        }
        public SettingsPage()
        {
            InitializeComponent();

            Title = "Settings";

            D365URL.Text          = Settings.D365URL;
            AzureADClientId.Text  = Settings.AzureADClientId;
            AzureADAuthority.Text = Settings.AzureADAuthority;
            AzureADReturnURL.Text = Settings.AzureADReturnURL;

            var tbSave = ToolbarHelper.GenerateToolbarButton("Save", new Command(async() =>
            {
                var isValidUrl = AppUtils.IsValidUrl(D365URL.Text);
                if (!isValidUrl)
                {
                    await DisplayAlert("Error", "Invalid D365 Url.", "Ok");
                    return;
                }

                isValidUrl = AppUtils.IsValidUrl(AzureADAuthority.Text);
                if (!isValidUrl)
                {
                    await DisplayAlert("Error", "Invalid Azure AD Authority Url.", "Ok");
                    return;
                }

                // update settings
                Settings.D365URL          = D365URL.Text;
                Settings.AzureADClientId  = AzureADClientId.Text;
                Settings.AzureADAuthority = AzureADAuthority.Text;
                Settings.AzureADReturnURL = AzureADReturnURL.Text;

                await Navigation.PopModalAsync();
            }));

            ToolbarItems.Add(tbSave);
        }
Beispiel #21
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            ToolbarHelper.ShowToolbar(Activity, "Settings");
            ToolbarHelper.ShowToolbarBackButton(Activity);

            SetUpRecyclerView();

            var stayActive = PreferenceManager.FindPreference("stay_active");

            if (stayActive != null)
            {
                stayActive.PreferenceChange += StayActive_PreferenceChange;
            }

            var viewDebugLog = PreferenceManager.FindPreference("view_debug_log");

            if (viewDebugLog != null)
            {
                viewDebugLog.PreferenceClick += ViewDebugLog_PreferenceClick;
            }

            var resetDefaults = PreferenceManager.FindPreference("reset_defaults");

            if (resetDefaults != null)
            {
                resetDefaults.PreferenceClick += ResetDefaults_PreferenceClick;
            }

            var version = PreferenceManager.FindPreference("version");

            if (version != null)
            {
                version.Summary = Activity.PackageManager.GetPackageInfo(Activity.PackageName, 0).VersionName;
            }
        }
Beispiel #22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.MyProgressLayout);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.myProgressToolbar, Resource.String.MyProgressToolbarTitle, Color.White);

                _chartHelper = new ProgressChartHelper(this, _progressLineChartContainer, _progressChart);

                _progressLineChartContainer = _chartHelper.SetupLineChart();

                var startDate = Intent.Extras.GetString("StartDate");
                Log.Info(TAG, "OnCreate: Start date for chart data - " + startDate);
                var endDate = Intent.Extras.GetString("EndDate");
                Log.Info(TAG, "OnCreate: End date for chart data - " + endDate);
                var actualStartDate = Convert.ToDateTime(startDate);
                var actualEndDate   = Convert.ToDateTime(endDate);

                _progressChart = _chartHelper.SetupChartData(actualStartDate, actualEndDate);

                Log.Info(TAG, "OnCreate: Successful completion");
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, "Creating Activity", "MyProgressActivity.OnCreate");
                }
            }
        }
        private void SetToolbar()
        {
            ToolBarButton sep = new ToolBarButton();

            sep.Style = ToolBarButtonStyle.Separator;

            #region cmdButtons   - Buttons [0~3]
            toolBar.Buttons.Add(new ToolBarButton("Columns", string.Empty));
            toolBar.Buttons[0].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-view-column-outline.png");
            toolBar.Buttons[0].ToolTipText = (@"Hide/Unhide Columns");
            toolBar.Buttons.Add(new ToolBarButton("Sorting", String.Empty));
            toolBar.Buttons[1].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-sort-ascending.png");
            toolBar.Buttons[1].ToolTipText = (@"Sorting");
            toolBar.Buttons.Add(new ToolBarButton("Checkbox", String.Empty));
            toolBar.Buttons[2].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-check-box-outline.png");
            toolBar.Buttons[2].ToolTipText = (@"Toggle Checkbox");
            toolBar.Buttons.Add(new ToolBarButton("MultiSelect", String.Empty));
            toolBar.Buttons[3].Image       = new IconResourceHandle(GlobalVars.Theme + ".16.listview_multiselect.gif");
            toolBar.Buttons[3].ToolTipText = (@"Toggle Multi-Select");
            toolBar.Buttons[3].Visible     = false;
            #endregion

            toolBar.Buttons.Add(sep);

            #region cmdViews    - Buttons[5]
            ContextMenu ddlViews = new ContextMenu();
            ToolbarHelper.AppendMenuItem_AppViews(ref ddlViews);
            ToolBarButton cmdViews = new ToolBarButton("Views", ("View"));
            cmdViews.Style        = ToolBarButtonStyle.DropDownButton;
            cmdViews.Image        = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-eye.png");
            cmdViews.DropDownMenu = ddlViews;
            toolBar.Buttons.Add(cmdViews);
            cmdViews.MenuClick += new MenuEventHandler(toolBar_Views_MenuClick);
            #endregion

            #region cmdPreference    - Buttons[6]
            ContextMenu ddlPreference = new ContextMenu();
            ToolbarHelper.AppendMenuItem_AppPref(ref ddlPreference);

            ToolBarButton cmdPreference = new ToolBarButton("Preference", ("Preference"));
            cmdPreference.Style        = ToolBarButtonStyle.DropDownButton;
            cmdPreference.Image        = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-table-heart.png");
            cmdPreference.DropDownMenu = ddlPreference;
            cmdPreference.MenuClick   += new MenuEventHandler(toolBar_Preference_MenuClick);

            toolBar.Buttons.Add(cmdPreference);
            #endregion

            toolBar.Buttons.Add(sep);

            #region cmdRefresh cmdEditStoreGroups cmdNewStoreGroup cmdEditStoreGroup
            var cmdRefresh = new ToolBarButton("Refresh", ("Refresh"));
            cmdRefresh.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-reload.png");

            toolBar.Buttons.Add(cmdRefresh);
            toolBar.Buttons.Add(sep);

            var cmdImport = new ToolBarButton("Import", ("Import Application Groups"));
            cmdImport.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-import.png");

            var cmdNewApplicationGroup = new ToolBarButton("NewApplicationGroup", ("New Applcation Group"));
            cmdNewApplicationGroup.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-account-multiple-plus.png");

            ToolBarButton cmdEditApplicationGroup = new ToolBarButton("EditApplicationGroup", ("Edit Application Group"));
            cmdEditApplicationGroup.Image   = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-file-document-edit-outline.png");
            cmdEditApplicationGroup.Enabled = false;

            toolBar.Buttons.Add(cmdImport);
            toolBar.Buttons.Add(sep);
            toolBar.Buttons.Add(cmdNewApplicationGroup);
            toolBar.Buttons.Add(sep);
            toolBar.Buttons.Add(cmdEditApplicationGroup);
            #endregion

            toolBar.TextAlign    = ToolBarTextAlign.Right;
            toolBar.ButtonClick += toolBar_ButtonClick;
        }
Beispiel #24
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.MedicationMainLayout);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.medicationMainToolbar, Resource.String.MedicationToolbarTitle, Color.White);

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.medication,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                CheckMicPermission();

                if (Intent != null)
                {
                    if (Intent.HasExtra("title"))
                    {
                        _title = Intent.GetStringExtra("title");
                    }

                    if (Intent.HasExtra("isNew"))
                    {
                        _isNew = Intent.GetBooleanExtra("isNew", true);
                    }

                    if (Intent.HasExtra("medicationID"))
                    {
                        _medicationID = Intent.GetIntExtra("medicationID", -1);
                    }

                    if (_medicationID != -1)
                    {
                        _medication = GlobalData.MedicationItems.Find(med => med.ID == _medicationID);
                    }
                }

                if (_medication == null)
                {
                    _medication = new Medication();
                }

                UpdateAdapter();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert((Activity)this, e, "Failed creating Medication Main Activity", "MedicationPagerAdapter.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            bool configurationChange = false;

            SetContentView(Resource.Layout.MusicPlayListTracksLayout);
            Log.Info(TAG, "OnCreate: - checking for ReadExternalStorage permission");
            CheckReadExternalStoragePermission();

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedListItemIndex = savedInstanceState.GetInt("selectedItemIndex");
                    Log.Info(TAG, "OnCreate: - savedInstanceState value - selectedItemIndex - " + _selectedListItemIndex.ToString());
                    _playListID = savedInstanceState.GetInt("playListID");
                    Log.Info(TAG, "OnCreate: - savedInstanceState value - playListID - " + _playListID.ToString());
                    _isPaused = savedInstanceState.GetBoolean("isPaused");
                    Log.Info(TAG, "OnCreate: - savedInstanceState value - isPaused - " + (_isPaused?"True":"False"));
                    _isPlaying = savedInstanceState.GetBoolean("isPlaying");
                    Log.Info(TAG, "OnCreate: - savedInstanceState value - isPlaying - " + (_isPlaying?"True":"False"));
                    if (_isPlaying || _isPaused)
                    {
                        _currentTrackPosition = savedInstanceState.GetInt("trackPosition");
                        Log.Info(TAG, "OnCreate: isPlaying, currentTrackPosition - " + _currentTrackPosition.ToString());
                    }
                    configurationChange = true;
                }
                if ((Intent != null && Intent.HasExtra("selectedIndex")))
                {
                    _selectedListItemIndex = Intent.GetIntExtra("selectedIndex", -1);
                }
                Log.Info(TAG, "OnCreate: _selectedListItemIndex is " + _selectedListItemIndex.ToString());
                GetFieldComponents();

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.cds,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                if (Intent != null && Intent.HasExtra("playListID"))
                {
                    _playListID = Intent.GetIntExtra("playListID", -1);
                    Log.Info(TAG, "OnCreate: playListID - " + _playListID.ToString());
                }

                PlayList playList = GlobalData.PlayListItems.Find(play => play.PlayListID == _playListID);
                if (playList != null)
                {
                    _playListName.Text = playList.PlayListName.Trim();
                }


                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.musicTrackListToolbar, Resource.String.MusicPlayListTracksToolbarTitle, Color.White);

                if (_trackProgress != null)
                {
                    //change the colour of the progressbar (primary progress is on layer 2, layer 0 is background, layer 1 is secondary progress)
                    LayerDrawable layers = (LayerDrawable)_trackProgress.ProgressDrawable;
                    layers.GetDrawable(0).SetColorFilter(Color.LightBlue, PorterDuff.Mode.SrcIn);
                    layers.GetDrawable(2).SetColorFilter(Color.DarkBlue, PorterDuff.Mode.SrcIn);
                }

                UpdateAdapter();

                SetupMediaPlayer();

                //do we have permission to play at this time?
                if (PermissionsHelper.HasPermission(this, ConstantsAndTypes.AppPermission.ReadExternalStorage))
                {
                    Log.Info(TAG, "OnCreate: Permission to read external storage is true");
                    if (_selectedListItemIndex != -1)
                    {
                        Log.Info(TAG, "OnCreate: isPlaying, calling Play_Click, selectedListItemIndex - " + _selectedListItemIndex.ToString());
                        Play_Click(null, null);
                    }
                    else
                    {
                        Log.Info(TAG, "OnCreate: No selected index (-1), configurationChange is " + (configurationChange ? "True" : "False") + ", _isPlaying is " + (_isPlaying ? "True" : "False") + ", _isPaused is " + (_isPaused ? "True" : "False"));
                        if (configurationChange && (_isPlaying || _isPaused))
                        {
                            Play_Click(null, null);
                        }
                    }
                }
                else
                {
                    Log.Info(TAG, "OnCreate: Permission to read external storage is FALSE");
                }
            }
            catch (System.Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorMusicPlayListTracksActivityCreate), "MusicPlayListTracksActivity.OnCreate");
                }
            }
        }
Beispiel #26
0
 private void SetupToolbar()
 {
     _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.chuffChartToolbar, Resource.String.AchievementChartTitle, Color.White);
 }
Beispiel #27
0
        private void SetToolbar()
        {
            ToolBarButton sep = new ToolBarButton();

            sep.Style = ToolBarButtonStyle.Separator;

            #region cmdButtons   - Buttons [0~3]
            toolBar.Buttons.Add(new ToolBarButton("Columns", string.Empty));
            toolBar.Buttons[0].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-view-column-outline.png");
            toolBar.Buttons[0].ToolTipText = (@"Hide/Unhide Columns");
            toolBar.Buttons.Add(new ToolBarButton("Sorting", String.Empty));
            toolBar.Buttons[1].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-sort-ascending.png");
            toolBar.Buttons[1].ToolTipText = (@"Sorting");
            toolBar.Buttons.Add(new ToolBarButton("Checkbox", String.Empty));
            toolBar.Buttons[2].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-check-box-outline.png");
            toolBar.Buttons[2].ToolTipText = (@"Toggle Checkbox");
            toolBar.Buttons.Add(new ToolBarButton("MultiSelect", String.Empty));
            toolBar.Buttons[3].Image       = new IconResourceHandle(GlobalVars.Theme + ".16.listview_multiselect.gif");
            toolBar.Buttons[3].ToolTipText = (@"Toggle Multi-Select");
            toolBar.Buttons[3].Visible     = false;
            #endregion

            toolBar.Buttons.Add(sep);

            #region cmdViews    - Buttons[5]
            ContextMenu ddlViews = new ContextMenu();
            ToolbarHelper.AppendMenuItem_AppViews(ref ddlViews);
            ToolBarButton cmdViews = new ToolBarButton("Views", ("View"));
            cmdViews.Style        = ToolBarButtonStyle.DropDownButton;
            cmdViews.Image        = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-eye.png");
            cmdViews.DropDownMenu = ddlViews;
            toolBar.Buttons.Add(cmdViews);
            cmdViews.MenuClick += new MenuEventHandler(toolBar_Views_MenuClick);
            #endregion

            #region cmdPreference    - Buttons[6]
            ContextMenu ddlPreference = new ContextMenu();
            ToolbarHelper.AppendMenuItem_AppPref(ref ddlPreference);

            ToolBarButton cmdPreference = new ToolBarButton("Preference", ("Preference"));
            cmdPreference.Style        = ToolBarButtonStyle.DropDownButton;
            cmdPreference.Image        = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-table-heart.png");
            cmdPreference.DropDownMenu = ddlPreference;
            cmdPreference.MenuClick   += new MenuEventHandler(toolBar_Preference_MenuClick);

            toolBar.Buttons.Add(cmdPreference);
            #endregion

            toolBar.Buttons.Add(sep);

            #region cmdRefresh
            var cmdRefresh = new ToolBarButton("Refresh", ("Refresh"));
            cmdRefresh.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-reload.png");

            toolBar.Buttons.Add(cmdRefresh);

            //toolBar.Buttons.Add(sep);

            //var cmdStoreProperties = new ToolBarButton("StoreProperties", ("Store Properties"));
            //cmdStoreProperties.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-domain.png");

            //toolBar.Buttons.Add(cmdStoreProperties);

            //var cmdNewOperation = new ToolBarButton("NewOperation", ("New Operation"));
            //cmdNewOperation.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-folder-plus-outline.png");

            //toolBar.Buttons.Add(cmdNewOperation);
            #endregion

            toolBar.Buttons.Add(sep);

            #region Edit
            ToolBarButton cmdManageAuth = new ToolBarButton("ManageAuthorization", ("Manage Authorization"));
            cmdManageAuth.Image   = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-shield-account.png");
            cmdManageAuth.Enabled = false;

            toolBar.Buttons.Add(cmdManageAuth);
            #endregion

            toolBar.TextAlign    = ToolBarTextAlign.Right;
            toolBar.ButtonClick += toolBar_ButtonClick;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.ResourcesAppointmentActivityLayout);

                GetFieldComponents();

                CheckMicPermission();

                if (Intent != null)
                {
                    if (Intent.HasExtra("appointmentDate"))
                    {
                        if (_appointmentDate != null)
                        {
                            _appointmentDate.Text = Intent.GetStringExtra("appointmentDate");
                        }
                    }
                    if (Intent.HasExtra("appointmentStatus"))
                    {
                        _status = Intent.GetIntExtra("appointmentStatus", STATUS_NEW);
                    }
                    if (Intent.HasExtra("appointmentID"))
                    {
                        _appointmentID = Intent.GetIntExtra("appointmentID", -1);
                    }
                    if (Intent.HasExtra("appointmentTime"))
                    {
                        _appointmentDateTime    = Convert.ToDateTime(Intent.GetStringExtra("appointmentTime"));
                        _timeOfAppointment.Text = _appointmentDateTime.ToShortTimeString();
                    }
                }
                else
                {
                    _dateOfAppointment = DateTime.Today;
                    if (_appointmentDate != null)
                    {
                        _appointmentDate.Text = _dateOfAppointment.ToLongDateString();
                    }
                    _status        = STATUS_NEW;
                    _appointmentID = -1;
                }

                SetupCallbacks();

                SetupAppointmentTypeSpinner();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.appointmentToolbar, Resource.String.AppointmentSingleTitle, Color.White);

                if (_status == STATUS_EDIT)
                {
                    LoadAppointment();
                    DisplayAppointment();
                    UpdateAdapter();
                }
                else
                {
                    _appointment = new Appointments();
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, "Creating Appointment item activity", "ResourcesAppointmentItemActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _firstTimeShow    = true;
                    _problemIdeaID    = savedInstanceState.GetInt("problemIdeaID");
                    _solutionReviewID = savedInstanceState.GetInt("solutionReviewID");
                    _isDirty          = savedInstanceState.GetBoolean("isDirty");
                }
                else
                {
                    _problemIdeaID = Intent.GetIntExtra("problemIdeaID", -1);
                }

                GetIdeaData();
                GetSolutionReviewData();

                SetContentView(Resource.Layout.SolutionReviewActivityLayout);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.solutionReviewToolbar, Resource.String.SolutionIdeasReviewToolbarTitle, Color.White);

                GetFieldComponents();

                CheckMicPermission();

                SetupCallbacks();

                if (_firstTimeShow)
                {
                    if (_idea != null)
                    {
                        if (_problemIdea != null)
                        {
                            _problemIdea.Text = _idea.ProblemIdeaText.Trim();
                        }
                        else
                        {
                            Log.Error(TAG, "OnCreate: _problemIdea is NULL!");
                        }
                    }
                    else
                    {
                        Log.Error(TAG, "OnCreate: _idea is NULL!");
                    }

                    if (_review != null)
                    {
                        if (_solutionReviewID != -1)
                        {
                            if (_solutionReview != null)
                            {
                                _solutionReview.Text = _review.ReviewText.Trim();
                            }
                            else
                            {
                                Log.Error(TAG, "OnCreate: _solutionReview is NULL!");
                            }
                            if (_achieved != null && _notAchieved != null)
                            {
                                if (_review.Achieved)
                                {
                                    _achieved.Checked    = true;
                                    _notAchieved.Checked = false;
                                }
                                else
                                {
                                    _achieved.Checked    = false;
                                    _notAchieved.Checked = true;
                                }
                            }
                            else
                            {
                                Log.Error(TAG, "OnCreate: _achieved or _notAchieved is NULL!");
                            }
                            if (_achievedDate != null)
                            {
                                _achievedDate.DateTime = _review.AchievedDate;
                            }
                            else
                            {
                                Log.Error(TAG, "OnCreate: _achievedDate is NULL!");
                            }
                        }
                    }
                    else
                    {
                        Log.Error(TAG, "OnCreate: _review is NULL!");
                    }
                    _firstTimeShow = false;
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorSolutionReviewActivityCreateView), "SolutionReviewActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _selectedItemIndex = savedInstanceState.GetInt("selectedItemIndex");
                    _problemID         = savedInstanceState.GetInt("problemID");
                    _problemStepID     = savedInstanceState.GetInt("problemStepID");
                    _stepText          = savedInstanceState.GetString("stepText");
                }
                else
                {
                    _problemStepID = Intent.GetIntExtra("problemStepID", -1);
                    _problemID     = Intent.GetIntExtra("problemID", -1);
                    _stepText      = Intent.GetStringExtra("problemStepText");
                }
                SetContentView(Resource.Layout.ProblemSolvingIdeasLayout);
                Log.Info(TAG, "OnCreate: Set content view successfully, problemID - " + _problemID.ToString() + ", problemStepID - " + _problemStepID.ToString() + ", problemStepText - " + _stepText);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.problemSolvingIdeasToolbar, Resource.String.ProblemSolvingIdeasToolbarTitle, Color.White);

                GetFieldComponents();

                CheckMicPermission();

                _imageLoader = ImageLoader.Instance;

                _imageLoader.LoadImage
                (
                    "drawable://" + Resource.Drawable.problemsteps,
                    new ImageLoadingListener
                    (
                        loadingComplete: (imageUri, view, loadedImage) =>
                {
                    var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                    ImageLoader_LoadingComplete(null, args);
                }
                    )
                );

                SetupCallbacks();

                if (_problemStepID != -1)
                {
                    _problemStepText.Text = _stepText.Trim();
                }

                if (IsProblemSolved())
                {
                    InflateResolved();
                }

                UpdateAdapter();
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorProblemSolvingIdeasActivityCreateView), "ProblemSolvingIdeasActivity.OnCreate");
                }
            }
        }