Пример #1
0
        private void CloseCustomGPS()     //chiudo la personalizzazione della posizione
        {
            GPSBackground.FadeTo(0, 200); //sfocatura in uscita

            normalGPSRadio.FadeTo(0, 200);
            customGPSRadio.FadeTo(0, 200);

            normalGPSLabel.FadeTo(0, 200);
            customGPSLabel.FadeTo(0, 200);

            latitudeLabel.FadeTo(0, 200);
            longitudeLabel.FadeTo(0, 200);
            latitudeText.FadeTo(0, 200);
            longitudeText.FadeTo(0, 200);

            cancelLabel.FadeTo(0, 200);
            applyLabel.FadeTo(0, 200);

            GPSBackground.IsEnabled = false;

            normalGPSRadio.IsEnabled = false;
            customGPSRadio.IsEnabled = false;

            normalGPSLabel.IsEnabled = false;
            customGPSLabel.IsEnabled = false;

            latitudeLabel.IsEnabled  = false;
            longitudeLabel.IsEnabled = false;
            latitudeText.IsEnabled   = false;
            longitudeText.IsEnabled  = false;

            cancelLabel.IsEnabled = false;
            applyLabel.IsEnabled  = false;
            UiThread uselessThread = new UiThread(this);    //thread che ritarda il setVisible = false e chiude la tastiera

            var currentFocus = uselessThread.CurrentFocus;  //chiudo la tastiera

            if (currentFocus != null)
            {
                InputMethodManager inputMethodManager = (InputMethodManager)uselessThread.GetSystemService(Context.InputMethodService);
                inputMethodManager.HideSoftInputFromWindow(currentFocus.WindowToken, HideSoftInputFlags.None);
            }

            isCustomLocationOpen = false;
        }
Пример #2
0
        //BOTTONI
        private void GPSModePressed(object sender, EventArgs e)  //apro la personalizzazione della posizione
        {
            if (!observer.Equals("earth"))                       //disponibile solo con la terra
            {
                return;
            }

            if (isCustomLocationOpen)
            {
                CloseCustomGPS();
                return;
            }

            if (!isBarOnScreen)
            {
                return;
            }

            if (isRocketOnScreen)
            {
                translateRocketUp();
                isRocketOnScreen = false;
            }

            if (!positionLoaded)
            {
                normalGPSLabel.IsEnabled = false;
                normalGPSRadio.IsEnabled = false;
                customGPSRadio.IsChecked = true;
            }
            else if (usingGPS)
            {
                normalGPSRadio.IsChecked = true;
            }
            else if (!usingGPS)
            {
                customGPSRadio.IsChecked = true;
            }
            latitudeText.Text  = customLatitude.ToString();
            longitudeText.Text = customLongitude.ToString();

            GPSBackground.IsVisible = true;

            normalGPSRadio.IsVisible = true;
            customGPSRadio.IsVisible = true;

            normalGPSLabel.IsVisible = true;
            customGPSLabel.IsVisible = true;

            latitudeLabel.IsVisible  = true;
            longitudeLabel.IsVisible = true;
            latitudeText.IsVisible   = true;
            longitudeText.IsVisible  = true;

            cancelLabel.IsVisible = true;
            applyLabel.IsVisible  = true;

            GPSBackground.IsEnabled = true;

            normalGPSRadio.IsEnabled = true;
            customGPSRadio.IsEnabled = true;

            normalGPSLabel.IsEnabled = true;
            customGPSLabel.IsEnabled = true;

            latitudeLabel.IsEnabled  = true;
            longitudeLabel.IsEnabled = true;
            latitudeText.IsEnabled   = true;
            longitudeText.IsEnabled  = true;

            cancelLabel.IsEnabled = true;
            applyLabel.IsEnabled  = true;

            GPSBackground.FadeTo(1, 200);

            normalGPSRadio.FadeTo(1, 200);
            customGPSRadio.FadeTo(1, 200);

            normalGPSLabel.FadeTo(1, 200);
            customGPSLabel.FadeTo(1, 200);

            latitudeLabel.FadeTo(1, 200);
            longitudeLabel.FadeTo(1, 200);
            latitudeText.FadeTo(1, 200);
            longitudeText.FadeTo(1, 200);

            cancelLabel.FadeTo(1, 200);
            applyLabel.FadeTo(1, 200);

            isCustomLocationOpen = true;
        }