public void LongPressGestureDetectorgetCPtr() { tlog.Debug(tag, $"LongPressGestureDetectorgetCPtr START"); using (LongPressGestureDetector detector = new LongPressGestureDetector()) { var testingTarget = LongPressGestureDetector.DownCast(detector); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); try { LongPressGestureDetector.getCPtr(testingTarget); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } testingTarget.Dispose(); } tlog.Debug(tag, $"LongPressGestureDetectorgetCPtr END (OK)"); Assert.Pass("LongPressGestureDetectorgetCPtr"); }
public void LongPressGestureDetectorDownCast() { tlog.Debug(tag, $"LongPressGestureDetectorDownCast START"); BaseHandle handle = new BaseHandle(); LongPressGestureDetector a1 = LongPressGestureDetector.DownCast(handle); tlog.Debug(tag, $"LongPressGestureDetectorDownCast END (OK)"); Assert.Pass("LongPressGestureDetectorDownCast"); }
public void Activate() { Window window = NUIApplication.GetDefaultWindow(); mDefaultLayer = window.GetDefaultLayer(); mDefaultLayer.Behavior = Layer.LayerBehavior.Layer3D; window.BackgroundColor = Color.Black; mRootView = new View() { Size = new Size(1920, 1080) }; mRootView.Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical }; mDefaultLayer.Add(mRootView); CreateToolBarLayer(); CreateContentView(); CreateInsertButton(); CreateReplaceButton(); CreateDeleteButton(); CreateSpiralLayout(); CreateGridLayout(); CreateDepthLayout(); mLayout = new PropertyArray(); mLayout.PushBack(new PropertyValue(mSpiralLayout)); mLayout.PushBack(new PropertyValue(mDepthLayout)); mLayout.PushBack(new PropertyValue(mGridLayout)); mItemFactoryWrapper = new ItemFactoryWrapper(); mItemFactoryWrapper.GetNumberDelegate = GetNumberOfItems; mItemFactoryWrapper.NewItemDelegate = NewItemView; mItemView = new ItemView(mItemFactoryWrapper) { Size = new Size(800, 800, 800) }; mContentView.Add(mItemView); mItemView.Layout = mLayout; mItemView.MinimumSwipeDistance = MIN_SWIPE_DISTANCE; mItemView.MinimumSwipeSpeed = MIN_SWIPE_SPEED; SetLayout((int)mCurrentLayout); SetLayoutTitle(); SetLayoutImage(); mLongPressGestureDetector = new LongPressGestureDetector(); mLongPressGestureDetector.Attach(mItemView); mLongPressGestureDetector.Detected += OnLongPressGestureDetected; }
internal LongPressGestureDetector GetLongPressGestureDetector() { LongPressGestureDetector ret = new LongPressGestureDetector(Interop.ViewInternal.View_GetLongPressGestureDetector(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public void LongPressGestureDetectorGetMaximumTouchesRequired() { tlog.Debug(tag, $"LongPressGestureDetectorGetMaximumTouchesRequired START"); LongPressGestureDetector a1 = new LongPressGestureDetector(3, 7); uint b1 = a1.GetMaximumTouchesRequired(); a1.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorGetMaximumTouchesRequired END (OK)"); Assert.Pass("GetMaximumTouchesRequired"); }
public void LongPressGestureDetectorDetectedSignal() { tlog.Debug(tag, $"LongPressGestureDetectorDetectedSignal START"); LongPressGestureDetector a1 = new LongPressGestureDetector(); LongPressGestureDetectedSignal b1 = a1.DetectedSignal(); a1.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorDetectedSignal END (OK)"); Assert.Pass("LongPressGestureDetectorDetectedSignal"); }
public void LongPressGestureDetectorGetLongPressGestureDetectorFromPtr() { tlog.Debug(tag, $"LongPressGestureDetectorGetLongPressGestureDetectorFromPtr START"); LongPressGestureDetector a1 = new LongPressGestureDetector(); LongPressGestureDetector a2 = LongPressGestureDetector.GetLongPressGestureDetectorFromPtr(LongPressGestureDetector.getCPtr(a1).Handle); a1.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorGetLongPressGestureDetectorFromPtr END (OK)"); Assert.Pass("GetLongPressGestureDetectorFromPtr"); }
public void Activate() { Window window = NUIApplication.GetDefaultWindow(); root = new View(); frontView = new View { Size = new Size(300, 300), Position = new Position(150, 170), BackgroundColor = new Color(1.0f, 0.0f, 0.0f, 1.0f), }; frontView.TouchEvent += OnFrontTouchEvent; // The default the maximum allowed time is 500ms. // If you want to change this time, do as below. // But keep in mind this is a global option. Affects all gestures. GestureOptions.Instance.SetDoubleTapTimeout(300); tapGestureDetector = new TapGestureDetector(); tapGestureDetector.Attach(frontView); tapGestureDetector.SetMaximumTapsRequired(2); tapGestureDetector.Detected += (s, e) => { Tizen.Log.Error("NUI", $"OnTap {e.TapGesture.NumberOfTaps}\n"); }; backView = new TextLabel { Size = new Size(300, 300), Text = "Back View", Position = new Position(50, 70), PointSize = 11, BackgroundColor = new Color(1.0f, 1.0f, 0.0f, 1.0f), }; backView.TouchEvent += OnBackTouchEvent; // The default the minimum holding time is 500ms. // If you want to change this time, do as below. // But keep in mind this is a global option. Affects all gestures. GestureOptions.Instance.SetLongPressMinimumHoldingTime(300); longPressGestureDetector = new LongPressGestureDetector(); longPressGestureDetector.Attach(backView); longPressGestureDetector.Detected += (s, e) => { Tizen.Log.Error("NUI", $"OnLongPress\n"); }; backView.Add(frontView); root.Add(backView); window.Add(root); }
private void init(View view) { mTapGestureDetector = new TapGestureDetector(); mLongGestureDetector = new LongPressGestureDetector(); mPanGestureDetector = new PanGestureDetector(); mPinchGestureDetector = new PinchGestureDetector(); mTapGestureDetector.Attach(view); mLongGestureDetector.Attach(view); mPanGestureDetector.Attach(view); mPinchGestureDetector.Attach(view); }
public void Activate() { Window window = Window.Instance; window.GetDefaultLayer().Behavior = Layer.LayerBehavior.Layer3D; window.BackgroundColor = Color.Black; CreateContentView(); //CreateToolBarView(); CreateToolBarLayer(); CreateLayoutButton(); CreateEditButton(); CreateInsertButton(); CreateReplaceButton(); CreateDeleteButton(); CreateGridLayout(); CreateDepthLayout(); CreateSpiralLayout(); mLayout = new PropertyArray(); mLayout.PushBack(new PropertyValue(mSpiralLayout)); mLayout.PushBack(new PropertyValue(mDepthLayout)); mLayout.PushBack(new PropertyValue(mGridLayout)); mItemFactoryWrapper = new ItemFactoryWrapper(); mItemFactoryWrapper.GetNumberDelegate = GetNumberOfItems; mItemFactoryWrapper.NewItemDelegate = NewItemView; mItemView = new Tizen.NUI.ItemView(mItemFactoryWrapper); //mItemView.BackgroundColor = Color.Blue; mItemView.ParentOrigin = Position.ParentOriginCenter; mItemView.PivotPoint = Position.PivotPointCenter; mItemView.Position2D = new Position2D(-100, 0); mItemView.PositionUsesPivotPoint = true; window.Add(mItemView); window.GetDefaultLayer().Behavior = Layer.LayerBehavior.Layer3D; mItemView.Layout = mLayout; mItemView.SetMinimumSwipeDistance(MIN_SWIPE_DISTANCE); mItemView.SetMinimumSwipeSpeed(MIN_SWIPE_SPEED); SetLayout((int)mCurrentLayout); SetLayoutTitle(); SetLayoutImage(); mLongPressGestureDetector = new LongPressGestureDetector(); mLongPressGestureDetector.Attach(mItemView); mLongPressGestureDetector.Detected += OnLongPressGestureDetected; }
public void LongPressGestureDetectorConstructorWithTouchesArea() { tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithTouchesArea START"); var testingTarget = new LongPressGestureDetector(3, 7); Assert.IsNotNull(testingTarget, "Can't create success object Hover"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); testingTarget.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithTouchesArea END (OK)"); Assert.Pass("LongPressGestureDetectorConstructor"); }
public void LongPressGestureDetectorgetCPtr() { tlog.Debug(tag, $"LongPressGestureDetectorgetCPtr START"); LongPressGestureDetector a1 = new LongPressGestureDetector(); global::System.Runtime.InteropServices.HandleRef c1 = LongPressGestureDetector.getCPtr(a1); a1.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorgetCPtr END (OK)"); Assert.Pass("LongPressGestureDetectorgetCPtr"); }
public void LongPressGestureDetectorSetTouchesRequired() { tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequired START"); LongPressGestureDetector a1 = new LongPressGestureDetector(7); a1.SetTouchesRequired(3); a1.SetTouchesRequired(1, 5); a1.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequired END (OK)"); Assert.Pass("SetTouchesRequired"); }
public override bool OnInterceptTouchEvent(MotionEvent ev) { if (!Enabled) { return(true); } if (_watchForLongPress) { LongPressGestureDetector.OnTouchEvent(ev); } return(base.OnInterceptTouchEvent(ev)); }
public void LongPressGestureDetectorGetMaximumTouchesRequired() { var testingTarget = new LongPressGestureDetector(7); Assert.IsNotNull(testingTarget, "Can't create success object Hover"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); tlog.Debug(tag, "MaximumTouchesRequired : " + testingTarget.GetMaximumTouchesRequired()); testingTarget.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorGetMaximumTouchesRequired END (OK)"); Assert.Pass("GetMaximumTouchesRequired"); }
public void LongPressGestureDetectorAssign() { tlog.Debug(tag, $"LongPressGestureDetectorAssign START"); using (LongPressGestureDetector detector = new LongPressGestureDetector()) { var testingTarget = detector.Assign(detector); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); testingTarget.Dispose(); } tlog.Debug(tag, $"LongPressGestureDetectorAssign END (OK)"); }
public void LongPressGestureDetectorConstructor() { tlog.Debug(tag, $"LongPressGestureDetectorConstructor START"); LongPressGestureDetector a1 = new LongPressGestureDetector(); LongPressGestureDetector a2 = new LongPressGestureDetector(7); LongPressGestureDetector a3 = new LongPressGestureDetector(3, 7); LongPressGestureDetector a4 = new LongPressGestureDetector(a3); a1.Dispose(); a2.Dispose(); a3.Dispose(); a4.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorConstructor END (OK)"); Assert.Pass("LongPressGestureDetectorConstructor"); }
public override bool DispatchTouchEvent(MotionEvent e) { // Give the child controls a shot at the event (in case they've get Tap gestures and such var handled = base.DispatchTouchEvent(e); if (_watchForLongPress) { // Feed the gestue through the LongPress detector; for this to wor we *must* return true // afterward (or the LPGD goes nuts and immediately fires onLongPress) LongPressGestureDetector.OnTouchEvent(e); return(true); } return(handled); }
public RotarySelector() { rotarySelectorManager = new RotarySelectorManager(new Size(360, 360)); this.Add(rotarySelectorManager.GetRotaryPagination()); this.Add(rotarySelectorManager.GetRotaryLayerView()); longPressDetector = new LongPressGestureDetector(); longPressDetector.Detected += Detector_Detected; longPressDetector.Attach(rotarySelectorManager.GetRotaryLayerView().GetMainText()); panDetector = new PanGestureDetector(); panDetector.Attach(this); panDetector.Detected += PanDetector_Detected; this.WheelEvent += RotarySelector_WheelEvent; }
public void LongPressGestureDetectorDetectedSignal() { tlog.Debug(tag, $"LongPressGestureDetectorDetectedSignal START"); using (LongPressGestureDetector detector = new LongPressGestureDetector()) { var testingTarget = detector.DetectedSignal(); Assert.IsNotNull(testingTarget, "Can't create success object Hover"); Assert.IsInstanceOf <LongPressGestureDetectedSignal>(testingTarget, "Should be an instance of LongPressGestureDetectedSignal type."); testingTarget.Dispose(); } tlog.Debug(tag, $"LongPressGestureDetectorDetectedSignal END (OK)"); Assert.Pass("LongPressGestureDetectorDetectedSignal"); }
public void LongPressGestureDetectorDownCast() { tlog.Debug(tag, $"LongPressGestureDetectorDownCast START"); using (LongPressGestureDetector detector = new LongPressGestureDetector()) { var testingTarget = LongPressGestureDetector.DownCast(detector); Assert.IsNotNull(testingTarget, "Can't create success object LongPressGestureDetector"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); testingTarget.Dispose(); } tlog.Debug(tag, $"LongPressGestureDetectorDownCast END (OK)"); Assert.Pass("LongPressGestureDetectorDownCast"); }
public void LongPressGestureDetectorGetLongPressGestureDetectorFromPtr() { tlog.Debug(tag, $"LongPressGestureDetectorGetLongPressGestureDetectorFromPtr START"); using (LongPressGestureDetector detector = new LongPressGestureDetector(3)) { var testingTarget = LongPressGestureDetector.GetLongPressGestureDetectorFromPtr(detector.SwigCPtr.Handle); Assert.IsNotNull(testingTarget, "Can't create success object Hover"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); testingTarget.Dispose(); } tlog.Debug(tag, $"LongPressGestureDetectorGetLongPressGestureDetectorFromPtr END (OK)"); Assert.Pass("GetLongPressGestureDetectorFromPtr"); }
public void GestureDetectorDetach() { tlog.Debug(tag, $"GestureDetectorDetach START"); LongPressGestureDetector ret = new LongPressGestureDetector(); Assert.IsNotNull(ret, "should be not null"); Assert.IsInstanceOf <GestureDetector>(ret, "should be an instance of testing target class!"); View view = new View(); ret.Attach(view); ret.Detach(view); ret.Dispose(); tlog.Debug(tag, $"GestureDetectorDetach END (OK)"); Assert.Pass("GestureDetectorDetach"); }
public void LongPressGestureDetectorDetected() { tlog.Debug(tag, $"LongPressGestureDetectorDetected START"); using (LongPressGestureDetector detector = new LongPressGestureDetector()) { var testingTarget = LongPressGestureDetector.DownCast(detector); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); testingTarget.Detected += OnDetected; testingTarget.Detected -= OnDetected; testingTarget.Dispose(); } tlog.Debug(tag, $"LongPressGestureDetectorDetected END (OK)"); Assert.Pass("LongPressGestureDetectorDetected"); }
public void LongPressGestureDetectorDetected() { tlog.Debug(tag, $"LongPressGestureDetectorDetected START"); LongPressGestureDetector a1 = new LongPressGestureDetector(); a1.Detected += OnDetected; a1.Detected -= OnDetected; LongPressGestureDetector.DetectedEventArgs e = new LongPressGestureDetector.DetectedEventArgs(); object o = new object(); OnDetected(o, e); a1.Dispose(); tlog.Debug(tag, $"LongPressGestureDetectorDetected END (OK)"); Assert.Pass("LongPressGestureDetectorDetected"); }
private void InitializeWidget(LayoutOrientation orientation) { tap_gd = new TapGestureDetector(); dtap_gd = new DoubleTapGestureDetector(); drag_gd = new DragGestureDetector(); longPress_gd = new LongPressGestureDetector(); FPS_Label = new Label(); FPS_Label.Name = "FPS Label"; // FPS_Label FPS_Label.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f); FPS_Label.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular); FPS_Label.LineBreak = LineBreak.Character; tap_gd.TapDetected += Tap; dtap_gd.DoubleTapDetected += DoubleTap; drag_gd.DragDetected += Drag; drag_gd.DragStartDetected += dragStart; drag_gd.DragEndDetected += dragEnd; longPress_gd.LongPressDetected += LongPress; lblOutput = new Label(); imgDesktop = new ImageBox(); imgDesktop2 = new ImageBox(); dummy = new ImageBox(); dummy.AddGestureDetector(tap_gd); dummy.AddGestureDetector(dtap_gd); dummy.AddGestureDetector(drag_gd); dummy.AddGestureDetector(longPress_gd); imgDesktop.ImageScaleType = ImageScaleType.Stretch; this.RootWidget.AddChildLast(imgDesktop); this.RootWidget.AddChildLast(imgDesktop2); this.RootWidget.AddChildLast(dummy); this.RootWidget.AddChildLast(lblOutput); this.RootWidget.AddChildLast(FPS_Label); SetWidgetLayout(orientation); }
public void GestureDetectorDetachAll() { tlog.Debug(tag, $"GestureDetectorDetachAll START"); var testingTarget = new LongPressGestureDetector(); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "should be an instance of testing target class!"); using (View view = new View()) { testingTarget.Attach(view); testingTarget.DetachAll(); } testingTarget.Dispose(); tlog.Debug(tag, $"GestureDetectorDetachAll END (OK)"); Assert.Pass("GestureDetectorDetachAll"); }
public void GestureDetectorAttach() { tlog.Debug(tag, $"GestureDetectorAttach START"); var testingTarget = new LongPressGestureDetector(); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "should be an instance of testing target class!"); using (View view = new View()) { Window.Instance.GetDefaultLayer().Add(view); testingTarget.Attach(view); testingTarget.Detach(view); Window.Instance.GetDefaultLayer().Remove(view); } testingTarget.Dispose(); tlog.Debug(tag, $"GestureDetectorAttach END (OK)"); Assert.Pass("GestureDetectorAttach"); }
private void InitializeWidget(LayoutOrientation orientation) { tap_gd = new TapGestureDetector(); dtap_gd = new DoubleTapGestureDetector(); drag_gd = new DragGestureDetector(); longPress_gd = new LongPressGestureDetector(); tap_gd.TapDetected += Tap; dtap_gd.DoubleTapDetected += DoubleTap; drag_gd.DragDetected += Drag; drag_gd.DragStartDetected += dragStart; drag_gd.DragEndDetected += dragEnd; longPress_gd.LongPressDetected += LongPress; lblOutput = new Label(); imgDesktop = new ImageBox(); imgDesktop2 = new ImageBox(); dummy = new ImageBox(); //imgDesktop.AddGestureDetector(tap_gd); //imgDesktop.AddGestureDetector(dtap_gd); //imgDesktop.AddGestureDetector(drag_gd); dummy.AddGestureDetector(tap_gd); dummy.AddGestureDetector(dtap_gd); dummy.AddGestureDetector(drag_gd); dummy.AddGestureDetector(longPress_gd); imgDesktop.ImageScaleType = ImageScaleType.Stretch; this.RootWidget.AddChildLast(imgDesktop); this.RootWidget.AddChildLast(imgDesktop2); this.RootWidget.AddChildLast(dummy); this.RootWidget.AddChildLast(lblOutput); SetWidgetLayout(orientation); }
public void LongPressGestureDetectorSetTouchesRequiredWithTouchesArea() { tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequiredWithTouchesArea START"); var testingTarget = new LongPressGestureDetector(7); Assert.IsNotNull(testingTarget, "Can't create success object Hover"); Assert.IsInstanceOf <LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type."); try { testingTarget.SetTouchesRequired(2, 8); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequiredWithTouchesArea END (OK)"); Assert.Pass("SetTouchesRequired"); }