Hardware and software setup

How to disable swipe up when turning on the phone. Touch gestures

Let's say you become the owner of a brand new smartphone. Ahead of you is an exciting "journey" through the sections of the menu, in which you can find a lot of interesting things. In addition, users are also interested in terms that are somehow related to touch devices. For example, what is a swipe? Not everyone knows, but meanwhile, they are faced with this almost daily, or even hourly.

Swype (from the English. swipe - hold without tearing + type - type text) - trademark, which is used by Swype Inc. to indicate a way to enter text in a way that does not lift your finger from the keyboard. It is believed that in this case the user is able to type much more words in the same period of time compared to a keyboard that does not use specified method text input.

Example based on Gboard keyboard:

Please note that the system is able to automatically select words (auto-selection).

This input method can be enabled/disabled via keyboard settings. On the example of the same application Gboard - "Continuous input":

Interestingly, the creator of the way to write text is the same person who once came up with the T9 text input system.

However, above is only one meaning of the word “swipe”, because there is one more from the English. swipe - swipe without tearing off. What does it mean? It means that the swipe is to swipe your finger across the smartphone screen. For example, if you need to open a panel quick access or the so-called curtain, you must swipe from the top of the screen to the bottom, that is, swipe your finger from top to bottom:

  • Swipe left - swipe left on the screen.
  • Swipe Right - Swipe right across the screen.
  • Swipe Down - Swipe down on the screen.
  • Swipe Up - Swipe up on the screen.

The term gesture is a way to combine finger movements across the screen to launch some kind of action; finger movement in this case is used instead of just touching or clicking. Full touch (complete touch) or mouse - move-capturing function - is needed in order for the gestures to register and be absolutely correct. Today good support This feature is only available in Safari browsers and Android.

If in your web application the user needs to use gestures, it is important to teach him right action- using help, animated examples, or some other kind of prompts (figure 8.5).

Rice. 8.5. Google Fast Flip is a new viewer that uses gestures on iPhone and Android devices. On the left you will see a warning dialog with instructions on how to use it. You will only see the instructions once.

Swipe gesture

The swipe gesture (also known as flip) is a touch browser technology commonly used to move content back and forth. This gesture is used, for example, in many photo galleries to change the displayed image and in presentations to flip through slides. The essence of the gesture is a simple finger movement along the X axis from left to right (horizontal swipe) or along the Y axis from top to bottom (vertical swipe). The swipe gesture is supported in almost every touch device, as it is performed with one finger.

There is no special standard event to intercept the swipe action, so we will emulate it using the available standard events

On Symbian 5th generation devices, if you use your finger instead of the cursor, the mouse down, move, and up events get rather strange results. The event fires only once during a finger drag action, and the event does not fire at all if the finger is moved from the initial mouse-down coordinates. Therefore, different approaches are needed to detect swipe in some situations.

Sequencing:

  1. Intercept the event (or ontouchstart in iPhone and other compatible browsers) and start recording the gesture.
  2. Intercept (or ontouchmove in iPhone and browsers with the required support) and continue recording the gesture if the x (or y) movement occurs within a certain threshold. Cancels the gesture if the movement is on a different axis.
  3. Intercept onmouseup (or ontouchend in iPhone and browsers with the necessary support) and if at that moment the gesture continued (was active) and the difference between the initial and final coordinates is greater than a certain constant - define swipe in one direction.

The last point can be replaced with an on-the-fly gesture test inside the onmousemove event.

If you use jQuery in your work, you can detect a horizontal swipe gesture on iPhone devices use the free plugin from here http://plugins.jquery.com/project/swipe .

With the help of the following code, we can create an object-oriented library for detecting swipe (compatible with iPhone, Android and other devices):

/** Creates a swipe event gesture handler */ function MobiSwipe(id) ( // Constants this.HORIZONTAL = 1; this.VERTICAL = 2; this.AXIS_THRESHOLD = 30; // The user will not define a perfect line this. GESTURE_DELTA = 60; // The min delta in the axis to fire the gesture // Public members this.direction = this.HORIZONTAL; this.element = document.getElementById(id); this.onswiperight = null; this.onswipeleft = null ;this.onswipeup = null; this.onswipedown = null; this.inGesture = false; // Private members this._originalX = 0 this._originalY = 0 var _this = this; // Makes the element clickable on iPhone this.element. onclick = function() (void(0)); var mousedown = function(event) ( // Finger press event.preventDefault(); _this.inGesture = true; _this._originalX = (event.touches) ? event.touches. pageX: event.pageX; _this._originalY = (event.touches) ? event.touches.pageY: event.pageY; // Only for iPhone if (event.touches && event.touches.length!=1) ( _this.inGesture = false; // Cancel gesture on multiple touch ) ); var mousemove = function(event) ( // Finger moving event.preventDefault(); var delta = 0; // Get coordinates using iPhone or standard technique var currentX = (event.touches) ? event.touches.pageX: event.pageX ; var currentY = (event.touches) ? event.touches.pageY: event.pageY; // Check if the user is still in line with the axis if (_this.inGesture) ( if ((_this.direction==_this. HORIZONTAL)) ( delta = Math. abs(currentY-_this._originalY); ) else ( delta = Math. abs(currentX-_this._originalX); ) if (delta >_this.AXIS_THRESHOLD) ( // Cancel the gesture, the user is moving in the other axis _this.inGesture = false; ) ) // Check if we can consider it a swipe if (_this.inGesture) ( if (_this.direction==_this.HORIZONTAL) ( delta = Math.abs( currentX-_this._originalX); if (currentX>_this._originalX) ( direction = 0; ) else ( direction = 1; ) ) else ( delta = Math. abs(currentY-_this._originalY); if (currentY>_this. _originalY) ( direction = 2; ) else ( direction = 3; ) ) if (delta >= _this.GESTURE_ DELTA) ( // Gesture detected! var handler = null; switch(direction) ( case 0: handler = _this.onswiperight; break; case 1: handler = _this.onswipeleft; break; case 2: handler = _this.onswipedown; break; case 3: handler = _this.onswipeup; break; ) if (handler!=null) ( // Call to the callback with the optional delta handler(delta); ) _this.inGesture = false; ) ) ); // iPhone and Android"s events this.element.addEventListener("touchstart", mousedown, false); this.element.addEventListener("touchmove", mousemove, false); this.element.addEventListener("touchcancel", function( ) ( _this.inGesture = false; ), false); // We should also assign our mousedown and mousemove functions to // standard events on compatible devices )

Here is a simple example using our swipe.js library with horizontal swipe detection and more

with vertical detection:

Swipe Gesture Detection

vertical swipe
Horizontal Swipe

On many touch devices, the drag gesture is used to scroll through the content of a page and does not support the preventDefault function (we talked about the default behavior prevention function earlier in this chapter). That is why, in addition to the swipe gesture, we must consider others available ways navigation.

Zoom and rotate gestures

When the iPhone first came out, the coolest features were the zoom and rotate gestures. Using the pinching gesture (pushing and spreading two fingers in a pinch), the user could zoom in or out on the content - this is usually an image - on the page, and by rotating two fingers in a circle, the image can be rotated.

In devices where there is no multi-touch support, zoom functions must be implemented using conventional floating buttons and sliders.

Fortunately, starting with iOS 2.0, these gestures can be detected without resorting to low-level math in touch events. Table 8.35 lists three WebKit extensions that are available as events. AT Android browser support for these events has also been added.

The same events are used for scaling and rotation. All three receive a GestureEvent parameter. This parameter has the typical event properties, as well as additional scale and rotation properties.

The scale property defines the distance between two fingers as a floating point multiplier from the start of the distance where the gesture started. If the value is greater than 1.0, then it is an open pinch (increase), and if the value is 1.0, it means a close pinch (decrease).

rotation gives the value (in degrees) of the delta (distance) of the rotation from the start point. If the user rotates the object clockwise, then we get a positive value, and if against, then the value will be negative.

I know what you're thinking right now: "Rotating and scaling is great, but what's the use of them if we're working with HTML?". Here we come on css help extensions for Safari on iOS (and other browsers with corresponding support) with one property and two functions to control its value: rotate and scale.

The rotate function takes a parameter in degrees and we need to define the deg unit after the number (eg rotate(90deg)). We can learn this from the script using element.style.webkitTransform.

Let's look at a simple example:

Gesture Management

How the example works can be seen in Figure 8-6. On compatible devices, you can rotate and zoom with two fingers

(together with all content). But what is the problem here? The transform style is always applied to the original element. So, if we apply a scale of 2.0 to an element, and then increase it by 0.5 again, the new value will be 0.5, not 1.0 as we might expect.

Rice. 8.6. By combining touch events with CSS transforms, you can rotate and scale elements on your site.

For typical zoom-rotate behavior, we should replace the function with the following:

The vast majority of modern mobile devices have touch screen, with which you can control the gadget. Those. instead of pressing mechanical buttons, the user controls his smartphone or tablet with gestures and touches on the screen. For a novice user of the Android operating system under which they work a large number of touch mobile devices, at first this way of interacting with his gadget will be unusual. However, the development of gestures occurs almost immediately and does not cause difficulties in the future.

What gestures are used to control android smartphone/tablet

Touch or tap

Touch has a second name - tap. This is the most common action used in touch control. By tapping, you can turn on any functions, launch programs, select menu items, activate a parameter, etc. A touch is like a mouse click on a computer. If in relation to the computer they say - click the mouse, then in Android you can hear - tap or double tap.

To perform this action, you guessed it, is very simple. You need to touch with your fingertip in the right place on the screen. For example, to launch an application, just tap on its icon. If text input is required, it is enough to touch in the input field to display , on which you can type text by touching the characters.

Double tap or double tap

Here again there is an analogy with a double click of the mouse in the computer. True, unlike a computer, where double-clicking launches a program, in android devices double tap used to turn on and off the provided functions in programs and change the scale. For example, to zoom in on a website page when viewing it in a browser, tap the screen twice quickly. To return to the previous scale, you need to repeat the double tap.

Touch and hold or long tap

Touch with hold or long tap is a kind of analogue of a click right button mouse where this action is used to call context menu with a choice of options. A long tap also opens additional actions in cases where they are provided by the application or the Android operating system itself.

To perform a touch and hold, you need to touch the screen in the desired place and hold your finger for a while. As a result, a menu will appear with a choice of actions provided by the application or operating system.

Swipe, swipe, or swipe

Scrolling or swiping is used to turn pages, scroll desktops on the screen, move through lists, menus, etc. The swipe can be either horizontal or vertical. To perform page flipping when required by a program or operating system android system, then you need to touch the screen with your finger and, without releasing it, swipe it in the desired direction, provided for by the circumstances (left-to-right, right-to-left, bottom-up, top-down, or diagonally).

Touch with move

Touch with move in Android OS is analogous to dragging an object with the mouse while holding down the left button. As in computer operating systems, in touch devices running mobile operating systems, drag and drop allows you to move objects (folders, files, icons, etc.) from one place to another.

To perform this action, touch the desired item on the screen and do not release your finger. When the object is selected, it can be dragged to the desired location.

Pinch in/spread out or zoom in

You can also hear the name this action like a pinch. It really resembles a pinch with your fingers, because. to perform it, you need to touch the gadget screen with two fingers and, without releasing them, bring them together or part them. As a result of these actions, the scale of the image on the screen will be changed, if it is provided by the application.

All gestures in Android are intuitive and not complicated. After a little training, you will confidently control your smartphone or tablet without even thinking about your actions.

Talking about the various capabilities of devices based on the Android OS, we often use such an unusual word as “swipe”. It turned out that many users do not know its meaning. Let's fill this gap.

The word swipe has two meanings at once. In the first case, a swipe is a special gesture when you put your finger on the screen of a smartphone or tablet and move it in the desired direction across the screen. For example, to open the shutter on a smartphone, you need to swipe from the top frame of the device to the bottom:

It is important to note that the word “swipe” in this sense can be used in relation to any device that supports such finger movements on the screen, and not just on the Android OS. So, movements on the screen on Apple devices(iPhone, iPad) are also called swipe.

The second value is the name Swipe keyboards, which allows you to enter text on the screen of your smartphone or tablet without lifting your finger. The creator of the Swype keyboard (from the English swipe - hold without tearing, slide and type - print text) is Cliff Kushler.

Currently, you can find many keyboard apps in online app stores that support writing text without lifting your finger from the screen. It is believed that the swipe keyboard allows you to type much faster than a standard keyboard.

It's no secret that holding the home button or swiping up from it home screen call in android service individual tips Google Now. However, not everyone may find it useful. And those who appreciate Google's efforts to please the user, most often already have Google Now at their disposal on the far left screen thanks to pure android or Google launcher Start. In fact, because of this, a very handy feature remains useless. But, as always, third-party developers and their Swipeup Utility app come to the rescue!

Of course, experienced users will immediately note that such applications in Google Play certainly not a dozen. However, the Swipe Up Utility can prove to have several advantages.

First, let's not forget that Android left version 2.0 behind a long time ago and no longer makes users cry tears of blood. On the contrary, with the advent of Lollipop and the spread of canons among developers, Google's mobile OS has become a true haven for interface aesthetes. Swipeup Utility, despite the fact that its interface, in fact, was created for a one-time application setup, is made quite in the spirit of the times. It, of course, does not have a floating button or a retractable curtain with a bewitching arrow animation, but they are useless here. But he has a nice icon and icons of the proposed functions.

By the way, about functions. Swipeup Utility boasts not only a choice of which application will launch after a swipe up (or holding a button), but also offers several system alternatives. Some of them are free, and some require the purchase of a paid version of the application. However, 51.74 rubles is quite a democratic price. In particular, one of the most interesting customization options is to call the notification curtain. I think such a solution can save a lot of smartphones from a spectacular screen with a cobweb of cracks.

Among other things, the application will be disciplined to count how many times it has saved you from calling Google Now. Who knows what statistics can come in handy in life.

Appendix: Swipeup Utility Developer: Adrian Campos Category: Instruments Version: 1.9.3 Price: For free Download:
Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!