public OrientationPageViewModel() { DeviceOrientation orientation = DependencyService.Get <IDeviceOrientation>().GetOrientation(); if (orientation.ToString() == "Portrait") { orientationText = "Portrait"; } else if (orientation.ToString() == "Landscape") { orientationText = "Landscape"; } }
public ScreenOrientationPageViewModel() { IScreenOrientation service = DependencyService.Get <IScreenOrientation>(); DeviceOrientation orientation = service.GetOrientation(); txtScreenOrientation = orientation.ToString(); }
public MainPage() { InitializeComponent(); DeviceOrientation orientation = DependencyService.Get <IOrientation>().GetOrientation(); OrientationLabel.Text = "This view is in " + orientation.ToString() + " Mode"; }
public DependencyServiceViewModel() { GetDeviceOrientation = new Command(() => { DeviceOrientation orientation = DependencyService.Get <IDeviceOrientationService>().GetOrientation(); App.Current.MainPage.DisplayAlert("Orientation:", orientation.ToString(), "Ok"); }); }
public OrientationViewModel() { ChangeOrientation = new Command(async() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); Result = orientation.ToString(); }); }
public DeviceViewModelPage() { GetDeviceCommand = new Command(() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); ShowData = orientation.ToString(); }); }
private async void SpeakAloud(object text) { if (text != null) { DependencyService.Get <ITextToSpeechService>().Speak(text); DeviceOrientation orientation = DependencyService.Get <IDeviceOrientationService>().GetOrientation(); var result = orientation.ToString(); await App.Current.MainPage.DisplayAlert("Orientation", "Your phone is on " + result, "OK"); } }
public ChangesPageViewModel() { GetDeviceOrientation = new Command(() => { IGetDeviceOrientationService service = DependencyService.Get <IGetDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); App.Current.MainPage.DisplayAlert("Orientation is: ", orientation.ToString(), "Ok"); }); }
public MainPageViewModel() { GetOrientation = new Command(() => { DeviceOrientation orientation = Xamarin.Forms.DependencyService.Get <IDeviceOrientationService>().GetOrientation(); Message = $"Device Orientation: {orientation.ToString().ToUpper()}"; //await App.Current.MainPage.DisplayAlert("Orientation", orientation.ToString(), "Ok"); }); }
public DevicePageViewModel() { //Comando para boton GetDeviceORientation, este dara la orientacion del dispositivo GetOrientationCommand = new Command(() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); App.Current.MainPage.DisplayAlert("Orientacion", orientation.ToString(), "ok"); }); }
void FixedUpdate() { #if UNITY_EDITOR deviceGravity = GetEditorGravity(); #else deviceGravity = Input.gyro.gravity; #endif CheckCurrentOrientation(); customOrientationText.text = "Custom Orientation Detection: " + currentOrientation.ToString(); CheckLastOrientation(); lastOrientationText.text = "Orientation that Physics is Currently Using: " + lastOrientation.ToString(); SetGravity(); }
void OnGetDeviceOrientationButtonClicked(object sender, EventArgs e) { DeviceOrientation orientation = DependencyService.Get <IDeviceOrientationService>().GetOrientation(); orientationLabel.Text = orientation.ToString(); }
void Button_Clicked(System.Object sender, System.EventArgs e) { DeviceOrientation orientation = DependencyService.Get <IDeviceOrientationService>().GetOrientation(); orientationLabel.Text = orientation.ToString(); }
public void OnOrientation() { DeviceOrientation orientation = DependencyService.Get <IDeviceOrientationService>().GetOrientation(); Orientation = orientation.ToString(); }
public static void SetDeviceOrientation(DeviceOrientation orientation) { #if UNITY_IPHONE // Call plugin only when running on real device if (Application.platform == RuntimePlatform.IPhonePlayer) { Debug.Log ("Kamcord.SetDeviceOrientation"); orientationWasPreviouslySet = true; _KamcordSetDeviceOrientation(orientation.ToString()); } else #endif { Debug.Log ("[NOT CALLED] Kamcord.SetDeviceOrientation"); } }
public static void Init(string devKey, string devSecret, string appName, DeviceOrientation deviceOrientation, VideoResolution videoResolution) { #if UNITY_IPHONE // Call plugin only when running on real device if (Application.platform == RuntimePlatform.IPhonePlayer) { Debug.Log ("Kamcord.Init"); if (orientationWasPreviouslySet) { deviceOrientation = Kamcord.GetDeviceOrientation(); Debug.Log ("Setting device orientation to old orientation: " + deviceOrientation); } _KamcordInit(devKey, devSecret, appName, deviceOrientation.ToString(), videoResolution.ToString()); } else #endif { Debug.Log ("[NOT CALLED] Kamcord.Init"); } }