The realization method and system that a kind of icon rotates
Technical field
The present invention relates to icon and control technical field, be specifically related to a kind of lifting user mutual with icon, it is achieved the reality that icon rotates
Existing method and system.
Background technology
Along with the development of information technology, from strength to strength, mobile terminal desktop system is added with the function of existing mobile terminal device
Diversiform icon, but the icon of existing desktop is all static, does not support mutual, and user does not has with icon in the operation of desktop
There is interaction, lack interest and playability, it is difficult to meet user's functional requirement to dynamically change, have become as industry and urgently solve
Problem certainly.
Summary of the invention
The purpose of the present invention, it is simply that overcome the deficiencies in the prior art, it is provided that a kind of can by desktop icons well with the operation of user
Carry out interaction, solve conventional desktop icons can only see, immotile problem, increase Consumer's Experience icon rotate realization side
Method.
For realizing another object of the present invention, the present invention also provide for a kind of icon rotate realize system.
In order to achieve the above object, adopt the following technical scheme that the implementation method that a kind of icon rotates, comprise the following steps:
S1, preset icon rotation status event, preset the response action triggering icon rotation status event;
Whether S2, monitoring response action occur, and if so, carry out next step;If it is not, circulatory monitoring;
S3, entrance icon rotation status event, detection finger slides and responds, obtains the coordinate value of slip;
S4, according to slide coordinate value, the coordinate value in conjunction with icon calculates, and draws the angle value that icon rotates;
S5, icon rotate corresponding angle with coordinate value for initial point according to angle value.
Further, according to the coordinate value slided in described step S4, the coordinate value in conjunction with icon calculates, and show that icon revolves
The concrete calculation of the angle value turned is:
Obtain x, y value of icon place coordinate, x1, y1 value of finger slip coordinate respectively, carry out phase by y value with y1 value
Subtract, subtract each other with x1 value by x value, obtain a result and carry out antitrigonometric function calculating, calculate the first angle value, by the first angle
The angle value that value is turned with a front icon subtracts each other, and draws the required angle value rotated of current icon.
Further, described triggering icon rotation status event response action particularly as follows:
Presetting the long threshold values by triggering icon rotation status event, whether the long icon time value of pressing of monitoring, more than threshold values, is if so, touched
Send out icon rotation status event, if it is not, circulatory monitoring;
Or, preset gravity sensing event, monitor whether to trigger gravity sensing event, if so, trigger icon rotation status event,
If it is not, circulatory monitoring;
Or, preset acoustic control sense events, monitor whether to trigger acoustic control sense events, if so, trigger icon rotation status event,
If it is not, circulatory monitoring.
Further, described step S1 also includes: presetting the response action triggering icon moving event, described triggering icon moves thing
The response action of part particularly as follows:
Presetting the long threshold values by triggering icon moving event, the long icon time value of pressing of monitoring, whether more than threshold values, if so, enters figure
Mark moving event, icon followed by the slip of finger and moves, if it is not, circulatory monitoring;
Or, preset gravity sensing event, monitor whether to trigger gravity sensing event, if so, trigger icon moving event, if
No, circulatory monitoring;
Or, preset acoustic control sense events, monitor whether to trigger acoustic control sense events, if so, trigger icon moving event, if
No, circulatory monitoring.
Further, described default length is long by the valve triggering icon rotation status event with default by the threshold values triggering icon moving event
It is worth identical, when i.e. length presses icon time value more than threshold values, triggers icon moving event and icon rotation status event simultaneously;Work as length
When sliding by the finger of icon, icon followed by the slip of finger and moves;When the long finger pressed slides, another finger also exists
During slip, icon had both been followed and long had been moved by the slip of finger, the angle value also calculated according to the slip coordinate of another finger with
Current place coordinate value is the rotation that initial point makees respective angles.
For realizing another object of the present invention, the present invention also adopts the following technical scheme that the system that realizes that a kind of icon rotates, bag
Include:
Module is set, for preset icon rotation status event, presets the response action triggering icon rotation status event;
Monitoring modular, is used for monitoring whether response action occurs;
Acquisition module, when entering icon rotation status event, detection finger slides and responds, and obtains the coordinate value slided;
Computing module, the coordinate value slided according to finger, the coordinate value in conjunction with icon calculates, and draws the angle that icon rotates
Value, icon rotates corresponding angle with coordinate value for initial point according to angle value.
Further, described computing module show that the concrete calculation of angle value that icon rotates is: acquisition module obtains figure respectively
X, y value of mark place coordinate, x1, y1 value of finger slip coordinate, computing module y value is subtracted each other with y1 value, uses x
Value is subtracted each other with x1 value, obtains a result and carries out antitrigonometric function calculating, calculates the first angle value, by the first angle value with previous
The angle value that secondary icon is turned subtracts each other, and draws the required angle value rotated of current icon.
Further, described triggering icon rotation status event response action particularly as follows:
Arranging module and preset the long threshold values by triggering icon rotation status event, it is the biggest that monitoring module monitors length presses icon time value
In threshold values, if so, trigger icon rotation status event, if it is not, circulatory monitoring;
Or, module is set and presets gravity sensing event, whether monitoring module monitors triggers gravity sensing event, if so, triggers
Icon rotation status event, if it is not, circulatory monitoring;
Or, module is set and presets acoustic control sense events, whether monitoring module monitors triggers acoustic control sense events, if so, triggers
Icon rotation status event, if it is not, circulatory monitoring.
Further, the described module that arranges also includes presetting the response action triggering icon moving event, and described triggering icon moves thing
The response action of part particularly as follows:
Arranging module and preset the long threshold values by triggering icon moving event, whether monitoring module monitors length presses icon time value more than valve
Value, if so, enters icon moving event, and icon followed by the slip of finger and moves, if it is not, circulatory monitoring;
Or, module is set and presets gravity sensing event, whether monitoring module monitors triggers gravity sensing event, if so, triggers
Icon moving event, if it is not, circulatory monitoring;
Or, module is set and presets acoustic control sense events, whether monitoring module monitors triggers acoustic control sense events, if so, triggers
Icon moving event, if it is not, circulatory monitoring.
Further, the described module that arranges is preset long long by triggering icon rotation status with default by the threshold values triggering icon moving event
The threshold values of event is identical, when i.e. length presses icon time value more than threshold values, triggers icon moving event and icon rotation status thing simultaneously
Part;When monitoring module monitors to the long finger pressing icon is slided, icon followed by the slip of finger and moves;Work as monitoring modular
Monitor long by finger slide time, another finger is also when sliding, and icon had both been followed and long moved by the slip of finger, also root
The angle value calculated according to the slip coordinate of another finger makees the rotation of respective angles with current place coordinate value for initial point.
Compared with prior art, the beneficial effects of the present invention is: the present invention passes through preset icon rotation status event, preset and touch
Sending out the response action of icon rotation status event, when response action occurs, the coordinate value that icon slides according to finger is sat with icon
Scale value carries out the angle value that computing draws and carries out the rotation of respective angles, the mutual effect making to rotate to realize icon response finger to slide
Really;The desktop icons made operation with user well carries out interaction, solve conventional desktop icons can only see, immotile
Problem, adds the experience of user.
Accompanying drawing explanation
The module diagram of the system that realizes that Fig. 1 embodiment of the present invention one icon rotates;
The flow chart of the implementation method that Fig. 2 embodiment of the present invention one icon rotates;
The implementation method flow chart that Fig. 3 embodiment of the present invention two icon rotates;
The design sketch that Fig. 4 embodiment of the present invention two icon rotates;
The implementation method flow chart that Fig. 5 embodiment of the present invention three icon rotates;
The implementation method flow chart that Fig. 6 embodiment of the present invention four icon rotates.
Detailed description of the invention
Describing the present invention in detail below in conjunction with accompanying drawing and specific implementation method, the exemplary embodiment and description in the present invention are used
Explain the present invention, but not as a limitation of the invention.
Embodiment one:
As it is shown in figure 1, a kind of icon rotate realize system, including:
Module is set, for preset icon rotation status event and icon moving event, presets and trigger icon rotation status event
Response action, presets the response action triggering icon moving event, and the response action of described triggering icon rotation status event is concrete
For: arranging module and presetting length by the threshold values of triggering icon rotation status event is 1s;The response of described triggering icon moving event is moved
Make particularly as follows: arrange module presetting long is 0.5s by the threshold values of triggering icon moving event.
Monitoring modular, is used for monitoring whether response action occurs.
Acquisition module, when entering icon rotation status event, detection finger slides and responds, and obtains the coordinate value slided.
Computing module, the coordinate value slided according to finger, the coordinate value in conjunction with icon calculates, and draws the angle that icon rotates
Value, icon rotates corresponding angle with coordinate value for initial point according to angle value, and concrete calculation is: acquisition module obtains respectively
X, y value of icon place coordinate, x1, y1 value of finger slip coordinate, computing module y value is subtracted each other with y1 value, uses
X value is subtracted each other with x1 value, obtains a result and carries out antitrigonometric function calculating, calculates the first angle value, by the first angle value with front
The angle value that icon is turned subtracts each other, and draws the required angle value rotated of current icon.
As in figure 2 it is shown, the implementation method that a kind of icon rotates, comprise the following steps:
S101: presetting long is 0.5s by the threshold values of triggering icon moving event, presets long by the valve triggering icon rotation status event
Value is 1s;
The long icon time value of pressing of S102: monitoring:
Condition one: if time value is more than presetting the long threshold values 0.5s by triggering icon moving event, long by triggering icon less than presetting
The threshold values 1s of rotation status event, triggers icon moving event, enters step S103;
Condition two: if time value is more than presetting the long threshold values 1s by triggering icon rotation status event, trigger icon rotation status thing
Part, then enter step S104;
Condition three: if time value is less than presetting the long threshold values 0.5s by triggering icon moving event, then circulatory monitoring;
S103: entering icon moving event, icon followed by the slip of finger and moves;
S104: enter icon rotation status event, detection finger slides and responds, obtains x1, y1 value of finger slip coordinate;Obtain
Take x, y value of icon place coordinate;
S105: subtract each other with y1 value by y value, subtracts each other with x1 value by x value, obtains a result and carries out antitrigonometric function meter
Calculate, angle(1)=Math.atan2 (y1-y, x1-x);Calculate the first angle value, by angle(1) with front once
The angle value angle(0 that icon is turned) subtract each other, draw the required angle value angle(2 rotated of current icon);
S106: icon rotates corresponding angle with coordinate value for initial point according to angle value.
The present invention passes through preset icon rotation status event, presets the response action triggering icon rotation status event, when response is dynamic
Making when occurring, the coordinate value that icon slides according to finger and coordinates of icon value carry out the angle value that computing draws and carry out respective angles
Rotate, to realize the interaction effect that icon response finger slip is made to rotate;The desktop icons made operation with user well is entered
Row interaction, solve conventional desktop icons can only see, immotile problem, add the experience of user.
Embodiment two
The present embodiment is in addition to following characteristics, with embodiment one:
As shown in figs. 34, the implementation method that a kind of icon rotates, comprise the following steps:
S201: presetting long is 0.5s by the threshold values of triggering icon moving event, presets long by the valve triggering icon rotation status event
Value is 0.5s, i.e. default long by triggering the threshold values of icon moving event and presetting length by the threshold values phase triggering icon rotation status event
With;
The long icon time value of pressing of S202: monitoring, whether more than threshold values 0.5s, triggers icon moving event and icon rotation the most simultaneously
Turn state event, simultaneously enter step S203 and S204;If it is not, then circulatory monitoring;
S203: entering icon moving event, icon followed by the slip of finger and moves;
S204: enter icon rotation status event, detection finger slides and responds, obtains x1, y1 value of finger slip coordinate;Obtain
Take x, y value of icon place coordinate;
S205: subtract each other with y1 value by y value, subtracts each other with x1 value by x value, obtains a result and carries out antitrigonometric function meter
Calculate, angle(1)=Math.atan2 (y1-y, x1-x);Calculate the first angle value, by angle(1) with front once
The angle value angle(0 that icon is turned) subtract each other, draw the required angle value angle(2 rotated of current icon);
S206: icon rotates corresponding angle with coordinate value for initial point according to angle value.
Embodiment three
The present embodiment is in addition to following characteristics, with embodiment one: what a kind of icon rotated realizes system, including:
Module is set, for preset icon rotation status event and icon moving event, preset trigger icon rotation status event and
The response action of icon moving event is: trigger gravity sensing event.
Gravity sensor, for monitoring the motion event of mobile terminal.
Monitoring modular, is used for monitoring whether gravity sensing event occurs.
Acquisition module, when entering icon rotation status event, detection finger slides and responds, and obtains the coordinate value slided.
Computing module, the coordinate value slided according to finger, the coordinate value in conjunction with icon calculates, and draws the angle that icon rotates
Value, icon rotates corresponding angle with coordinate value for initial point according to angle value, and concrete calculation is: acquisition module obtains respectively
X, y value of icon place coordinate, x1, y1 value of finger slip coordinate, computing module y value is subtracted each other with y1 value, uses
X value is subtracted each other with x1 value, obtains a result and carries out antitrigonometric function calculating, calculates the first angle value, by the first angle value with front
The angle value that icon is turned subtracts each other, and draws the required angle value rotated of current icon.
As it is shown in figure 5, the implementation method that a kind of icon rotates, comprise the following steps:
S301: preset icon rotation status event and icon moving event, preset triggering icon rotation status event and icon moves
The response action of event is: trigger gravity sensing event;
S302: gravity sensor presets deflection threshold values;
S303: gravity sensor capture mobile terminal angular deflection value in the x, y direction;
Whether S304: monitoring angle tilt value reaches to preset deflection threshold values, triggers icon rotation status event and figure the most simultaneously
Mark moving event, enters step S305 and step S306;If it is not, circulatory monitoring;
S305: entering icon moving event, icon followed by the slip of finger and moves;
S306: enter icon rotation status event, detection finger slides and responds, obtains x1, y1 value of finger slip coordinate;Obtain
Take x, y value of icon place coordinate;
S307: subtract each other with y1 value by y value, subtracts each other with x1 value by x value, obtains a result and carries out antitrigonometric function meter
Calculate, angle(1)=Math.atan2 (y1-y, x1-x);Calculate the first angle value, by angle(1) with front once
The angle value angle(0 that icon is turned) subtract each other, draw the required angle value angle(2 rotated of current icon);
S308: icon rotates corresponding angle with coordinate value for initial point according to angle value.
Embodiment four
The present embodiment is in addition to following characteristics, with embodiment one: what a kind of icon rotated realizes system, including:
Module is set, for preset icon rotation status event and icon moving event, preset trigger icon rotation status event and
The response action of icon moving event is: trigger acoustic control sense events.
Audio Controller, is used for receiving mobile terminal external audio data.
Monitoring modular, is used for monitoring whether acoustic control event occurs.
Acquisition module, when entering icon rotation status event, detection finger slides and responds, and obtains the coordinate value slided.
Computing module, the coordinate value slided according to finger, the coordinate value in conjunction with icon calculates, and draws the angle that icon rotates
Value, icon rotates corresponding angle with coordinate value for initial point according to angle value, and concrete calculation is: acquisition module obtains respectively
X, y value of icon place coordinate, x1, y1 value of finger slip coordinate, computing module y value is subtracted each other with y1 value, uses
X value is subtracted each other with x1 value, obtains a result and carries out antitrigonometric function calculating, calculates the first angle value, by the first angle value with front
The angle value that icon is turned subtracts each other, and draws the required angle value rotated of current icon.
As shown in Figure 6, the implementation method that a kind of icon rotates, comprise the following steps:
S401: preset icon rotation status event and icon moving event, preset triggering icon rotation status event and icon moves
The response action of event is: trigger acoustic control sense events;
S402: whether monitoring Audio Controller receives voice data, triggers icon rotation status event and icon the most simultaneously
Moving event, enters step S403 and step S404;If it is not, circulatory monitoring;
S403: entering icon moving event, icon followed by the slip of finger and moves;
S404: enter icon rotation status event, detection finger slides and responds, obtains x1, y1 value of finger slip coordinate;Obtain
Take x, y value of icon place coordinate;
S405: subtract each other with y1 value by y value, subtracts each other with x1 value by x value, obtains a result and carries out antitrigonometric function meter
Calculate, angle(1)=Math.atan2 (y1-y, x1-x);Calculate the first angle value, by angle(1) with front once
The angle value angle(0 that icon is turned) subtract each other, draw the required angle value angle(2 rotated of current icon);
S406: icon rotates corresponding angle with coordinate value for initial point according to angle value.
The technical scheme provided the embodiment of the present invention above is described in detail, and specific case used herein is to this
Principle and the embodiment of bright embodiment are set forth, and the explanation of above example is only applicable to help and understands that the present invention implements
The principle of example;Simultaneously for one of ordinary skill in the art, according to the embodiment of the present invention, in detailed description of the invention and should
All will change with in scope, in sum, this specification content should not be construed as limitation of the present invention.