//public AppShowcaseView(Context context, IAttributeSet attrs)
        //    : base(context, attrs)
        //{
        //    Setup(context);
        //}
        //
        //public AppShowcaseView(Context context, IAttributeSet attrs, int defStyleAttr)
        //    : base(context, attrs, defStyleAttr)
        //{
        //    Setup(context);
        //}
        //
        //// TODO: @TargetApi(android.os.Build.VERSION_CODES.LOLLIPOP)
        //public AppShowcaseView(Context context, IAttributeSet attrs, int defStyleAttr, int defStyleRes)
        //    : base(context, attrs, defStyleAttr, defStyleRes)
        //{
        //    Setup(context);
        //}

        private void Setup(Context context)
        {
            AnimateInitialStep = true;
            handler            = new Handler();
            Visibility         = ViewStates.Invisible;
            SetWillNotDraw(false);
            // create our default animation factory
            animationFactory = new FadeRenderer();

            // make sure we add a global layout listener so we can adapt to changes
            AttachLayoutListener();

            // consume touch events
            Touch += (sender, e) =>
            {
                if (e.Event.Action == MotionEventActions.Up && CurrentStep.DismissOnTouch)
                {
                    DismissStep();
                }
                e.Handled = true;
            };

            View contentView = LayoutInflater.From(Context).Inflate(Resource.Layout.showcase_content, this, true);

            contentContainer   = contentView.FindViewById(Resource.Id.content_box);
            this.contentView   = contentView.FindViewById <TextView>(Resource.Id.tv_content);
            dismissView        = contentView.FindViewById <TextView>(Resource.Id.tv_dismiss);
            dismissView.Click += delegate
            {
                DismissStep();
            };
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.AboutView);

            phoneNumberTextView.FindViewById <TextView>(Resource.Id.phoneNumberTextView);
            phoneNumberTextView.Click += PhoneNumberTextView_Click;
            // Create your application here
        }
Beispiel #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);



            try
            {
                //objRest = new RestHandler (@"https://api.flickr.com/services/rest/?method=flickr.interestingness.getList");
                objRest = new RestHandler(@"api.openweathermap.org/data/2.5/forecast/daily?q=Auckland&mode=xml&units=metric&cnt=7");


                objRest.AddParameter("api_key", "d7139997bd5e407bb42efb83f8f6274f");
                objRest.AddParameter("format", "json");
                objRest.AddParameter("nojsoncallback", "1");
                //objRest.AddParameter ("api_sig", "71007d2a60efd2ea3b59db622103aa23");

                objRootList = objRest.ExeccuteRequest();



                txtCity.FindViewById <TextView> (Resource.Id.txtCity);
                txtDate.FindViewById <TextView> (Resource.Id.txtDate);
                txtTemp.FindViewById <TextView> (Resource.Id.txtTemp);
                txtWeather.FindViewById <TextView> (Resource.Id.txtWeather);
                txtMax.FindViewById <TextView> (Resource.Id.txtMax);
                txtMin.FindViewById <TextView> (Resource.Id.txtMin);


                txtCity.Text = objCityList.name;
                //	txtDate.Text = objRootList.
                txtTemp.Text = (Convert.ToString(objList.temp));



                //LoadWeather ();
            } catch (Exception e) {
                Toast.MakeText(this, "Error" + e.Message, ToastLength.Long);
            }
        }
Beispiel #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create your application here
            SetContentView(Resource.Layout.ReportList);

            inflater = (LayoutInflater)GetSystemService(Context.LayoutInflaterService);

            tlHeader = FindViewById <TableLayout> (Resource.Id.tlHeader);
            MakeTableHeader();

            tlContent = FindViewById <TableLayout> (Resource.Id.tlContent);
            //var dummy = new TableRow (this);

            int maxFIOLength = 0;
            int docID        = 0;

            var hospitals = HospitalManager.GetHospitals().OrderBy(h => h.Name).ToList();

            foreach (Hospital hosp in hospitals)
            {
                var doctors = DoctorManager.GetDoctors(hosp.ID).OrderBy(d => d.SecondName).ToList();

                if (doctors.Count > 0)
                {
                    TableRow hview = (TableRow)inflater.Inflate(Resource.Layout.TableRow, null);
                    hview.FindViewById <TextView> (Resource.Id.txtFIO).Text = hosp.Name;
                    hview.FindViewById <TextView> (Resource.Id.txtFIO).SetBackgroundResource(Resource.Drawable.border_blue);
                    hview.FindViewById <TextView> (Resource.Id.txtFIO).SetTextColor(Android.Graphics.Color.Black);
                    hview.FindViewById <TextView> (Resource.Id.txtFIO).SetShadowLayer(0, 0, 0, Android.Graphics.Color.Black);

                    foreach (int weekNum in listOfWeekNum)
                    {
                        TextView hviewVisitCount = (TextView)inflater.Inflate(Resource.Layout.TableVisitCount, null);
                        hviewVisitCount.Text = "";
                        hviewVisitCount.SetBackgroundResource(Resource.Drawable.border_blue);
                        hviewVisitCount.SetTextColor(Android.Graphics.Color.Black);
                        hview.AddView(hviewVisitCount);
                    }
                    tlContent.AddView(hview);
                }

                foreach (Doctor doc in doctors)
                {
                    TableRow view = (TableRow)inflater.Inflate(Resource.Layout.TableRow, null);

                    view.FindViewById <TextView> (Resource.Id.txtFIO).Text = doc.FIO() + "\n" + doc.Speciality;

                    if (maxFIOLength < view.FindViewById <TextView> (Resource.Id.txtFIO).Text.Length)
                    {
                        maxFIOLength = view.FindViewById <TextView> (Resource.Id.txtFIO).Text.Length;
                        docID        = doc.ID;
                    }

                    var report = ReportManager.GetReport(doc.ID);

                    foreach (int weekNum in listOfWeekNum)
                    {
                        TextView viewVisitCount = (TextView)inflater.Inflate(Resource.Layout.TableVisitCount, null);
                        if (report == null)
                        {
                            viewVisitCount.FindViewById <TextView> (Resource.Id.txtVisitCount).Text = "0";
                        }
                        else
                        {
                            int visitCount = report.FindVisitCountValue(weekNum);
                            viewVisitCount.FindViewById <TextView> (Resource.Id.txtVisitCount).Text = visitCount.ToString();
                            switch (visitCount)
                            {
                            case 0:
                                break;

                            case 1:
                                viewVisitCount.SetBackgroundResource(Resource.Drawable.border_green);
                                viewVisitCount.SetTextColor(Android.Graphics.Color.Black);
                                break;

                            default:
                                viewVisitCount.SetBackgroundResource(Resource.Drawable.border_red);
                                viewVisitCount.SetTextColor(Android.Graphics.Color.Black);
                                break;
                            }
                        }
                        viewVisitCount.LayoutParameters = new TableRow.LayoutParams(TableRow.LayoutParams.WrapContent, TableRow.LayoutParams.MatchParent);
                        view.AddView(viewVisitCount);
                    }
                    tlContent.AddView(view);
                }
            }

            var doctorsWithoutHospitals = DoctorManager.GetDoctors(-1).OrderBy(d => d.SecondName).ToList();

            foreach (Doctor doc in doctorsWithoutHospitals)
            {
                TableRow view = (TableRow)inflater.Inflate(Resource.Layout.TableRow, null);

                view.FindViewById <TextView> (Resource.Id.txtFIO).Text = doc.FIO();

                if (maxFIOLength < view.FindViewById <TextView> (Resource.Id.txtFIO).Text.Length)
                {
                    maxFIOLength = view.FindViewById <TextView> (Resource.Id.txtFIO).Text.Length;
                    docID        = doc.ID;
                }

                var report = ReportManager.GetReport(doc.ID);

                foreach (int weekNum in listOfWeekNum)
                {
                    TextView viewVisitCount = (TextView)inflater.Inflate(Resource.Layout.TableVisitCount, null);
                    if (report == null)
                    {
                        viewVisitCount.FindViewById <TextView> (Resource.Id.txtVisitCount).Text = "0";
                    }
                    else
                    {
                        int visitCount = report.FindVisitCountValue(weekNum);
                        viewVisitCount.FindViewById <TextView> (Resource.Id.txtVisitCount).Text = visitCount.ToString();
                        switch (visitCount)
                        {
                        case 0:
                            break;

                        case 1:
                            viewVisitCount.SetBackgroundResource(Resource.Drawable.border_green);
                            viewVisitCount.SetTextColor(Android.Graphics.Color.Black);
                            break;

                        default:
                            viewVisitCount.SetBackgroundResource(Resource.Drawable.border_red);
                            viewVisitCount.SetTextColor(Android.Graphics.Color.Black);
                            break;
                        }
                        viewVisitCount.SetTextColor(Android.Graphics.Color.Black);
                    }
                    viewVisitCount.LayoutParameters = new TableRow.LayoutParams(TableRow.LayoutParams.WrapContent, TableRow.LayoutParams.MatchParent);
                    view.AddView(viewVisitCount);
                }
                tlContent.AddView(view);
            }

            if (docID != 0)
            {
                TableRow dummyView = (TableRow)inflater.Inflate(Resource.Layout.TableRow, null);
                dummyView.FindViewById <TextView> (Resource.Id.txtFIO).Text = DoctorManager.GetDoctor(docID).FIO();
                var report = ReportManager.GetReport(docID);
                foreach (int weekNum in listOfWeekNum)
                {
                    TextView viewVisitCount = (TextView)inflater.Inflate(Resource.Layout.TableVisitCount, null);
                    //viewVisitCount.LayoutParameters = new TableRow.LayoutParams(
                    if (report == null)
                    {
                        viewVisitCount.FindViewById <TextView> (Resource.Id.txtVisitCount).Text = "0";
                    }
                    else
                    {
                        viewVisitCount.FindViewById <TextView> (Resource.Id.txtVisitCount).Text = weekNum.ToString();
                    }
                    viewVisitCount.LayoutParameters = new TableRow.LayoutParams(TableRow.LayoutParams.MatchParent, 0);
                    dummyView.AddView(viewVisitCount);
                }
                dummyView.FindViewById <TextView> (Resource.Id.txtFIO).LayoutParameters.Height = 0;
                tlHeader.AddView(dummyView);
            }
        }