Esempio n. 1
0
        private void NewFragment_Dismissed(object sender, DialogEventArgs args)
        {
            Tasky.GlobalEntities.courseHoleParByNumberListList = CourseHoleParManager.GetCourseHoleParsByHole(course.ID);
            //var updatedCourseHoles = HoleManager.GetCourseHolesByHole(course.ID);
            //List<CourseTeeHole> chList = new List<CourseTeeHole>();
            //foreach (var courseHolePar in Tasky.GlobalEntities.courseHoleParByNumberListList.CourseHoleParDataLists[holeNumber].CourseHolePars)
            //{
            //    chList.Add(courseHole);
            //}
            hdAdapter = new HoleDetailsAdapter(SupportFragmentManager, chbnl, course.ID);
            holesViewPager.Adapter = hdAdapter;
            holesViewPager.SetCurrentItem(holeNumber - 1, true);

            //_listView.Adapter = new HoleDetails_GridView_HoleInfo_Adapter(this, chList);
        }
Esempio 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));
        }