A kind of desktop application icon is across screen merging method
Technical field
The present invention relates to a kind of application program of mobile phone processing method, especially with regard to one kind by multiple application drawings
The desktop application icon that mark merges is across screen merging method.
Background technology
At present, when merging to desktop application icon in smart mobile phone, user needs to want to merge
Application icon drag to another icon after carry out union operation, if it is desired to by other screens should
In being pressed from both sides with this document that icon also merges, need the icon on other screens is dragged after length is by operation
To the page that file is located, can just be put in this document folder, if it is desired to which multiple application icons are merged
Need frequently to carry out the above operation during to a file, it is comparatively laborious.
The content of the invention
For the problems referred to above, it is an object of the invention to provide a kind of desktop application icon is across screen merging method,
The method can be prevented effectively from troublesome operation when the multiple application icons of mobile phone desktop merge, and improve operation effect
Rate.
For achieving the above object, the present invention takes technical scheme below:A kind of desktop application icon is closed across screen
And method, which comprises the following steps:1)Desktop presses event sniffer, user to all icons registration length
When length presses desktop icons, operating system is obtained with the head of a household is by event and calls the length of registration by action listener
Device;To long by event, in traversal desktop, in addition to the icon being long pressed, all icons do and reduce desktop reception
Animation, reduced icon enter editing mode, and press figure to long by operating system by the way of drawing
The target lower left corner and the upper right corner are respectively provided with deletion button and addition packet button;2)Desktop is to all figures
Mark addition click event, user trigger click event after clicking on icon, and operating system judges whether desktop is located
In editing mode, amplification animation, and the figure that will click on are done to the click icon if in editing mode
Mark is added in the group icons set of operating system;3)User horizontally slips toggle screen, selects each
Application icon to be combined in individual screen, its operational approach and step 2)In the same manner;4)User clicks on choosing
Middle icon, operating system judge click location x-axis on the table, y-axis coordinate, if click location
In the packet button area in the clicked icon upper right corner, then into step 5)In carry out packet flow process;Such as
Deletion button area of the fruit click location in the clicked icon lower left corner, then call deletion to answer by operating system
With the interface of program;5)Desktop creates new file in click location first and is hidden in clicked figure
At mark, new icon is created according to the APP icons of group icons set in operating system then, and is added
To the superiors of desktop screen, and new icon is moved to into new folder position;Again by group icons
Clicked icon in set is added sequentially in new folder, while deleting new icon;Finally show
New folder;6)After the completion of packet, all icons exit editing mode, recover to life size, are closed
And icon can have vacant position in former screen, then operating system travels through all of desktop screen, and by icon
Be added in the original data acquisition system of operating system according to sequencing, according to the order in data acquisition system according to
It is secondary to put in screen, realize icon below being moved forward with the part that fills a vacancy;7)Icon is closed
And after the completion of, data processing module is notified by operating system, by all icon location informations in desktop screen
It is synchronized in data base, after starting next time, the grouping information of user will not then disappear.
Further, the step 1)In, in addition to the icon being long pressed, all icons reduce method
For:First, all icons on desktop are done by diminution animation operation by function enterScale (), if
There is icon already at deflated state, then do not process;Conversely, being respectively created one to the icon of all diminutions
Individual animation object;Secondly, animation object by function setDuration () arrange the animation persistent period,
Animation is arranged by function setInterpolator () and plays form;Finally, by function
AddUpdatelistener () arranges animation audiomonitor, reduces the animation for listening to by animation audiomonitor
Process is transmitted to operating system, after the completion of animation is listened to, is changed by operating system and is zoomed out icon
Size.
Further, the step 1)In, the desktop registration length by event sniffer method is:Pass through
Function setOnLongClickListener()Length is pressed into event sniffer and all icons associations of desktop,
Event sniffer is pressed to each icon addition length.
Further, the step 2)In, the method that the click icon amplifies animation is:First, lead to
Cross function exitScale () and clicked icon on desktop is done into amplification animation operation, if clicking on icon
In magnifying state, then do not process;Conversely, creating an animation object to clicking on icon;Secondly, move
Object is drawn by function setDuration () the setting animation persistent period, by function
SetInterpolator () arranges animation and plays form;Finally, by function addUpdatelistener ()
Animation audiomonitor is set, the animation amplification process for listening to is transmitted to operating system by animation audiomonitor,
After the completion of animation is listened to, the size of icon to be amplified is changed by operating system, amplify and click on icon.
Further, the step 5)In, the creation method of the new icon is:First, by function
CreatDragBitmap () creates a new icon, is obtained by function getLocationInDragLayer ()
To position of the clicked icon in desktop screen;Secondly, newly schemed according to the position calculation of clicked icon
The x-axis position being marked in desktop screen and y-axis position;Finally, according to the x-axis and y-axis for calculating
New icon is placed on the position by position, completes the addition of the new icon of desktop screen, and in desktop screen
Middle display animation.
Due to taking above technical scheme, which has advantages below to the present invention:1st, the present invention is due to adopting
Event sniffer is pressed to all icons registration length, and is respectively provided with by the lower left corner and the upper right corner of icon in length
Delete button and addition packet button so as to the editor of application icon faster, it is more convenient, by user's
All application icons are classified, and create multiple files, improve operating efficiency and user's impression.2、
The present invention is long by any application icon in desktop, and icon can enter into editing mode, and click is wanted to merge
To the application icon in a file, it is also possible to select the application icon on other screens, after the completion of selection
Any application icon is clicked on, all icons for selecting just now are merged into into a file automatically using meeting
In, including the application icon on other screens, so as to reduce number of times of the user to same operation, save
User time.3rd, the present invention need not be by application icon dragging one by one(Or drag across screen)Enter
Row union operation, efficiently solves and merges between screen that application icon is cumbersome, needs to carry out repeatedly
Icon could be merged into the problem in a file by dragging, and application icon is dragged between screen
Problem that can be more loaded down with trivial details between same screen is compared in the operation of merging.4th, the present invention can be by same screen
The application icon of curtain is disposably merged into same file folder, reduces user to the anti-of same operation
Again count, faster, more easily meet the demand of user.The present invention can extensively in smart mobile phone
Using.
Description of the drawings
Fig. 1 is the overall structure diagram of the present invention.
Specific embodiment
With reference to the accompanying drawings and examples the present invention is described in detail.
As shown in figure 1, the present invention provides a kind of mobile phone desktop application icon across screen merging method, which includes
Following steps:
1)Desktop presses event sniffer to all icons registration length, when pressing desktop icons with the head of a household, operation
System is obtained with the head of a household is by event and calls the length of registration by event sniffer;Desktop reception is to long by thing
Part, in traversal desktop, in addition to the icon being long pressed, all icons do diminution animation, and reduced icon enters
Enter editing mode, and pressed the lower left corner and the upper right corner point of icon by operating system by the way of drawing to length
Button and addition packet button She Zhi not be deleted;
Wherein, desktop registration length by event sniffer method is:By function
setOnLongClickListener()Length is pressed into event sniffer and all icons associations of desktop, to every
Individual icon addition length presses event sniffer;
In addition to the icon being long pressed, all icons diminution methods are:First, by function enterScale ()
All icons on desktop are done into diminution animation operation, if having icon already at deflated state, is not located
Reason;Conversely, being respectively created an animation object to the icon of all diminutions;Secondly, animation object passes through
Function setDuration () is arranged the animation persistent period, is arranged by function setInterpolator ()
Animation plays form;Finally, animation audiomonitor is arranged by function addUpdatelistener (), by moving
Draw audiomonitor the animation for listening to diminution process to be transmitted to operating system, after the completion of animation is listened to,
Changed by operating system and be zoomed out the size of icon, that is, reduce the big of in addition to icon is long pressed all icons
It is little.
2)Desktop adds click event to all icons(Icon is pressed including length and icon is reduced), Yong Hudian
Click event is triggered after hitting icon, whether operating system judges desktop in editing mode, if in volume
The state of collecting then does amplification animation to the click icon, and the icon that will click on is added to the packet of operating system
In icon set;
Wherein, the method for click icon amplification animation is:First, by function exitScale () by table
On face, clicked icon does amplification animation operation, if clicking on icon already at magnifying state, does not process;
Conversely, creating an animation object to clicking on icon;Secondly, animation object passes through function setDuration ()
The animation persistent period is set, animation broadcasting form is set by function setInterpolator ();Finally,
Animation audiomonitor is arranged by function addUpdatelistener (), it is dynamic by what is listened to by animation audiomonitor
Draw amplification process to transmit to operating system, after the completion of animation is listened to, change to be amplified by operating system
The size of icon, that is, amplify and click on icon.
3)User can horizontally slip toggle screen, select the application icon to be combined in each screen,
Its operational approach and step 2)It is identical, will not be described here.
4)User clicks on and chooses icon, and operating system judges click location x-axis on the table, y-axis seat
Mark, if click location is in the packet button area in the clicked icon upper right corner, into step 5)In
Carry out packet flow process;If click location is in the deletion button area in the clicked icon lower left corner, by grasping
The interface for deleting application program is called as system.
5)Desktop creates new file in click location first and is hidden at clicked icon, then
New icon DragView is created according to the APP icons of group icons set in operating system, and is added to
The superiors of desktop screen, and new icon DragView is moved to into new folder position;Again will
Clicked icon in group icons set is added sequentially in new folder, while deleting new icon
DragView;New folder is shown finally;
Wherein, creating new icon DragView is used for animation, and new icon DragView is added to
Desktop screen, the creation method of new icon DragView is:First, by function
CreatDragBitmap () creates a new icon, is obtained by function getLocationInDragLayer ()
To position of the clicked icon in desktop screen;Secondly, newly schemed according to the position calculation of clicked icon
The x-axis position being marked in desktop screen and y-axis position;Finally, according to the x-axis and y-axis for calculating
New icon is placed on the position by position, completes the addition of the new icon DragView of desktop screen, and
Animation is shown in desktop screen.
6)After the completion of packet, all icons exit editing mode, recover to life size, merged figure
Can have vacant position in being marked on former screen, then operating system travels through all of desktop screen, and by icon according to elder generation
Sequentially it is added in the original data acquisition system of operating system afterwards, is put according to the order in data acquisition system successively
To in screen, realize icon below being moved forward with the part that fills a vacancy.
7)After the completion of icon merges, data processing module is notified by operating system, by institute in desktop screen
There is icon location information to be synchronized in data base, after starting next time, can ensure that the grouping information of user will not
Disappear.
The various embodiments described above are merely to illustrate the present invention, and each step and implementation all can be to be varied from
, on the basis of technical solution of the present invention, all improvement separate step carried out according to the principle of the invention
And equivalents, should not exclude outside protection scope of the present invention.