Summary of the invention
In order to solve the problems of the technologies described above, the invention provides page transmission method and the device of touch-screen, can realize the page-turning effect that has more hommization, improve user and experience.
The page transmission method that the invention provides touch-screen, comprising:
Detect the operation trace of touch point on screen, current page is followed described operation trace and is carried out page turning;
Determine target pages according to described operation trace, and calculate the residue page turning distance of described current page, described page object comprises current page, front page, rear page; Particularly, according to the operation trace of described touch point, record sample point coordinate, reentry point quantity, end point coordinate in starting point coordinate, the track of described operation trace;
According to the sample point coordinate in described starting point coordinate, described track, described end point coordinate, calculate the translational speed of described touch point and the shift length of described touch point;
In the time that described reentry point quantity is odd number, determine that target pages is described current page;
When described translational speed is less than default threshold speed and described shift length is less than default distance threshold, determine that target pages is described current page;
When reentry point quantity is even number, and described translational speed is not less than default threshold speed or described shift length is not less than default distance threshold, is judged as and is not to return current page;
When being judged as while returning to current page, described residue page turning distance is the shift length of described touch point; When being judged as while not being to return to current page, according to the shift length of described starting point and described end point, determine that page turning direction is for page turning or backward page turning forward, described residue page turning distance is for deducting the distance after the displacement of described touch point in page turning direction;
Complete the remaining page turning of current page, described target pages is sent on screen.
Correspondingly, the present invention also provides the page conveyer of touch-screen, comprising:
Unit is followed in page turning, the track moving on screen for detection of touch point, and the operation trace that makes current page follow described touch point is carried out page turning;
Follow with described page turning the parameter determining unit that unit is connected, for determining target pages according to described operation trace, and calculate the residue page turning distance of described current page; Wherein, described parameter determining unit comprises,
Coordinate points record cell, for according to the operation trace of described touch point, records sample point coordinate, reentry point quantity, end point coordinate in starting point coordinate, the track of described operation trace;
Judging unit is dragged in returning of being connected with described coordinate points record cell, for according to the relative position relation of the sampled point of described starting point, described track, described end point and reentry point quantity, judges whether to return current page; Drag judging unit to comprise described time: contact translational speed computing unit, for according to the sample point coordinate of described starting point coordinate, described track, described end point coordinate, calculates the translational speed of described touch point; Contact displacement computing unit, for according to described starting point coordinate, described end point coordinate, determines the displacement of touch point; The comparison judgment unit being connected respectively with described contact translational speed computing unit, described contact displacement computing unit, for the magnitude relationship of more described translational speed and default threshold speed, and the magnitude relationship of shift length and default distance threshold, and determine according to result and reentry point quantity relatively whether target pages is described current page, in the time that described reentry point quantity is odd number, determine that target pages is described current page; When described translational speed is less than default threshold speed and described shift length is less than default distance threshold, determine that target pages is described current page; When reentry point quantity is even number, and described translational speed is not less than default threshold speed or described shift length is not less than default distance threshold, is judged as and is not to return current page;
The page turning orientation determination unit that drags judging unit to be connected with described time, for when being judged as while not being to return to current page, according to the shift length of described starting point and described end point, determines that described page turning direction is for page turning or backward page turning forward; Apart from computing unit, under the state that returns to current page, described residue page turning distance is defined as to the displacement of described touch point with the residue page that drags for described time judging unit, described page turning orientation determination unit to be connected respectively; Also for forward direction page turning or after under the state of page turning, by described residue page turning distance for deducting the distance after the displacement of described touch point in page turning direction;
The page turning transfer unit being connected with described parameter determining unit, completes the remaining page turning of current page for the parameter of obtaining according to described parameter determining unit, and described target pages is sent on screen.
Implement the present invention, there is following beneficial effect:
The present invention can realize the movement of following touch point and the real-time dynamic effect that transmits the page, the intention of operation of the operation trace analysis user moving according to touch point, identify user intention for returning to current page, forward direction page turning, backward page turning, make page-turning effect have more hommization, more smooth.The technology of the present invention can be brought visual new experience to user, user is experienced and touch the enjoyment that operation brings.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, the present invention is described in further detail.
Fig. 1 is the process flow diagram of the page transmission method of touch-screen of the present invention, comprising:
S101: detect the operation trace of touch point on screen, current page is followed described operation trace and carried out page turning;
S102: determine target pages according to described operation trace, and calculate the residue page turning distance of described current page, described page object comprises current page, front page, rear page;
S103: complete the remaining page turning of current page, described target pages is sent on screen.
In the middle of prior art, the effect of page turning is most adopts uniform motion, or flashes across, or moves lentamente, and its effect is comparatively single, greatly differs from each other with people's reading habit.For example, in the time that people wish that the action of page turning is changed into page turning backward or wants to return to current page forward from one, the click that can only come and go by multi-pass operations, shortcoming hommization.The page turning process of the page of the present invention is decided by user's touch point completely.When page turning starts, current page is followed the operation trace of described touch point and is carried out page turning.In page turning process, if user's flip-flop idea, while wishing to return to current page or forward other page to, the present invention can analyze according to user's operation trace, determines target pages.Finally, according to residue page turning distance, complete remaining page turning process natural and trippingly, described target pages is sent on screen.In sum, the more aobvious hommization of page turning process, follows one's bent.
Fig. 2 is the embodiment process flow diagram of the page transmission method of touch-screen of the present invention, and compared to Figure 1, Fig. 2 is the concrete grammar process flow diagram of the embodiment of the present invention, below in conjunction with Fig. 2, the present invention is described further.
S201: detect the operation trace of touch point on screen, current page is followed described operation trace and carried out page turning.
In the time that user's touch point drops on movably on the page, current page is labeled as removable, and make current page follow touch point to move.Described current page comprises current interface or current form.When touch point moves on screen, its operation trace is two-dimentional planar obit simulation, but the movement of the page only need be followed the variation of this track in page turning direction and be moved.Briefly, if the page carries out page turning in X direction, page turning process so only need be followed the coordinate of operation trace on transverse axis and changed and move, and ignores the impact of the change of operation trace on y direction on page turning.
S202: according to the operation trace of described touch point, record sample point coordinate, reentry point quantity, end point coordinate in starting point coordinate, the track of described operation trace.
In the time that touch point falls, the coordinate position of record start point and system time.Be accompanied by the movement of touch point, the sampled point in track process is carried out to record, obtain the sample point coordinate in track.Finally, when touch point lifts, end of record (EOR) point coordinate.
S203: according to the sample point coordinate in described starting point coordinate, described track, described end point coordinate, calculate the translational speed of described touch point and the shift length of described touch point.
Preferably, calculate the translational speed of touch point according to the sample point coordinate in described track.Suppose gather 10 points, coordinate be respectively S1, S2 ... S8, S9, S10, the time be respectively T1, T2 ... T8, T9, T10, the translational speed of touch point:
The shift length of described touch point is described starting point coordinate and the distance of described end point coordinate in page turning direction, and for example horizontal ordinate direction is page turning direction, and the difference of the horizontal ordinate of starting point and end point is shift length so.
S204: judge whether to return current page.
Particularly, when described translational speed is less than default threshold speed and described shift length is less than default distance threshold, or described moving process has odd number reentry point, determines that target pages is described current page;
When described translational speed is not less than default threshold speed or described shift length is not less than default distance threshold, and described moving process has even number reentry point, is judged as and is not to return current page.
Preferably, be applicable to giant-screen resolution, the maximal rate V that default touch point moves
drag Max=5000, usual speed V
drag Nor=3000, minimum speed V
drag Min=50, the minimum shift length S of page turning
drag Min=100.In the time there is one of following each situation, be judged as and return to current page:
1) verso is turned right and is dragged
2) recto is turned left and is dragged
3) shift length is less than preset value S
drag Minand translational speed is lower than mxm. V
drag Max70%
4) drag in process and be judged as back and drag
Preferably, the judgment mode back dragging can be: record mouse position with three variable X 1, X2, X3, be the sample point coordinate in described track.In the time that mouse falls, X1=X2=X3 equals mouse current location, when mouse moves, X3 equals mouse position, if (X3-X2) (X2-X1) >=0, and (X3-X2) >=m, X3=X2, if (X3-X2) (X2-X1) <0, and | X3-X2|>=m, whether return and get its inverse value and (do not return if be before, think and occurred to return, if think before and occurred to return, be labeled as and return), X2=X1, X3=X2.Wherein, preferably, preset value m=5, relevant with the susceptibility of sampling.
Fig. 3 be touch-screen of the present invention page transmission method before turn over schematic diagram; Fig. 4 be touch-screen of the present invention page transmission method after turn over schematic diagram.Taking Fig. 3 as example, illustrate below: as shown in Figure 3, user's touch point operation trace is ABCD, and starting point is A, and end point is D, and page turning direction is X direction, and touch point is respectively TA, TB, TC, TD in the time of an A, B, C, D.X1=0, X2=0, the X3=0 in the time of the TA time of the sample point coordinate in described track.Suppose that B point horizontal ordinate is 110, in the TB moment, X1=0, X2=0, X3=110, but according to " (X3-X2) (X2-X1) >=0; and (X3-X2) >=m, X3=X2, wherein m=5 ", can obtain the moment at TB, X1=0, the X2=110 of correction, X3=110.Now, when described translational speed is not less than default threshold speed or described shift length is not less than default distance threshold, be judged as and be not to return current page, in the present embodiment, default threshold speed is V
drag Max70%; Default distance threshold is S
drag Min=100.Suppose that C point transverse axis coordinate is-110, the horizontal ordinate of ordering with respect to A is 0, arrive the TC moment, X1=0, X2=110, X3=-110, according to " (X3-X2) (X2-X1) <0, and | X3-X2|>=m; whether return and get its inverse value " known, before the TC moment, do not confirm as " returning ", so, judge at a B place and occurred to return.In the TC moment, X1=110, X2=-110, X3=-110.In fact, user is from a B C that turns back, and illustrates that user stirs from one to change into the intention of operation returning, and if fruit dot C is for lifting point (for end point), so, this operation trace should be judged as returns to operation.But, in the middle of the present embodiment, user is again from a C D that turns back, and final D is end point, in like manner, in the TD moment, according to " (X3-X2) (X2-X1) <0, and | X3-X2|>=m, whether return and get its inverse value ", because a B confirms as " returning ", so time confirm as " not returning ".
According to above-mentioned judgement, when being judged as while returning to current page, forward step S2041 to; When being judged as while not being to return to current page, forward step S2042 to.
S2041: when described residue page turning distance is the displacement of described touch point.
S2042: according to the shift length of described starting point and described end point, determine that described page turning direction is for page turning or backward page turning forward, described residue page turning distance is for deducting the distance after the displacement of described touch point in page turning direction.
Connect described in example, now, though make the confirmation of " not returning ", but page turning is turned over before being or after turn over, still return to current page, not yet finally determine.Suppose to turn over before contact translational speed meets or after the threshold speed condition of turning over, the distance of the horizontal ordinate between A and D just becomes pacing factor so.As shown in Figure 3 or Figure 4, if the distance of the horizontal ordinate between A, D is less than default shift length, return to current page; If be greater than default shift length, as shown in Figure 3, known for front to turn over to the displacement vector of some D by an A; As shown in Figure 4, turn over after being.
For residue page turning distance, if return to current page, the distance of the horizontal ordinate between A, D is residue page turning distance; If before turn over or after turn over, remain displacement and equal full screen distance and deduct the horizontal ordinate distance between A, D, as shown in Figure 3 or Figure 4, Y1+Y2=residue page turning distance.
S205: according to the translational speed of described touch point and described residue page turning apart from translational speed and the retarded velocity of calculating the page.
S206: described current page completes remaining page turning process according to the translational speed of the described page and described retarded velocity.
First calculate translational speed and the retarded velocity of the page according to the translational speed of touch point, by full frame calculating, the translational speed V of the page and retarded velocity d and mobile frequency n meet:
V=S*2/ndV/(n-1)=V
2/S*2-V
Taking the resolution of 1920*1080 as example, by test, find that effect is ideal with the full frame n=20 when mobile of usual speed, quick full frame n=10 when mobile, full frame n=30 when mobile at a slow speed.Can obtain minimum speed V
min=128, usual speed V
nor=192, maximal rate V
max=384; Minimum deceleration degree d
min=4.41, common retarded velocity d
nor=10.10, maximum deceleration d
max=42.67.When translational speed is less than minimum value V
drag Mintime, speed V=V
min, retarded velocity d=d
min, when translational speed is higher than mxm. V
drag Maxtime, speed V=V
max, retarded velocity d=d
maxas the relevant district [V of dropping on property of translational speed VT line
drag Min, V
drag Max] time,
Then, calculate the impact of residue displacement on translational speed and retarded velocity.Whole screen divider can be become to multiple intervals, different resolution has different interval division optimum values, taking 1920*1080 and divide four intervals as example, four intervals are respectively [0,480] [480,960] [960,1440] simulate by programming [1440,1920], can learn, when with usual speed (moving screen completely for 20 times), the number of times moving on four intervals is respectively 8,6,4,2.The average velocity that is 480,960,1440,1920 o'clock when Distance Remaining is respectively 60,68.6,80,96.Its retarded velocity is 17.14,10.55,10.41,10.10.Average velocity and deceleration value by above each value when full frame, can draw the Interval value of each overall speed and retarded velocity, therefore its velocity coefficient α is respectively 0.625,0.715,0.833,1.0, retarded velocity factor beta is respectively 1.697,1.044,1.031,1.0.The impact of comprehensive translational speed, final speed and retarded velocity:
S207: when described page movement speed reduces to zero according to described retarded velocity, and while not yet completing remaining page turning process, described target pages is moved on the predeterminated position of screen according to pre-set velocity.
Due to reasons such as systematic errors, when the translational speed of the page of trying to achieve by above-mentioned algorithm and retarded velocity move the page, page location apart from ideal position be 0 with speed be 0 possibly cannot reach simultaneously, now, in order further to make the more aobvious nature of page movement and smoothness, just need translational speed and position to revise.Preferably, when speed is less than certain value when being less than 5, add the retarded velocity size that this moves to present speed, make it return to a velocity magnitude, when page location apart from ideal position value be less than present speed size 120% time, directly current page is moved to predeterminated position according to pre-set velocity, and velocity magnitude is set to 0, finish this and move.
Fig. 5 is the schematic diagram of the page conveyer of touch-screen of the present invention, comprising:
Unit is followed in page turning, the track moving on screen for detection of touch point, and the operation trace that makes current page follow described touch point is carried out page turning;
Follow with described page turning the parameter determining unit that unit is connected, for determining target pages according to described operation trace, and calculate the residue page turning distance of described current page;
The page turning transfer unit being connected with described parameter determining unit, completes the remaining page turning of current page for the parameter of obtaining according to described parameter determining unit, and described target pages is sent on screen.
Fig. 5 is corresponding with Fig. 1, identical with method of the method for operation of above-mentioned unit.
Fig. 6 is the embodiment process flow diagram of the page conveyer of touch-screen of the present invention.
As shown in Figure 6, described parameter determining unit comprises:
Coordinate points record cell, for according to the operation trace of described touch point, records sample point coordinate, reentry point quantity, end point coordinate in starting point coordinate, the track of described operation trace;
Judging unit is dragged in returning of being connected with described coordinate points record cell, for according to the relative position relation of the sampled point of described starting point, described track, described end point and reentry point quantity, judges whether to return current page;
The page turning orientation determination unit that drags judging unit to be connected with described time, for when being judged as while not being to return to current page, according to the shift length of described starting point and described end point, determines that described page turning direction is for page turning or backward page turning forward;
Apart from computing unit, under the state that returns to current page, described residue page turning distance is defined as to the displacement of described touch point with the residue page that drags for described time judging unit, described page turning orientation determination unit to be connected respectively; Also for forward direction page turning or after under the state of page turning, by described residue page turning distance for deducting the distance after the displacement of described touch point in page turning direction.
Drag judging unit to comprise described time:
Contact translational speed computing unit, for according to the sample point coordinate of described starting point coordinate, described track, described end point coordinate, calculates the translational speed of described touch point;
Contact displacement computing unit, for according to described starting point coordinate, described end point coordinate, determines the displacement of touch point;
The comparison judgment unit being connected respectively with described contact translational speed computing unit, described contact displacement computing unit, for the magnitude relationship of more described translational speed and default threshold speed, and the magnitude relationship of described shift length and default distance threshold, and determine according to result and reentry point quantity relatively whether target pages is described current page.
Described page turning transfer unit comprises:
The page movement speed computing unit being connected respectively apart from computing unit, described contact translational speed computing unit with described residue page, for according to the translational speed of described touch point and described residue page turning apart from the translational speed of calculating the page;
The page retarded velocity computing unit being connected respectively apart from computing unit, described contact translational speed computing unit with described residue page, for according to the translational speed of described touch point and described residue page turning apart from the retarded velocity of calculating the page;
The page delivery unit being connected respectively with described page movement speed computing unit, described page retarded velocity computing unit, for completing remaining page turning process by described current page according to the translational speed of the described page and described retarded velocity.
Described page delivery unit comprises:
The error correction unit being connected with described page delivery unit, for reducing to zero according to described retarded velocity when described page movement speed, and while not yet completing remaining page turning process, moves to described target pages on the predeterminated position of screen according to pre-set velocity.
Fig. 6 is corresponding with Fig. 2, identical with method of the method for operation of above-mentioned unit.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add essential hardware platform by software and realize, and can certainly all implement by hardware.Based on such understanding, what technical scheme of the present invention contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions (can be personal computers in order to make a computer equipment, server, or the network equipment etc.) carry out the method described in some part of each embodiment of the present invention or embodiment.
Above-described embodiment of the present invention, does not form limiting the scope of the present invention.Any amendment of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in claim protection domain of the present invention.