private void UpdateLayoutVisibility() { var inputViewA = FindViewById <ViewGroup>(Resource.Id.imeKeyViewA); var inputViewB = FindViewById <ViewGroup>(Resource.Id.imeKeyViewB); var inputViewC = FindViewById <ViewGroup>(Resource.Id.imeKeyViewC); inputViewA.Visibility = ViewStates.Gone; inputViewB.Visibility = ViewStates.Gone; inputViewC.Visibility = ViewStates.Gone; var layout = SwSettings.GetSelectedLayout(); switch (layout) { case (Resource.Layout.input_b): inputViewB.Visibility = ViewStates.Visible; SetInputListeners(inputViewB); selected_layout = inputViewB; break; case (Resource.Layout.input_c): inputViewC.Visibility = ViewStates.Visible; SetInputListeners(inputViewC); selected_layout = inputViewC; break; default: inputViewA.Visibility = ViewStates.Visible; SetInputListeners(inputViewA); selected_layout = inputViewA; break; } RefreshInputHighlighting(); }
private void ConfigureLayoutSpinner() { Log.Debug(TAG, "ConfigureLayoutSpinner"); var spinner = FindViewById <Spinner>(Resource.Id.controllerLayout); spinner.Prompt = "Select Controller Layout"; var set_layout = SwSettings.GetSelectedLayout(); var set_layout_string = ""; List <string> inputNames = new List <string>(); foreach (var layout_str in SwSettings.LAYOUT_TO_STRING_MAP.Keys) { inputNames.Add(layout_str); if (set_layout == SwSettings.LAYOUT_TO_STRING_MAP[layout_str]) { set_layout_string = layout_str; } } var adapter = new ArrayAdapter <string>(this, Resource.Layout.spinner_item, inputNames); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(LayoutSpinnerItemSelected); ignore_spinner_count++; int spinner_position = adapter.GetPosition(set_layout_string); spinner.SetSelection(spinner_position); spinner.Invalidate(); }
protected override void OnCreate(Bundle savedInstanceState) { Log.Debug(TAG, "onCreate()"); base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); // Force the controller into a full screen view Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); RequestWindowFeature(WindowFeatures.NoTitle); var uiOptions = SystemUiFlags.HideNavigation | SystemUiFlags.LayoutHideNavigation | SystemUiFlags.LayoutFullscreen | SystemUiFlags.Fullscreen | SystemUiFlags.LayoutStable | SystemUiFlags.ImmersiveSticky; Window.DecorView.SystemUiVisibility = (StatusBarVisibility)uiOptions; keyboardView = LayoutInflater.Inflate(SwSettings.GetSelectedLayout(), null); keyboardView.SetMinimumHeight(MULTI_DISPLAY_HEIGHT_PX); SetContentView(keyboardView); SwDisplayManager.StartSwDisplayManager(); SetInputListeners((ViewGroup)keyboardView); instance = this; }