Exemple #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.About);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.aboutToolbar, Resource.String.AboutTitle, Color.White);

            GetFieldComponents();

            _imageLoader = ImageLoader.Instance;

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

            SetupCallbacks();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ThoughtRecordMain);

            GetFieldComponents();

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.situationMainToolbar, Resource.String.situationHeading, Color.White);

            _imageLoader = ImageLoader.Instance;

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

            SetupCallbacks();

            CheckMicPermission();

            UpdateAdapter();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.situation);

                GetFieldComponents();

                CheckMicPermission();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.situationToolbar, Resource.String.situationHeading, Color.White);

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

                SetContentView(Resource.Layout.ResourceAppointmentPlanner);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.resourcesAppointmentPlannerToolbar, Resource.String.ResourcesAppointmentPlannerActionBarTitle, Color.White);

                SetupCallbacks();

                if (savedInstanceState != null)
                {
                    _currentMonth        = savedInstanceState.GetInt("currentMonth");
                    _isOrientationChange = true;
                }
                ViewTreeObserver observer = _gridCalendar.ViewTreeObserver;
                observer.GlobalLayout += (sender, args) =>
                {
                    SetupGrid(_gridCalendar.Height);
                    SetMonthYear();
                };
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, "Creating Activity", "ResourcesAppointmentPlannerActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.Settings);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.settingsToolbar, Resource.String.SettingsActionbarTitle, Color.White);

                GetFieldComponents();

                SetupCallbacks();

                SetupSpinners();

                GetSettings();

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

            SetContentView(Resource.Layout.ResourceUsefulServices);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.resourcesUsefulServicesToolbar, Resource.String.ResourcesUsefulServicesActionBarTitle, Color.White);
        }
Exemple #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.MoodsAdjustHelpLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.moodsAdjustHelpToolbar, Resource.String.MoodsAdjustHelpScreenTitle, Color.White);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ProblemSolvingHelpLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.problemSolvingHelpToolbar, Resource.String.ProblemSolvingHelpTitle, Color.White);
        }
Exemple #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

                SetContentView(Resource.Layout.RerateMoods);

                GetFieldComponents();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.reratemoodsToolbar, Resource.String.rerateHeading, Color.White);

                _imageLoader = ImageLoader.Instance;

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

                SetupCallbacks();

                SetupSpinner();

                if (savedInstanceState != null)
                {
                    UpdateAdapter();
                }
                else
                {
                    UpdateAdapter(true);
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateRerateMoodActivity), "ThoughtRecordWizardRerateMoodStep.OnCreate");
                }
            }
        }
Exemple #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ResourceStrategies);

            GetFieldComponents();
            SetupCallbacks();

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.resourcesStrategiesToolbar, Resource.String.ResourcesStrategiesActionBarTitle, Color.White);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.TreatmentStructuredPlanHelpLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.treatmentStructuredPlanHelpToolbar, Resource.String.TreatmentStructuredPlanHelpTitle, Color.White);

            GetFieldComponents();
            SetupCallbacks();
        }
Exemple #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ResourceMedication);

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

            GetFieldComponents();
            SetupCallbacks();
            UpdateAdapter();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

                SetContentView(Resource.Layout.WorkedPastLayout);

                GetFieldComponents();

                CheckMicPermission();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.workedPastToolbar, Resource.String.safetyPlanWorkedInThePastActivityTitle, Color.White);

                _imageLoader = ImageLoader.Instance;

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

                SetupCallbacks();

                UpdateAdapter();

                if (_selectedItemIndex != -1)
                {
                    _genericList.SetSelection(_selectedItemIndex);
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Error occurred during creation - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreatingWorkedPastActivity), "WorkedPastActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

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

                if (savedInstanceState != null)
                {
                    _problemID = savedInstanceState.GetInt("problemID");
                }
                else
                {
                    _problemID = Intent.GetIntExtra("problemID", -1);
                }

                GetFieldComponents();

                _imageLoader = ImageLoader.Instance;

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

                SetupCallbacks();

                GetProblemData();

                CreateViews(ProblemSolvingReviewHelper.ClearView.False);
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorProblemSolvingReviewActivityCreateView), "ProblemSolvingReviewActivity.OnCreate");
                }
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.MediaMusicTherapyHelpLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.mediaMusicTherapyHelpToolbar, Resource.String.MediaMusicTherapyHelpTitle, Color.White);
            _done    = FindViewById <Button>(Resource.Id.btnDone);
            if (_done != null)
            {
                _done.Click += Done_Click;
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                SetContentView(Resource.Layout.PersonalMediaLayout);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.personalMediaToolbar, Resource.String.PersonalMediaActionBarTitle, Color.White);

                GetFieldComponents();

                _imageLoader = ImageLoader.Instance;

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

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

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

            SetContentView(Resource.Layout.ThoughtsHelpLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.thoughtsHelpToolbar, Resource.String.ThoughtRecordsHelpTitle, Color.White);

            GetFIeldComponents();
            SetupCallbacks();
            _imageLoader = ImageLoader.Instance;

            SetupImages();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

                SetContentView(Resource.Layout.MedicationLayout);

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.medicationToolbar, Resource.String.MedicationActionBarTitle, Color.White);

                Log.Info(TAG, "OnCreate: Setup Action bar");

                GetFieldComponents();
                Log.Info(TAG, "OnCreate: Retrieved Field Components");

                _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();
                Log.Info(TAG, "OnCreate: Set up Callbacks");

                UpdateAdapter();
                Log.Info(TAG, "OnCreate: Updated adapter");
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorMedActivityCreate), "MedicationActivity.OnCreate");
                }
            }
        }
Exemple #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SafetyPlanSuicidalThoughtsHelpLayout);

            _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.safetyPlanSuicidalThoughtsHelpToolbar, Resource.String.StopSuicideHelpTitle, Color.White);

            _done = FindViewById <Button>(Resource.Id.btnDone);
            if (_done != null)
            {
                _done.Click += Done_Click;
            }
        }
Exemple #20
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");
                }
            }
        }
Exemple #22
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");
                }
            }
        }
Exemple #23
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");
                }
            }
        }
Exemple #24
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");
                }
            }
        }
        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 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");
                }
            }
        }
Exemple #27
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");
                }
            }
        }
        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");
                }
            }
        }
Exemple #29
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");
                }
            }
        }
Exemple #30
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();
        }