Esempio n. 1
0
        void CreatePopup()
        {
            var rect = Xamarin.Forms.Platform.Tizen.Forms.NativeParent.Geometry;

            _editorPopup = new ElmSharp.Background(Xamarin.Forms.Platform.Tizen.Forms.NativeParent)
            {
                Geometry = rect
            };

            var layout = new ElmSharp.Layout(_editorPopup);

            layout.SetTheme("layout", "entry", "default");
            layout.Show();

            _editorPopup.SetPartContent("overlay", layout);
            _editorPopup.Color = Control.BackgroundColor;

            _editor = new Xamarin.Forms.Platform.Tizen.Native.Entry(layout);
            _editor.IsSingleLine      = true;
            _editor.Scrollable        = true;
            _editor.PredictionAllowed = false;
            _editor.SetInputPanelEnabled(false);
            _editor.ShowInputPanel();
            _editor.AllowFocus(true);
            _editor.Show();

            _editor.SetInputPanelReturnKeyType(ElmSharp.InputPanelReturnKeyType.Done);

            _editor.SetInputPanelLayout(ElmSharp.InputPanelLayout.Normal);

            _editorPopup.BackButtonPressed += (s, e) => HidePopup();

            _editor.Activated += (s, e) => HidePopup();

            IntPtr entryHandle = Interop.EFL.elm_entry_imf_context_get(_editor.RealHandle);

            _editorStateChanged = EditorStateChanged;
            Interop.EFL.ecore_imf_context_input_panel_event_callback_add(entryHandle, Interop.EFL.InputPanelEventType.State, _editorStateChanged, IntPtr.Zero);

            layout.SetPartContent("elm.swallow.content", _editor);
        }