Exemple #1
0
        public void MeAlarmSpeed()
        {
            AlertDialog.Builder message = new AlertDialog.Builder(this);
            message.SetTitle("هشدار سرعت");
            View viewAlert = View.Inflate(this, Resource.Layout.UiSpeedCheck, null);

            CheckBox CheckBoxVib = (CheckBox)viewAlert.FindViewById(Resource.Id.CheckVib);

            CheckBoxVib.CheckedChange += delegate { VibSpeed = CheckBoxVib.Checked; };
            RadioGroup radiogroup = (RadioGroup)viewAlert.FindViewById(Resource.Id.radioGroupSpeed);

            radiogroup.CheckedChange += Radiogroup_CheckedChange;

            message.SetPositiveButton("اجرا", delegate { AlarmSpeed = true;
                                                         try {
                                                             lcmgr.RequestLocationUpdates(LocationManager.GpsProvider, 1, 1, this);
                                                             location = lcmgr.GetLastKnownLocation(LocationManager.GpsProvider);
                                                             RunOnUiThread(() => OnLocationChanged(location));
                                                             tGps = TypeGps.speed;
                                                         }
                                                         catch { Log.Error("Tag Alarm speed", "Run gps ..."); } });
            message.SetView(viewAlert);
            message.SetNegativeButton("لغو", delegate { });
            message.SetNeutralButton("لغو هشدار سرعت", delegate { AlarmSpeed = false; });
            message.SetCancelable(false);
            message.Create(); message.Show();
        }
Exemple #2
0
 private void BtnInfoGps_Click(object sender, EventArgs e)
 {
     vibrator.Vibrate(30);
     try
     {
         lcmgr.RequestLocationUpdates(LocationManager.GpsProvider, 1, 1, this);
         location = lcmgr.GetLastKnownLocation(LocationManager.GpsProvider);
         RunOnUiThread(() => OnLocationChanged(location));
         tGps = TypeGps.info;
     }
     catch { }
 }