Пример #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();
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

                SetContentView(Resource.Layout.AchievementChartLayout);

                GetFieldComponents();

                CheckMicPermission();

                SetupToolbar();

                _imageLoader = ImageLoader.Instance;

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

                SetupCallbacks();

                if (_selectedDate != null)
                {
                    _selectedDate.Text = DateTime.Now.ToShortDateString();
                }

                GetDataForDate();

                UpdateAdapter();

                if (_selectedItemIndex != -1)
                {
                    _achievementList.SetSelection(_selectedItemIndex);
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreate: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorCreateChuffChartActivity), "AchievementChartActivity.OnCreate");
                }
            }
        }
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_safetyCardStack != null)
            {
                _safetyCardStack.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_problemSolvingReviewScrollerContainer != null)
            {
                _problemSolvingReviewScrollerContainer.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
        private void ImageLoader_CdsLoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_linMusic != null)
            {
                _linMusic.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
Пример #7
0
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_automaticThoughtsRoot != null)
            {
                _automaticThoughtsRoot.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
Пример #8
0
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_listTellMyself != null)
            {
                _listTellMyself.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_alternativeThoughtsMain != null)
            {
                _alternativeThoughtsMain.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_linAttitudesListMain != null)
            {
                _linAttitudesListMain.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_linStructuredPlanRelationshipsMain != null)
            {
                _linStructuredPlanRelationshipsMain.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
Пример #12
0
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_problemList != null)
            {
                _problemList.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
Пример #13
0
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_activitiesWeek != null)
            {
                _activitiesWeek.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
Пример #14
0
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            var bitmap = e.LoadedImage;

            if (_linMedicationTypes != null)
            {
                _linMedicationTypes.SetBackgroundDrawable(new BitmapDrawable(bitmap));
            }
        }
Пример #15
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");
                }
            }
        }
        public void OnPageSelected(int position)
        {
            int picResource = -1;

            if (_continue != null)
            {
                switch (position)
                {
                case FIRST_PAGE:
                    _continue.Visibility = ViewStates.Invisible;
                    picResource          = Resource.Drawable.whatsituation;
                    break;

                case SECOND_PAGE:
                    _continue.Visibility = ViewStates.Invisible;
                    picResource          = Resource.Drawable.whosituation;
                    break;

                case THIRD_PAGE:
                    _continue.Visibility = ViewStates.Invisible;
                    picResource          = Resource.Drawable.wheresituation;
                    break;

                case LAST_PAGE:
                    _continue.Visibility = ViewStates.Visible;
                    picResource          = Resource.Drawable.whensituation;
                    break;
                }

                if (picResource != -1)
                {
                    if (_viewPager != null)
                    {
                        _imageLoader = ImageLoader.Instance;

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

            _currentPage = position;
        }
        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");
                }
            }
        }
Пример #18
0
        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");
                }
            }
        }
Пример #19
0
        private void ImageLoader_LoadingComplete(object sender, LoadingCompleteEventArgs e)
        {
            if (_isLoadingBackground)
            {
                var bitmap = e.LoadedImage;

                if (_summaryMain != null)
                {
                    _summaryMain.SetBackgroundDrawable(new BitmapDrawable(bitmap));
                }
                _isLoadingBackground = false;
            }
        }
        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");
                }
            }
        }
Пример #21
0
        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");
                }
            }
        }
Пример #22
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            try
            {
                if (convertView == null)
                {
                    if (_activity != null)
                    {
                        convertView = _activity.LayoutInflater.Inflate(Resource.Layout.MedicationTypeItemBody, null);
                    }
                }
                if (convertView != null)
                {
                    GetFieldComponents(convertView);
                    if (_typeTitle != null)
                    {
                        _typeTitle.Text = _medicationTypes[position].MedicationTypeTitle;
                    }
                    if (_typeDescription != null)
                    {
                        _typeDescription.Text = _medicationTypes[position].MedicationTypeDescription;
                    }
                    AddTypeItems(position);
                    _imageLoader = ImageLoader.Instance;

                    _imageLoader.LoadImage
                    (
                        "drawable://" + Resource.Drawable.variouspills,
                        new ImageLoadingListener
                        (
                            loadingComplete: (imageUri, view, loadedImage) =>
                    {
                        var args = new LoadingCompleteEventArgs(imageUri, view, loadedImage);
                        ImageLoader_LoadingComplete(null, args);
                    }
                        )
                    );
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "GetView: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(_activity, e, "Getting Medication view", "ResourceMedicationTypeAdapter.GetView");
                }
            }
            return(convertView);
        }
Пример #23
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");
                }
            }
        }
Пример #25
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");
                }
            }
        }
Пример #26
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");
                }
            }
        }
Пример #27
0
        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");
                }
            }
        }
Пример #28
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");
                }
            }
        }
Пример #29
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();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            try
            {
                if (savedInstanceState != null)
                {
                    _firstTimeView    = savedInstanceState.GetBoolean("firstTimeView");
                    _relationshipsID  = savedInstanceState.GetInt("relationshipsID");
                    _dialogTitle      = savedInstanceState.GetString("dialogTitle");
                    _currentSpeakType = savedInstanceState.GetInt("currentSpeakType");
                }
                if (Intent != null)
                {
                    _relationshipsID = Intent.GetIntExtra("relationshipsID", -1);
                    _dialogTitle     = Intent.GetStringExtra("activityTitle");
                }

                SetContentView(Resource.Layout.StructuredPlanRelationshipsDialogActivityLayout);

                GetFieldComponents();
                CheckMicPermission();

                _toolbar = ToolbarHelper.SetupToolbar(this, Resource.Id.structuredplanrelationshipsdialogactivitylayoutToolbar, Resource.String.StructuredPlanRelationshipsActivityTitle, Color.White);

                _imageLoader = ImageLoader.Instance;

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

                SetupCallbacks();

                GetRelationshipsData();

                SetupSpinners();

                if (_relationshipsID != -1 && _relationships != null)
                {
                    if (_firstTimeView)
                    {
                        //existing item
                        if (_withWhom != null)
                        {
                            _withWhom.Text = _relationships.WithWhom.Trim();
                        }
                        if (_type != null)
                        {
                            _type.SetSelection((int)_relationships.Type);
                        }
                        if (_strength != null)
                        {
                            _strength.Progress = _relationships.Strength;
                        }
                        if (_feeling != null)
                        {
                            _feeling.SetSelection(_relationships.Feeling);
                        }
                        if (_action != null)
                        {
                            _action.SetSelection((int)_relationships.Action);
                        }
                        if (_actionOf != null)
                        {
                            _actionOf.Text = _relationships.ActionOf.Trim();
                        }
                        _firstTimeView = false;
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "OnCreateView: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorStructuredPlanRelationshipsDialogCreateView), "StructuredPlanRelationshipsDialogActivity.OnCreateView");
                }
            }
        }