Beispiel #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.edit_layout);
            _imagesStorage           = new List <Bitmap>();
            _ratingBar               = FindViewById <SimpleRatingBar>(Resource.Id.ratingUpd);
            _placeName               = FindViewById <TextView>(Resource.Id.titleOfLocationUpdate);
            _placeSecondName         = FindViewById <TextView>(Resource.Id.title2OfLocationUpdate);
            _description             = FindViewById <EditText>(Resource.Id.editorUpdate);
            _updateButton            = FindViewById <FloatingActionButton>(Resource.Id.updateButton);
            _updateButton.Visibility = ViewStates.Invisible;
            _btnBack      = FindViewById <FloatingActionButton>(Resource.Id.backButton);
            _nameOfPlace2 = FindViewById <EditText>(Resource.Id.editor2Update);
            _nameOfPlace  = FindViewById <EditText>(Resource.Id.editorUpdate);
            var mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);

            mapFragment.GetMapAsync(this);
            db = new DataBase();
            UpdateData();

            _description.AfterTextChanged  += EnableUpdateButton;
            _nameOfPlace2.AfterTextChanged += EnableUpdateButton;
            _nameOfPlace.AfterTextChanged  += EnableUpdateButton;
            _ratingBar.RatingBarChange     += _ratingBar_RatingBarChange;

            _updateButton.Click += ClickUpdateButton;
            _btnBack.Click      += _btnBack_Click;
        }
        public void OnRatingChanged(SimpleRatingBar simpleRatingBar, float rating, bool fromUser)
        {
            String text = String.Format("%.2f", rating);

            if (simpleRatingBar == ratingBar1)
            {
                rating1.Text = text;
            }
            else if (simpleRatingBar == ratingBar2)
            {
                rating2.Text = text;
            }
            else if (simpleRatingBar == ratingBar3)
            {
                rating3.Text = text;
            }
            else if (simpleRatingBar == ratingBar4)
            {
                rating4.Text = text;
            }
            else
            {
                rating5.Text = text;
            }
        }
Beispiel #3
0
 private void bindViews(View view)
 {
     ratingBar1 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar1);
     ratingBar2 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar2);
     ratingBar3 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar3);
     ratingBar4 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar4);
     ratingBar5 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar5);
 }
 private void bindViews(View view)
 {
     ratingBar1 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar1);
     ratingBar2 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar2);
     ratingBar3 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar3);
     ratingBar4 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar4);
     ratingBar5 = view.FindViewById <SimpleRatingBar>(Resource.Id.ratingBar5);
     //
     rating1 = view.FindViewById <TextView>(Resource.Id.rating1);
     rating2 = view.FindViewById <TextView>(Resource.Id.rating2);
     rating3 = view.FindViewById <TextView>(Resource.Id.rating3);
     rating4 = view.FindViewById <TextView>(Resource.Id.rating4);
     rating5 = view.FindViewById <TextView>(Resource.Id.rating5);
 }