public void OnWindowTouched(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { _animation.Play(); } }
private void WinTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { Vector2 touchpoint = e.Touch.GetScreenPosition(0); log.Fatal(tag, $"WinTouchEvent={touchpoint.X}, {touchpoint.Y}"); int xPosition = 0; if (addingInput == 0) { if (touchpoint.Y > (screenHeight / 2 - 50)) { int yPostion = screenHeight / 2 + 1; int height = screenHeight / 2; log.Fatal(tag, $"WinTouchEvent= Include {xPosition},{yPostion} {screenWidth}x{height} "); mainWin.IncludeInputRegion(new Rectangle(xPosition, yPostion, screenWidth, height)); addingInput = 1; } } else { if (touchpoint.Y > (screenHeight - 50)) { int yPostion = screenHeight / 2 + 1; int height = screenHeight / 2; log.Fatal(tag, $"WinTouchEvent= Exclude {xPosition},{yPostion} {screenWidth}x{height} "); mainWin.ExcludeInputRegion(new Rectangle(xPosition, yPostion, screenWidth, height)); addingInput = 0; } } } }
private void OnTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Up) { Window.Instance.Iconify(true); } }
private void OnRiveWindowTouchEvent(object source, Window.TouchEventArgs e) { Vector2 lp = e.Touch.GetLocalPosition(0); Vector2 sp = e.Touch.GetScreenPosition(0); if (lp.X > 100 && lp.Y > 100 && lp.X < 620 && lp.Y < 620) { isIn = true; } else { isIn = false; } if (preIn != isIn) { preIn = isIn; if (preIn) { // Change Animation State When the cursor is in the bounds rav.EnableAnimation("rollover_in", true); rav.EnableAnimation("rollover_out", false); } else { // Change Animation State When the cursor is out of the bounds rav.EnableAnimation("rollover_in", false); rav.EnableAnimation("rollover_out", true); } } }
private void Instance_TouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Up) { myFrame1?.ChangeSharedText("Change - text"); } }
private void WinTouchEvent(object sender, Window.TouchEventArgs e) { win.AddFrameRenderedCallback(cb, cnt++); Console.WriteLine($"testOnTick() AddFrameRenderedCallback() send id={cnt}"); win.AddFramePresentedCallback(cb, cnt++); Console.WriteLine($"testOnTick() AddFramePresentedCallback() send id={cnt}"); }
// Callback for window touched signal handling public void OnWindowTouched(object sender, Window.TouchEventArgs e) { //NUILog.Debug("OnWindowTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0)); distest(null, null); //NUILog.Debug("### 3 timers are disposed!"); }
private void OnTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Up) { //Window.Instance.Hide(); Exit(); } }
/// <summary> /// Touch event handling of Window /// </summary> /// <param name="sender">Window</param> /// <param name="e">event</param> /// <returns>The consume flag</returns> private void OnWindowTouched(object sender, Window.TouchEventArgs e) { if (e.Touch.GetPointCount() < 1) { return; } switch (e.Touch.GetState(0)) { // If State is Down (Touched at the outside of Button) // - Store touched position. // - Set the mTouched to true case PointStateType.Down: { mTouchedPosition = e.Touch.GetScreenPosition(0); mTouched = true; break; } // If State is Motion // - Check the touched position is in the touchable position. // - Check the Motion is about Horizontal movement. // - If the amount of movement is larger than threshold, run the swipe animation(left or right). case PointStateType.Motion: { if (!mTouched) { break; } // If the vertical movement is large, the gesture is ignored. Vector2 displacement = e.Touch.GetScreenPosition(0) - mTouchedPosition; if (Math.Abs(displacement.Y) > 20) { mTouched = false; break; } // If displacement is larger than threshold // Play Negative directional animation. if (displacement.X > 30) { AnimateAStepNegative(); mTouched = false; } // If displacement is smaller than threshold // Play Positive directional animation. if (displacement.X < -30) { AnimateAStepPositive(); mTouched = false; } break; } } }
private void OnTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Up) { AppControl appControl = new AppControl(); appControl.ApplicationId = "org.tizen.example.NUISimpleCallee"; SendLaunchRequest(appControl, false); } }
private void WindowTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { tlog.Debug(tag, $"======================"); var ret = checkTest() ? "PASS" : "FAIL"; tlog.Debug(tag, $"test result={ret}"); } }
private void OnTouchEvent(object source, Window.TouchEventArgs e) { PointStateType state = e.Touch.GetState(0); if (state == PointStateType.Down) { SetContentInfo("count:" + mCount); mCount++; } }
private void OnRiveWindowTouchEvent(object source, Window.TouchEventArgs e) { Vector2 lp = e.Touch.GetLocalPosition(0); Vector2 sp = e.Touch.GetScreenPosition(0); float scale = (1000.0f / 720.0f); // Set root and spark node position rav.SetNodePosition("root", new Position(lp.X * scale, lp.Y * scale)); rav.SetNodePosition("spark", new Position((lp.X - 288) * scale, lp.Y) * scale); }
private void Instance_TouchEvent(object sender, Window.TouchEventArgs e) { if (isAnimating()) { return; } if (isEditMode && rotaryTouchController.SelectedItem != null) { if ((e.Touch.GetState(0) == PointStateType.Up)) { if (rotaryLayerView.GetMovingIcon()) { rotaryLayerView.RemoveMovingIcon(); } rotaryTouchController.SelectedItem.RaiseToTop(); rotaryTouchController.SelectedItem.Opacity = 1.0f; rotaryTouchController.SelectedItem.Scale = new Vector3(1.0f, 1.0f, 1.0f); Window.Instance.TouchEvent -= Instance_TouchEvent; int wrapperIdx = GetViewIndex(currentPage) * ApplicationConstants.MAX_ITEM_COUNT; wrapperList[wrapperIdx + (int)rotaryTouchController.SelectedItem.CurrentIndex].RotaryItem = rotaryTouchController.SelectedItem; rotaryTouchController.SelectedItem.ShowDeleteIcon(); rotaryTouchController.SelectedItem = null; } else if ((e.Touch.GetState(0) == PointStateType.Motion)) { Position mousePosition = new Position(e.Touch.GetScreenPosition(0).X, e.Touch.GetScreenPosition(0).Y); if (rotaryLayerView.GetMovingIcon()) { rotaryLayerView.GetMovingIcon().Position = mousePosition; } else { rotaryTouchController.SelectedItem.Position = mousePosition; rotaryTouchController.SelectedItem.HideDeleteIcon(); } if (mousePosition.X <= 50 && mousePosition.Y >= 100 && mousePosition.Y <= 260) { rotaryLayerView.AnimateLeftCue(); } else if (mousePosition.X >= 310 && mousePosition.Y >= 100 && mousePosition.Y <= 260) { rotaryLayerView.AnimateRightCue(); } else { rotaryLayerView.AnimateReturn(); } isPanDetector = false; } } }
private void Instance_TouchEvent(object sender, Window.TouchEventArgs e) { if (isEditMode && rotaryTouchController.SelectedItem != null) { if ((e.Touch.GetState(0) == PointStateType.Up)) { Tizen.Log.Error("MYLOG", "Finish edit mode\n"); rotaryTouchController.SelectedItem.RaiseToTop(); rotaryTouchController.SelectedItem.Scale = new Vector3(1.0f, 1.0f, 1.0f); Window.Instance.TouchEvent -= Instance_TouchEvent; int wrapperIdx = GetViewIndex(currentPage) * ApplicationConstants.MAX_ITEM_COUNT; wrapperList[wrapperIdx + (int)rotaryTouchController.SelectedItem.CurrentIndex].RotaryItem = rotaryTouchController.SelectedItem; rotaryTouchController.SelectedItem = null; } else if ((e.Touch.GetState(0) == PointStateType.Motion)) { Position mousePosition = new Position(e.Touch.GetScreenPosition(0).X, e.Touch.GetScreenPosition(0).Y); rotaryTouchController.SelectedItem.Position = mousePosition; if (animationManager.IsAnimating) { return; } //animationManager.IsAnimating = true; Tizen.Log.Error("MYLOG", "mouse X:" + mousePosition.X + ", Y:" + mousePosition.Y); if (mousePosition.X <= 50 && mousePosition.Y >= 100 && mousePosition.Y <= 260) { rotaryLayerView.AnimateLeftCue(); } else if (mousePosition.X >= 310 && mousePosition.Y >= 100 && mousePosition.Y <= 260) { rotaryLayerView.AnimateRightCue(); } else { rotaryLayerView.AnimateReturn(); } /* * else * { * ImageView view = rotaryLayerView.GetMovingIcon(); * view.ResourceUrl = rotaryTouchController.SelectedItem.ResourceUrl; * view.Position = mousePosition; * } */ } } }
/// <summary> /// Called when the touch event is received. /// Response to the touching of the screen is a change of the screen's position /// and of the selected pagination's indicator. /// </summary> /// <param name="sender"> Event sender </param> /// <param name="e"> Event argument </param> private void WindowTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetPointCount() < 1) { return; } switch (e.Touch.GetState(0)) { // The screen is touched: // the position is stored // the state IfTouched is changed to be true case PointStateType.Down: { TouchedPosition = e.Touch.GetScreenPosition(0); IfTouched = true; break; } // A new touched position is established // If the horizontal part of the Shift vector is greater than the threshold value // than the proper action is taken case PointStateType.Motion: { if (!IfTouched) { break; } Vector2 Shift = e.Touch.GetScreenPosition(0) - TouchedPosition; // If the Shift value is smaller than the threshold value = -30, // the MainVisualView position the pagination selected index are changed if (Shift[0] < -30 && PaginationExample.SelectedIndex > 0) { MainVisualView.Position2D = MainVisualView.Position2D + WindowShift; PaginationExample.SelectedIndex = PaginationExample.SelectedIndex - 1; IfTouched = false; } // If the Shift value is greater than the threshold value = 30, // the MainVisualView position the pagination selected index are changed if (Shift[0] > 30 && PaginationExample.SelectedIndex < PaginationExample.IndicatorCount - 1) { MainVisualView.Position2D = MainVisualView.Position2D - WindowShift; PaginationExample.SelectedIndex = PaginationExample.SelectedIndex + 1; IfTouched = false; } break; } } }
private void OnTouchEvent(object source, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { Tizen.Log.Debug("NUIDnDSource", "StartDragAndDrop"); shadowView = new ImageView(Tizen.Applications.Application.Current.DirectoryInfo.SharedResource + "dragsource.png"); DragData dragData; dragData.MimeType = "text/uri-list"; dragData.Data = Tizen.Applications.Application.Current.DirectoryInfo.SharedResource + "dragsource.png"; dnd.StartDragAndDrop(sourceView, shadowView, dragData, OnSourceEventFunc); } }
private void Window_TouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { string log = ""; log += $"view1 Size2D=({view1.Size2D.Width}, {view1.Size2D.Height}) \n"; log += $"SizeWidth={view1.SizeWidth}, SizeHeight={view1.SizeHeight} \n"; log += $"WidthResizePolicy={view1.WidthResizePolicy}, HeightResizePolicy={view1.HeightResizePolicy} \n"; log += $"WidthSpecification={view1.WidthSpecification}, HeightSpecification={view1.HeightSpecification} \n"; log += $"MinimumSize=({view1.MinimumSize.Width}, {view1.MinimumSize.Height}) \n"; log += $"MaximumSize=({view1.MaximumSize.Width}, {view1.MaximumSize.Height}) \n"; tlog.prt(log); } }
// Callback for window touched signal handling public void OnWindowTouched(object source, Window.TouchEventArgs e) { // Only animate the _text label when touch down happens if (e.Touch.GetState(0) == PointStateType.Down) { Log("OnWindowTouched() is called! PointStateType.DOWN came!"); myCount++; if (myCount > 1) { _animation.Stop(); Log("_animation.Stop() is called!"); } } }
private void Win_TouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { if (!done) { done = true; capture = new Capture(); capture.Start(root, new Size(345, 543), @"/opt/usr/nui_captured.jpg"); capture.Finished += onCaptureFinished; log.Debug(tag, $"capture done \n"); } } }
public void WinTouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Up) { if (belowParent == false) { SetParentBelow(); belowParent = true; } else { SetParentAbove(); belowParent = false; } } }
public void OnWindowTouched(object sender, Window.TouchEventArgs args) { if (args.Touch.GetState(0) == PointStateType.Down) { //Verify witch side of the screen was clicked by user. //Touch position is compared with half of the screen size. //When the left side of the screen is clicked the application shows the menu, otherwise the menu is hidden if (args.Touch.GetLocalPosition(0).X <= appWindow.Size.Width / 2) { MenuShow(); } else if (args.Touch.GetLocalPosition(0).X > appWindow.Size.Width / 2) { MenuHide(); } } }
// Callback for window touched signal handling private void OnWindowTouched(object sender, Window.TouchEventArgs e) { // Only animate the _text label when touch down happens if (e.Touch.GetState(0) == PointStateType.Down) { // Create a new _animation if (_animation) { _animation.Reset(); } _animation = new Animation(1000); // 1 second of duration _animation.AnimateTo(_imageView, "PixelArea", new RelativeVector4(0.0f, 0.0f, 1.0f, 1.0f), 0, 1000); _animation.EndAction = Animation.EndActions.Discard; _animation.PlayRange = new RelativeVector2(0.2f, 0.8f); // Play the _animation _animation.Play(); } }
private void Win_TouchEvent(object sender, Window.TouchEventArgs e) { if (e.Touch.GetState(0) == PointStateType.Down) { if (++cnt % 2 == 1) { if (player != null) { player.Pause(); tlog.Fatal(tag, $"player pause!"); } } else { if (player != null) { player.Start(); tlog.Fatal(tag, $"player start!"); } } } }
// Callback for window touched signal handling private void OnWindowTouched(object sender, Window.TouchEventArgs e) { // Only animate the _text label when touch down happens if (e.Touch.GetState(0) == PointStateType.Down) { // Create a new _animation if (_animation) { _animation.Reset(); } _animation = new Animation(1000); // 1 second of duration _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), Vector3.XAxis), 0, 500); _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), Vector3.XAxis), 500, 1000); _animation.EndAction = Animation.EndActions.Discard; // Connect the signal callback for animaiton finished signal _animation.Finished += AnimationFinished; // Play the _animation _animation.Play(); } }
private void OnChildViewWindowTouchEvent(object sender, Window.TouchEventArgs e) { log.Fatal(tag, $"OnChildViewWindowTouchEvent() called!"); }
private void OnWindowTouch(object sender, Window.TouchEventArgs e) { }
public void OnWindowTouched(object sender, Window.TouchEventArgs e) { Tizen.Log.Error("NUI", $"OnWindowTouched()! e.TouchData.GetState(0)={e.Touch.GetState(0)}"); }
private void OnTouchEvent(object source, Window.TouchEventArgs e) { }
// Callback for window touched signal handling public void OnWindowTouched(object sender, Window.TouchEventArgs e) { ////NUILog.Debug("OnWindowTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0)); }