Ejemplo n.º 1
0
        private void GetFieldComponents()
        {
            try
            {
                _viewPager  = FindViewById <ViewPager>(Resource.Id.pagerMedicationMain);
                _titleStrip = FindViewById <PagerTitleStrip>(Resource.Id.pagerTitleMedicationMain);

                _doneButton   = FindViewById <Button>(Resource.Id.btnDone);
                _cancelButton = FindViewById <Button>(Resource.Id.btnCancel);
            }
            catch (Exception e)
            {
                Log.Error(TAG, "GetFieldComponents: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert((Activity)this, e, "Failed to retrieve field components", "MedicationPagerAdapter.GetFieldComponents");
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            int courseID = Intent.GetIntExtra("CourseID", 0);

            if (courseID > 0)
            {
                //courseName = Intent.GetStringExtra("CourseName") ?? "No data, why";
                course = CourseManager.GetCourse(courseID);
            }
            else
            {
            }

            // set our layout to be the home screen
            SetContentView(Resource.Layout.CourseDetailsView_Layout);



            // find all our controls
            courseNameValue     = FindViewById <TextView>(Resource.Id.CourseDetailsView_TextView_Name);
            courseParValue      = FindViewById <TextView>(Resource.Id.CourseDetailsView_TextView_Par);
            courseHolesValue    = FindViewById <TextView>(Resource.Id.CourseDetailsView_TextView_Holes);
            courseTees_ListView = FindViewById <ListView>(Resource.Id.CourseDetailsView_ListView_TeeSummary);
            addTeeButton        = FindViewById <Button>(Resource.Id.CourseDetailsView_Button_AddTee);
            linearLayout_CourseNameBasicInfo = FindViewById <LinearLayout>(Resource.Id.CourseDetailsView_LinearLayout_CourseNameBasicInfo);

            courseNameValue.Text  = course.CourseName;
            courseHolesValue.Text = course.Holes.ToString();
            courseParValue.Text   = course.Par.ToString();


            if (addTeeButton != null)
            {
                addTeeButton.Click += delegate {
                    var activity2 = new Intent(this, typeof(CourseTeeDetails_Code));
                    activity2.PutExtra("CourseName", courseNameValue.Text);
                    activity2.PutExtra("CourseID", course.ID);
                    StartActivity(activity2);
                };
            }


            Tasky.GlobalEntities.courseHoleByNumberListList    = HoleManager.GetCourseHolesByHole(course.ID);
            Tasky.GlobalEntities.courseHoleParByNumberListList = CourseHoleParManager.GetCourseHoleParsByHole(courseID);

            holesViewPager = FindViewById <ViewPager>(Resource.Id.CourseDetailsView_ViewPager_Holes);

            holesViewPager.AddOnPageChangeListener(this);

            pts            = FindViewById <PagerTitleStrip>(Resource.Id.CourseDetailsView_PagerTitleStrip);
            pts.LongClick += Pts_LongClick;



            //List<Tasky.CourseHoleByNumberList> chbnl = new List<Tasky.CourseHoleByNumberList>();
            chbnl = new List <Tasky.CourseHoleByNumberList>();

            foreach (Tasky.CourseHoleByNumberList chb in Tasky.GlobalEntities.courseHoleByNumberListList.CourseHoleDataLists)
            {
                chbnl.Add(chb);
            }

            //HoleDetailsAdapter hdAdapter = new HoleDetailsAdapter(SupportFragmentManager, chbnl, courseID);
            hdAdapter = new HoleDetailsAdapter(SupportFragmentManager, chbnl, courseID);
            holesViewPager.Adapter = hdAdapter;


            ImageView backgroundImage = (ImageView)FindViewById <ImageView>(Resource.Id.CourseDetailsView_BackgroundImage);

            backgroundImage.SetBackgroundResource(Resource.Drawable.Screenshot_20170225_142830);

            courseTees_ListView.SetBackgroundColor(new Color(0x00, 0x65, 0x00));
            addTeeButton.SetBackgroundColor(new Color(0x00, 0x65, 0x00));
            linearLayout_CourseNameBasicInfo.SetBackgroundColor(new Color(0x00, 0x65, 0x00));
        }
 private void GetFieldComponents()
 {
     _viewPager  = FindViewById <ViewPager>(Resource.Id.pagerThoughtRecordMain);
     _titleStrip = FindViewById <PagerTitleStrip>(Resource.Id.pagerTitleThoughtRecordMain);
     _continue   = FindViewById <Button>(Resource.Id.btnContinue);
 }